I’d like to display the SKU reference number in the frontend. I thought I could configure this in attributes but it is not there. Anybody know how to do this?
i’m having problems getting this to work. could i get a hint as to where you placed it in your code / on your site as an example?
edit: bah, nevermind, disregard this idiot, i was editing the wrong file (must have double clicked incorrectly when i went to open it. everything works fine now.
Did you do update lately? The updates rewrite the template files as well. What I do, is create custom theme and skin that hold files I’ve changed. That way magento update rewrites only original files and leaves my files untouched. There are several HowTos that explain how to create and use custom theme.
One of the things keeping it from working may be that the Magento code is more object orientated than before. The old code snippet may no longer work with a newer version of Magento.
Note the “$this->” and “htmlEscape” function instead of nl2br. Basically I made it look like the $_product->getName() line right above it, with the same syntax and functions it was using.
Finally, I placed this around line 47 in my file, /app/design/frontend/default/modern/template/catalog/product/view.phtml
This put the SKU right underneath the name of the product. If you’re using a different template, you’ll need to be sure you’re editing the correct file for your template. Finally the layout of your template may (and probably will) vary, so feel free to experiment with the placement.
Also be sure to clear your cache if you don’t see a change. Under Admin -> System -> Cache Management
Instead of changing any code at all why not just create another attribute with a name like model number or something and chosse to sisplay it on fromt end.
Except for the fact that it takes a few seconds longer to add the information it works fine.
Instead of changing any code at all why not just create another attribute with a name like model number or something and chosse to sisplay it on fromt end.
Except for the fact that it takes a few seconds longer to add the information it works fine.
This works, but if you have hundreds of products then it takes a heck of a lot longer then a few seconds…