开发者

Magento:How to display drop down attribute on the product listing page

I have created a drop down at开发者_StackOverflowtribute with a configurable product.

I would like to add in the grid/list product’s page the combo with the choice of my select attribute in order to be able to put in directly from this page the product into my cart wich is impossible for the moment : i have to go on the second page to choose the attribute.

i’ve read a lot of threads but i don’t find a way to achieve it.

thanks for the help.


So you want product "add to cart button" with "custom attributes" to be added to the product listing pages..there's an extension for this, see below:

http://www.mageworx.com/ajax-cart-magento-extension.html

I have only managed to add an "add all item to cart" button and "add to cart" button on my category listing pages.


For the attributes which have a frontend type “Select” we need to define options that on the product page converted into a dropdown. For example attribute color may have options Red, Green, Blue etc. which are defined in the admin area.

We can easily collect all the defined options for any attribute.

// use your own attribute code here
$attribute_code = "color";
$attribute_details = Mage::getSingleton("eav/config")->getAttribute("catalog_product", $attribute_code);
$options = $attribute_details->getSource()->getAllOptions(false);
Foreach($options as $option){
// print_r($option) and find all the elements
echo $option["value"];
echo $option["label"];
}

For more information about magento cart products, visit our Web\Agency-shop

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜