简体   繁体   English

如何在购物车页面的产品包装中放置商品的缩略图?

[英]How do I place a thumbnail of items in a product package on the cart page?

I'm trying to place the thumbnail of items of product package on the cart page. 我试图将产品包装项目的缩略图放在购物车页面上。 I tried this code: 我尝试了这段代码:

<img class="thumbnail"
                     src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->constrainOnly(true)->resize(80, 80); ?>"
                     alt="<?php echo $this->escapeHtml($this->getImageLabel()) ?>"
                     title="<?php echo $this->escapeHtml($this->getImageLabel()); ?>" />

In this archive: app/design/frontend/default/my-theme/template/checkout/cart/item/default.phtml 在此档案中: app / design / frontend / default / my-theme / template / checkout / cart / item / default.phtml

Screenshot of cart page 购物车页面的屏幕截图

And this shows only default thumbnail image. 并且这仅显示默认的缩略图图像。

What code can I use to solve this? 我可以使用什么代码来解决这个问题?

My magento version: 1.9.2.2 我的magento版本:1.9.2.2

Please try $this->getProductThumbnail(), I think this should be works. 请尝试$ this-> getProductThumbnail(),我认为这应该可行。 Thanks. 谢谢。

暂无
暂无

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

相关问题 如果我单击已在购物车中的产品的“添加到购物车”按钮,如何重定向到购物车页面 - How do I redirect to the cart page if I click on the 'Add to cart' button for a product that's already in cart 将产品缩略图包装在 WooCommerce 购物车页面上 - Wrap product thumbnail on WooCommerce cart page in a span 从购物车页面上的产品缩略图中删除链接 - Removing link from product thumbnail on cart page 如何使两个具有不同产品 ID 的产品在 WooCommerce 购物车页面 (BOGO) 上充当一个产品 - How do I make two products with different product IDs act as one on WooCommerce cart page (BOGO) 如何调用WooCommerce变量产品下拉列表并将其添加到购物车到任何页面? - How do I call the WooCommerce variable product dropdown and add to cart to any page? 如何将购物车商品产品重定向到Woocommerce中的特定页面? - How can i redirect cart item product to specific page in Woocommerce? 如何根据购物车中的产品阵列或类别隐藏DIV? - How do I hide a DIV based on a product array or category in the cart? 将产品添加到购物车后,用户刷新页面,然后如何显示添加到购物车中的数据 - after adding the product in the cart and the user refreshes the page then how can I display the data which is added in the cart 我如何在Joomla 2.5 Constancemart上显示购物车中的物品数量? - how do i display the number of items in the cart on Joomla 2.5 virtuemart? 添加到购物车并侦听“ checkout_cart_product_add_after”事件时,如何获取产品数据 - how do I get product data when adding to cart and listening for the “checkout_cart_product_add_after” event
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM