简体   繁体   English

Magento Shopgram Checkout页面

[英]Magento Shopgram Checkout Page

Now I have read over dozen threads and even a dozen different web pages which have asked the similar question. 现在我已经阅读了十几个线程甚至十几个不同的网页,这些网页都提出了类似的问题。 However the responses did not work for me. 但是这些回复对我不起作用。 I tried all of them. 我尝试了所有这些。 Also to note I could not comment on the questions hence the reason for this thread. 还要注意我无法评论问题,因此这个线程的原因。 To be as detailed as possible FROM what i can tell in the magento checkout is something to do with SHOPGRAM? 要尽可能详细,我在magento结账时可以告诉我与SHOPGRAM有什么关系? It is my current checkout cart. 这是我目前的结帐购物车。 I have two custom attributes called license_period and another called number_of_devices. 我有两个名为license_period的自定义属性,另一个名为number_of_devices。

I need to add the two fields within the checkout cart. 我需要在结帐购物车中添加两个字段。 One thing to note is that is out of the testing i have done it seems the file cart_new.phtml located @ /app/design/frontend/shopgram/default/template/checkout controls the layout. 有一点需要注意的是,我已经完成了测试,似乎文件cart_new.phtml位于@ / app / design / frontend / shopgram / default / template / checkout控制布局。 this script i have tried editting I have tried alot however any change i make does not even appear. 这个脚本我试过编辑我已经尝试了很多但是我做的任何改变甚至没有出现。 Even when i edit the default.phtml @/app/design/frontend/shopgram/default/template/checkout/cart/item It does not make any changes i have even deleted most of the files in these directorys and it causes no change to the content. 即使我编辑default.phtml @ / app / design / frontend / shopgram / default / template / checkout / cart / item它没有做任何更改我甚至删除了这些directorys中的大多数文件,它不会导致任何更改内容。 Only the cart_new.phtml controls the content. 只有cart_new.phtml控制内容。

Now i do not know magento too well so i might be mistaken. 现在我不太了解magento,所以我可能会弄错。 However when i did try a lot of different queries and most of them do nothing. 然而,当我尝试了很多不同的查询时,他们中的大多数都什么都不做。 some of them cause the table to disapear. 其中一些导致桌子消失。

The following are just a 2 out of the 100 links I have tried. 以下是我尝试过的100个链接中的2个。 However I can only post two links. 但是我只能发布两个链接。

Display Magento Custom Option Values in Shoping Cart 在购物车中显示Magento自定义选项值

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

Posting this script Here incase anyone needs to know how to add custom attributes into your shopping cart. 发布此脚本此处,任何人都需要知道如何将自定义属性添加到购物车中。

/**
** 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 PS

You will find This script was placed in the cart_new.php which is located @app/design/frontend/shopgram/default/template/checkout. 你会发现这个脚本放在cart_new.php中,它位于@ app / design / frontend / shopgram / default / template / checkout。

Another piece of advice is that if you place this code anywhere in the script it will not work. 另一条建议是,如果将此代码放在脚本中的任何位置,它将无法工作。 So do not get fustrated if it does not work. 所以如果它不起作用,不要被贬低。 It has to go somewhere where it will not block the other scripts from working. 它必须去某个不会阻止其他脚本工作的地方。 I placed mine within the the actual for each items as items loop where it draws the data for the shopping cart. 我把它放在每个项目的实际内部作为项目循环,它绘制购物车的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM