开发者

Work with the cart in the billing.phtml

inside the checkout onepage billing.phtml I have to do several checks and even remove or add stuff to the cart.

But I don't开发者_如何学JAVA seem to find how to do that

how can I change the cart from within an template?

Thanks,

Joe


I would recommend that you don't apply these logic changes in the phtml. You should try to work with the Shipping or Payment method PHP code, either by extending Magento's core methods or writing your own. There are numerous tutorials on the Magento wiki or other blogs on how to achieve this.

By editing the phtml directly, you run the risk of breaking when Magento releases patches or upgrades, and it is bad practice in general.


From that file you can use $this->getQuote() to get a Mage_Sales_Model_Quote object. Methods you might find useful on that object are getAllItems(), addItem() and removeItem().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜