是否可以在前端的分组产品下显示关联产品的自定义属性? (Magento) [英] is it possible to show custom attributes of associated products under a grouped product in front end? (Magento)

查看:48
本文介绍了是否可以在前端的分组产品下显示关联产品的自定义属性? (Magento)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的magento分组产品中存在典型情况. 是否可以在前面的分组产品"下显示关联产品的自定义"属性(颜色下拉列表),如下所示

I have a typical condition in my magento Grouped product. Is it possible to show Custom attribute (color dropdown) of associated product under Grouped products in the fronted.. as shown below

考虑样品毯产品

让我知道我是否不清楚. 谢谢

Let me know if i am not clear. Thanks

推荐答案

目前尚不清楚您的问题,但我会举一个小例子来说明如何获取文本字段,多选或下拉列表框值.

It's not clear your question but I would give you a small example to get text field, multiple select or drop-down listbox value.

首先,我们应该加载产品集合:

First, we should load the product collection :

<?php
   // load the product that id 125, then show attributes of the product
   $product = Mage::getModel('catalog/product')->load($this->getProduct()->getId(125));
   echo $product->getCustomAttribute();

   // lets say your custom attributes name is "size" and type is text field
   echo $product->getSize();

   // lets assume your custom attributes name is "product_size then
   echo $product->getProductSize();

   // lets assume your attribute type is drop-down, this will get array of attribute options instead of value that you selected
   echo $product->getAttributeText(product_size);

   // to get drop-down value that you selected
   $attribute = $product->getAttributes();
   $productSize = $attribute['product_size']->getFrontend()->getValue($product);

让我知道它是否不符合您的要求.

let me know if it's not meet your request.

这篇关于是否可以在前端的分组产品下显示关联产品的自定义属性? (Magento)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆