0

I am new to Magento and am running 1.9.0.1 with a purchased theme that I have reworked. My client's store sells organic seeds with some of products being sold "per 1 LBS", "per 1/2 LBS" or "per 1/4 LBS" which I would like to show behind the price wherever that product is displayed. For instance, broccoli seeds would ideally show "$14.88 per 1/2 LBS".

I can not seem to figure out a way to add the text either as part of the price or as a text block behind the price. Is there a way to do this inside the admin panel?

Thank you!

1 Answer 1

1

Steve Johnston yes It's Very Simple. Hope you have basic knowledge of Product, Attributes and Attribute set like how to create , update, delete.

Step 1 : Login in your Magento backend. and go to catalog >> Attributes >> Manage Attribute Click on that.

Step 2 : Now pres son Add New Attribute. please the all the necessary detail and save button. make sure have to remember the Attribute Code of the Attribute.

Step 3: go to catalog >> Attributes >> Manage Attribute set Click on that. select which attribute set you are using at time of product creation. Assign to that attribute to that set. Make sure you can assign that attribute in new tab with Custom Attribute.

Step 4: Now go to catalog >> manage product. Open that Attribute Set product find the Custom Attribute tab and in that you can see the new Attribute which you have created.

Step 5: Enter value like 1/2 LBS and save the Product. Refresh all the cache if Enable.

Step 6: Now you have done with the backend now we have to display that Arbitrate in listing page as well as detail page of Product. Right Now I am assign to default Magento Theme.

Step 7: open this file app\design\frontend\rwd\default\template\catalog\product\list.phtml. find below thing in this file it will coming two times.after that add below line also.

<?php echo $this->getPriceHtml($_product, true) ?>
<span><?php echo $this->__("per").$_product->getData('Attribute Code'); ?></span>

Step 8: open this file app\design\frontend\rwd\default\template\catalog\product\view.phtml add below code same as above like.

 <div class="price-info">
        <?php echo $this->getPriceHtml($_product); ?>
        <?php echo $this->getChildHtml('bundle_prices') ?>
        <?php echo $this->getTierPriceHtml() ?>
        <span><?php echo $this->__("per").$_product->getData('Attribute Code'); ?></span>
 </div>

Step 9: You have to set CSS as per your Theme.

2
  • Thank you Keyul!! I have completed the steps outlined and I am a lot closer but still have a couple of questions. On the individual product pages, it does now show "per 1/2 Lb." but it is not behind the price, instead it is below it. How can I have it behind the price so that it always shows that way? Including in the shopping cart? (see: sproutlady.com/seeds/favorites/broccoli-sprouts.html) The other issue is that on list pages, only "per" is showing and not the attribute "1/2 Lb." and it is also below the price and not next to it. (sproutlady.com/seeds/favorites.html) Oct 1, 2014 at 2:17
  • if you want to display all things on detail page, cart Page, mail, Checkout page then you have to add same logic in that relative files
    – Keyul Shah
    Oct 7, 2014 at 5:36

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.