hope someone can help.
I'm trying to set up a 3rd party review platform (TrustPilot) for our Magento 1.9 CE store, using Ultimo theme. There is a product review box which will display individual product reviews on product pages. The code to display this box looks pretty simple, but it requires us to add the variable for the product sku and product name.
Here's the code (I've added in capitals where the two bits of data need to go);
<!-- TrustBox widget --> <div class="trustpilot-widget" data-locale="en-GB" data-template-id="5717796816f630043868e2e8" data-businessunit-id="51cd30a800006400054f735a" data-style-height="700px" data-style-width="100%" data-theme="light" data-sku="MY SKU CODE GOES HERE" data-name="MY PRODUCT NAME GOES HERE"> <a href="https://uk.trustpilot.com/review/valueincontinence.co.uk" target="_blank">Trustpilot</a> </div> <!-- End TrustBox widget -->
This code works fine if I hard code in the actual SKU (i.e. H12345). I was expecting to be able to replace the 'MY SKU CODE GOES HERE' with something like;
<?php echo $_product->getData('sku') ?>
...but that doesn't work.
I first tried this from the admin backend CMS in a custom block/tab - if I hard code sku, it works fine, if I try anything else, the code still works, but doesn't show any of the product related reviews/details which is should (i.e. it just looks like the product has no reviews).
I thought this might be something to do with custom blocks needing something else, so I tried it just on the main product description page (i.e. not in a custom block/tab) but still no joy.
I also tried creating a phtml file seperately, but couldn't get that to work either. Have looked through lots of posts about calling variables in other scenarios, here and elsewhere, but still no joy.
I'd really appreciate any suggestions. Many thanks, Bill