Magento Forum

   
I wish to display BRAND/MANUFACTURER attribute in Product Grid and Product Detail page title
 
oxygenwebstudio
Jr. Member
 
Total Posts:  30
Joined:  2011-08-22
 

Hi,

Im doing some SEO on the site - all good fun!

But I am stuck on how do I display the BRAND name in 2 places:

The product grid / list page
The product detail page.

Essentially, I would like to have <BRAND> & “ “ & <PRODUCT NAME>

Can anyone point me out the code necessary to pull this out in the relevant file?

Thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1839
Joined:  2009-06-04
 

What version of Magento is this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
oxygenwebstudio
Jr. Member
 
Total Posts:  30
Joined:  2011-08-22
 

Thanks…

Magento 1.6.2.0

 
Magento Community Magento Community
Magento Community
Magento Community
 
VnEcoms
Sr. Member
 
Avatar
Total Posts:  121
Joined:  2012-09-13
Vietnam
 

In order to display the brand name just use this code
<?php echo $_product->getAttributeText('manufacturer')?>
note that “manufacturer” is attribute code of brand.

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1839
Joined:  2009-06-04
 

Since Manufacturer’s have different “Brands” we have a separate brand attribute in addition to the Manufacturer.

Our manufacturer attribute is a dropdown to prevent fatfinger exponential growth of manufacturers. (stock Magento)

Our brand attribute is a text entry box to allow a little more freedom (brands change all the time, some internal rebranding happens, etc. In the end, a dropdown for this gets monumentally messed up as you may have 600 manufacturers and 2000 intermixed brands in the separate dropdown if you go that route.

In the product listing, you will need the following:

<?php echo $_product->getAttributeText('manufacturer')  . " - " $_product->getBrand() . " - " $_product->getName() ?>

You MUST also have in Attribute Management for the attributes you wish to show in the listing have “Used in Product Listing” set to Yes so they will be returned in the $_product collection. Screen clip below is to show you where this is found.

On the product view page, the whole collection is pulled in, so you don’t have to worry about attribute management settings. The same collection $_product is used, so the above code block will work.

app/design/frontend/default/your_theme/template/catalog/product/list.phtml
app/design/frontend/default/your_theme/template/catalog/product/view.phtml

Image Attachments
use-product-listing.jpgview.jpglisting.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
oxygenwebstudio
Jr. Member
 
Total Posts:  30
Joined:  2011-08-22
 

Thanks! Thats working smile

If Brand or Manufacturer is empty, what will be the response?

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1839
Joined:  2009-06-04
 

You would end up with a blank spot. One of the ways to handle this would be to use if conditionals to test for existence and then turn off display for that element.

<?php if ($_product->getAttributeText('manufacturer')): ?>
       <?php 
echo $_product->getAttributeText('manufacturer')  . " - " ?>
<?php 
endif; ?>

<?php 
if ($_product->getBrand()): ?>
       <?php 
echo $_product->getBrand() . " - " ?>
<?php 
endif; ?>

<?php $_product
->getName() ?>

Enclose that in the proper tag like <p></p> and it all concatenates together with suppressed display for items not found. The previous would have displayed along the lines of

Manufacturer - Brand - Name of product

with missing Manufacturer and Brand items you would have

- - Name of product

Which isn’t quite so nice a display as for example, missing brand showing as

Manufacturer - Name of product

 
Magento Community Magento Community
Magento Community
Magento Community
 
oxygenwebstudio
Jr. Member
 
Total Posts:  30
Joined:  2011-08-22
 

Thanks! That helps a lot smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anton B
Member
 
Avatar
Total Posts:  37
Joined:  2009-01-20
 

EVERYONE PLEASE BE WARY OF THIS DEVELOPER!!!

http://www.magentocommerce.com/boards/viewthread/37669/

I’ve posted this reply in my thread that he replied to:

I’m going to quote you, davidmst, so that simply deleting your comment reply won’t be an easy way out.
Here’s a screenshot, just for documentation, of davidmst’s post. http://i.imgur.com/RpC8S2L.png

davidmst - 23 May 2013 08:21 PM

Easy One Page Checkout Extension!!!!

Visit Extension Page: http://www.magebay.com/shop/easy-one-page-checkout.html

Live Demo: http://magebay.com/livedemo/opc/index.php/

Backend Demo: http://magebay.com/livedemo/opc/index.php/admin

This is a complete and utter ripoff of the ORIGINAL One Step Checkout for Magento.

http://www.onestepcheckout.com/

OneStepCheckout.com:
http://i.imgur.com/pldwpwD.png

vs.

Magento Easy One Page Checkout
http://i.imgur.com/2hrXzoq.png

David, you should be ashamed of yourself. You’ve literally copied their module down to every single element. Even the text: “Already registered? Click here to Login”, “1,2,3,checkmark.”. This is really quite sad, and as someone whose had his work blatantly stolen before, it makes me quite angry. There are many MANY ways of creating a very nice one step checkout, you could have done something original. Instead you’ve COMPLETELY copied them. This is just disgusting!

OneStepCheckout.com has been around for ages and their module is very mature, meaning all of the bugs have been worked out.

I bought my first license for it not much longer after I made the original post in 2009 after waiting for 6 months for two developers to finish the job, which they completely botched. My sales weren’t going up, in fact they went down, and I knew something was up when a customer notified me that they couldn’t check out.

You’ve stolen their design, and possibly, their source code. At this point, I wouldn’t put it past you skimming people’s credit card numbers from your customers websites. It’s definitely not a far leap, if you think stealing one thing is okay, why not another, right?

Believe me, the last thing you want is your checkout not working. And trusting a developer that didn’t come up with an original idea, and instead completely ripped off another developers work, is not something I would advise.

 
Magento Community Magento Community
Magento Community
Magento Community
 
DSRM
Jr. Member
 
Total Posts:  5
Joined:  2011-12-05
 

I really want to be able to do this in Magento Go. I can’t get acces to the core files so is there a way to do this in the XML layout Update field in the category management page?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top