Magento Shopgram 结帐页面

Magento Shopgram Checkout Page

现在我已经阅读了十几个主题,甚至还有十几个不同的网页都提出了类似的问题。但是,这些答复对我不起作用。我尝试了所有这些。另请注意,我无法对问题发表评论,因此无法对此线程发表评论。从我在 magento 结帐中可以看出的内容尽可能详细与 SHOPGRAM 有关?这是我目前的结账车。我有两个名为 license_period 的自定义属性,另一个名为 number_of_devices.

我需要在结帐购物车中添加这两个字段。需要注意的一件事是,在我所做的测试之外,似乎位于@ /app/design/frontend/shopgram/default/template/checkout 的文件 cart_new.phtml 控制布局。这个脚本我已经尝试过编辑我已经尝试了很多但是我所做的任何更改甚至都没有出现。即使我编辑 default.phtml @/app/design/frontend/shopgram/default/template/checkout/cart/item 它也没有做任何更改我什至删除了这些目录中的大部分文件并且它不会导致内容发生变化。只有 cart_new.phtml 控制内容。

现在我不太了解magento,所以我可能会误会。但是,当我确实尝试了很多不同的查询时,大多数查询什么都不做。其中一些导致 table 消失。

以下只是我尝试过的 100 个链接中的 2 个。但是我只能 post 两个链接。

Display Magento Custom Option Values in Shoping Cart

https://magento.stackexchange.com/questions/5057/magento-checkout-getting-custom-attribute-value

在此处发布此脚本,以防有人需要知道如何将自定义属性添加到您的购物车中。

/**
** This will load the product attributes. Now you can create a plugin to do this which will 
**help with performance however in my case the plugin was not working correctly.
**/

    <?php $_product= Mage::getSingleton('catalog/product')->load($_item->getProductId()) ?> 



/**
**Use javascript to add the attribute into the correct location in the shopping cart.
**
**/

<script>

 var elements = document.getElementsByClassName('item-options'), last = elements.length - 1;

 elements[last].innerHTML = "<dt>Odkaz </dt><dd>Instalační soubor</dd>   <dt>No Of Devices:</dt> <dd><?php echo $_product->getResource()->getAttribute('number_of_devices')->getFrontend()->getValue($_product); ?></dd>  <dt>License Period:</dt> <dd><?php echo $_product->getResource()->getAttribute('licence_period')->getFrontend()->getValue($_product); ?></dd> ";
</script>                       

PS

你会发现这个脚本被放置在位于@app/design/frontend/shopgram/default/template/checkout.

的cart_new.php

另一条建议是,如果您将此代码放在脚本中的任何位置,它将不起作用。因此,如果它不起作用,请不要感到沮丧。它必须去某个地方,它不会阻止其他脚本工作。我将我的放在每个项目的实际中,因为项目循环在其中为购物车绘制数据。