Magento - 如何获取购物车中单个产品的小计?
我想显示购物车中每种产品(按 ID)的总价。
qty | single price | total
2 | $ 2.00 | $ 4.00 <-- that's what i need
3 | $ 5.00 | $ 15.00
| Subtotals: | $ 19.00 <-- that's what i get with the code below
$totals = Mage::getSingleton("checkout/cart")->getQuote()->getTotals();
$subtotal = $totals["subtotal"]->getValue();
echo Mage::helper('checkout')->formatPrice($subtotal);
欢迎任何帮助。
I want to display the total price for each product (by id) in the cart.
qty | single price | total
2 | $ 2.00 | $ 4.00 <-- that's what i need
3 | $ 5.00 | $ 15.00
| Subtotals: | $ 19.00 <-- that's what i get with the code below
$totals = Mage::getSingleton("checkout/cart")->getQuote()->getTotals();
$subtotal = $totals["subtotal"]->getValue();
echo Mage::helper('checkout')->formatPrice($subtotal);
Any help is welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以使用:
you can use: