Magento – designation “Quantity” change specific articles

PictureA 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:

  1. System of a product attribute named “Amounts designation” and the code “qty_name” (may be referred to individually)
  2. The front-end features everything can on “No” be.
  3. 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).
  4. Then the new attribute to the desired Attributset is added. (Possibly. Running Index)
  5. 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.
  6. Now the file is addtocart.phtml from the folder app / design / frontend /[IhrTemplateOrdner]/[Ihr Template]/template/catalog/product/view geöffnet.
  7. 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>
  8. Save file, Upload and clear the cache in doubt.Picture
  9. Now the desired value is displayed in the frontend product specific.

Used in Magento Version 1.9 Comments? Additions? Notes? Gladly!

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

One comment on “Magento – designation “Quantity” change specific articles”

  1. 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

Leave a Reply

Your email address will not be published. Required fields are marked *