Retrieve and display the sku
I need this H3 to display the sku of our products in Magento 1.9
<h3 class="product-name<?php echo ($_options = $this->getOptionList())? " has-options": ""; ?>"><?php echo $this->escapeHtml($this->getProductName()) ?> <span>SKU: <?php echo $this->escapeHtml($this->getSku());?></span></h3>
And so far, it will not display the sku.
5 Replies
what is
$this
in this context? what class I mean
also, when you post code, you can wrap it in ```php and ```, and it'll do syntax highlighting
```php
print "Hello world";
```
turns into
$this stands for the product
Oh, okay
Thanks
You could rewrite $this like $product
are you getting any errors in your server log? what does the output look like?
I'm also having trouble finding any documentation for Magento online, which is weird... do you have a link to the documentation?
just as a test, (without knowing the rest of your code). Does it also fail without the escapeHtml method? then we can rule that one out
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View