久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 list.phtml 中顯示產品屬性 - Magento

Show product attributes in list.phtml - Magento(在 list.phtml 中顯示產品屬性 - Magento)
本文介紹了在 list.phtml 中顯示產品屬性 - Magento的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

你好,我已經閱讀了很多關于這個的帖子,雖然它有效但并不完整.

Hello I have read many posts about this, and while it works its not complete.

例如;屬性 1 = 鞋碼,屬性 2 = 鞋色.兩者都在下拉列表中,我想在類別頁面中列出每個產品的所有可能的屬性顏色.

For example; Attribute 1= shoesize and attribute 2 = shoe color. Both are in a dropdown and I would like to list all of the possible attribute colors per product within the category pages.

問題:當我測試代碼時,它只會顯示第一個鞋子顏色,而不是所有可能性.我在這里做錯了什么?

Problem: When I test the code it will only display the first shoe color, instead of all posibilites. What am I doing wrong here?

以下是我所擁有的 3 個示例.所有代碼都有效,但只顯示第一個屬性顏色.示例 1:

Here are 3 examples of what I have. All code work, but only shows the first attribute color. Example 1:

<!-- Find the following loop -->
<?php foreach ($_productCollection as $_product): ?>
<!-- Inside it insert one of the following codes as needed -->
<!-- Use this for regular text attributes -->
<?php echo $_product->getMyAttribute() ?>
<?php echo $_product->getAnotherCustomAttribute() ?>

<!-- Use this for dropdown attributes -->
<?php echo $_product->getAttributeText('shoecolor') ?>
<?php endforeach?>
<!-- ... --> 

示例 2

<?php echo $_product->getResource()->getAttribute('shoecolor')->getFrontend()->getValue($_product) ?>

示例 3

<?php $type = "simple"; $p = "0" ?> 
<?php foreach ($_productCollection as $_product): ?> 
<?php $custom = Mage::getModel('catalog/product_type_configurable')->setProduct($_product); ?> 
<?php $col = $custom->getUsedProductCollection()->addAttributeToSelect('shoecolor')->addFilterByRequiredOptions(); ?> 
<?php foreach($col as $simple_product) { $p=$simple_product->getId(); $type="configurable"; } ?> 

<?php if($type == "configurable"): ?> 
<h5><?php echo $_product->load($p)->getAttributeText('shoecolor'); ?><?php $type="simple" ?></h5> 
 <?php endif; ?> 

推薦答案

你可以在屬性編輯頁面進行配置

you can just config it in attribute edit page

用于產品列表 -> 是

Used in Product Listing -> Yes

這篇關于在 list.phtml 中顯示產品屬性 - Magento的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 亚洲 欧美 另类 综合 偷拍 | 国产区精品在线观看 | 一区二区三区在线看 | 最新伦理片| 亚洲精品成人免费 | 成年人在线| 麻豆精品久久久 | 自拍偷拍亚洲欧美 | 蜜桃视频在线观看免费视频网站www | 日本在线一区二区三区 | 亚洲电影第三页 | 成人av鲁丝片一区二区小说 | 久久久91精品国产一区二区三区 | 国产精品久久久久久久久久三级 | 成人精品一区 | 国产男女猛烈无遮掩视频免费网站 | 中文字幕免费 | 男女免费在线观看视频 | 97偷拍视频| 久久99蜜桃综合影院免费观看 | 精精国产xxxx视频在线播放 | 一区二区三区欧美大片 | 国产在线小视频 | 久久视频免费观看 | 91美女在线观看 | 亚洲成人av一区二区 | 99re在线视频 | h视频在线播放 | 欧美性大战久久久久久久蜜臀 | 网站黄色在线免费观看 | 超碰成人在线观看 | 久久国产一区二区三区 | 黄色片在线网站 | 51ⅴ精品国产91久久久久久 | 色综合久久天天综合网 | 电影午夜精品一区二区三区 | 在线精品国产 | 久久久久国产一区二区三区四区 | 91视视频在线观看入口直接观看 | 99久久精品免费看国产免费软件 | 黄视频免费观看 |