A customer wanted to, that the standard designation “Quantity” different products differently is. Example: For product 1 should it “Piece” be, in product 2 on the other hand “Days” in product 3 but “Liter”.
We have solved this with the following procedure:
- System of a product attribute named “Amounts designation” and the code “qty_name” (may be referred to individually)
- The front-end features everything can on “No” be.
- We have created this statement as required entry, so it is by no means forgotten and have as the default “Quantity” registered (because is in new products advance the inside).
- Then the new attribute to the desired Attributset is added. (Possibly. Running Index)
- Now already the value can be set even at the individual products. It has to be taken into account, that the field is empty for all already existing products! Thus, one could e.g.. about “Update Attributes” once for all / Set up selected products corresponding values.
- Now the file is addtocart.phtml from the folder app / design / frontend /[IhrTemplateOrdner]/[Ihr Template]/template/catalog/product/view geöffnet.
- Then, the line is <label for=”qty”><?php echo $this->__(‘Qty:’) ?></label> (as. 33) either uncommented, deleted or replaced by <label for=”qty”><?php echo $ _product->getData(‘qty_name’) ?></label>
- Save file, Upload and clear the cache in doubt.
- Now the desired value is displayed in the frontend product specific.
Used in Magento Version 1.9 Comments? Additions? Notes? Gladly!
Hallo,
i tried that, but with getData I only get the ID of the attribute.
With getAttributeText(‘qty_name’) then it worked.
Best Regards,
Rolf