1

we have 5000 products in site

we have 5 attribute-set , each attribute have 1000 products each.

for products of only one attribute set, under description tab, we have to add this text " color may vary as shown in above image"

how we can achieve this for only one attribute-set products.

we don't want this text for other attribute-set products

2 Answers 2

1

you can achieve this simply adding in product detail page..

    <?php $attributeSetModel = Mage::getModel("eav/entity_attribute_set");
$product=Mage::getModel('catalog/product')->load($_product->getId());
 $attributeSetModel->load($product->getAttributeSetId());
echo $attributeSetName  = $attributeSetModel->getAttributeSetName();
if($attributeSetName=='you attibute name'){ echo $this->__('color may vary as shown in above image'); } ?>
16
  • Fatal error: Call to a member function getAttributeSetId() on a non-object in $attributeSetModel->load($product->getAttributeSetId()); Jan 27, 2016 at 10:05
  • use $_product->getAttributeSetId() Jan 27, 2016 at 10:06
  • Parse error: syntax error, unexpected ';' in smae line , i am using this : $attributeSetModel->load($_product->getAttributeSetId(); Jan 27, 2016 at 10:09
  • where you are placing this code? Jan 27, 2016 at 10:11
  • in the end of the view.phtml file Jan 27, 2016 at 10:12
1

If I understand right your question one of the solution is that you can do this with the following steps using import/export :
- export all your product from the wanted attribute set
- modify the exported file with your new attribute value
- import the file

3
  • but if i update like this, the description will lost for all 1000 products. we added different description for different products. Jan 27, 2016 at 9:54
  • OK I misunderstand your quesiton, please see my edit Jan 27, 2016 at 9:58
  • No problem, we will check it. Jan 27, 2016 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.