magento - Why my changes on template files are not showing up - magento

I am trying to add the SKU of the products to the product page by adding the following code:
<h3><?php echo $this->__('SKU:') . $this->htmlEscape($_product->getData('sku'));?></h3>
I have cleared Magento cache and deleted cache storage. Unfortunately, the changes on template file are not showing up ... any suggestion?
PHTML file need to be edited
PHTML file edited

Magento get data directly work like getSku(); Try echo $_product->getSku();

Related

Magento OnePage Success Blank Content

I've got Onepage and Goodcheckout enabled
I've copied the success.phtml to my active theme folder but it's showing blank success page content. I can see the header but the rest of the page is blank
I activated debug but no errors showing, why would the succcess.phtml not show correctly while using this extension?
You can test by going here -https://www.premiumpetfoodonline.com.au/catalogsearch/result/?cat=0&q=test1-2kg
Checkout and you'll see the success page
This piece of code at the top of the success.phtml had been altered, I removed the title call and block request as it isn't needed as header is already set
<?php echo $this->getMessagesBlock()->toHtml() ?>
<h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>

Magento remove customer review block from product view page

I am creating custom module for customer review so I need to delete the Magento customer review functionality from product view page. There is any XML code which don't show the Magento customer review on product view page.
try this code i have already used...
<catalog_product_view ranslate="label">
<remove name="product.reviews"/>
</catalog_product_view>
Go to your theme folder> template> catalog> product> open view.phtml then just find the code in this page:<?php echo $this->getReviewsSummaryHtml($_product, 'default', false)?>
Now remove the code and check. I think it solve your issue.
You do not need any xml code to remove customer review block from product view page. Go to System > Configuration > Advanced then look for Mage_Review and disable it.

Get recently viewed products in magento home page

How to get recently viewed products in magento.
I tried the following code also
$this->getRecentlyViewedProducts();
in the file product_viewed.phtml
1.Place code snippet below in any template u want to add
<?php echo $this->getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->toHtml(); ?>
2.Place code snippet below in any Backend cms-> page or static block
{{block type="reports/product_viewed" template="reports/product_viewed.phtml"}}
Replace template name, product_viewed.phtml with your site.

how to show recent view products on home page in magento

I want to how recently viewed products on home page in magento.
Currently I am using below code but this is now working. so please help!!
getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->toHtml(); ?>
Did you forget to echo?
<?php echo $this->getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->toHtml(); ?>
By the way if you're doing it from the CMS you need to use:
{{block type="reports/product_viewed" template="reports/product_viewed.phtml"}}

How to call a cms page in a phtml file in magento?

I need to display a CMS page inside my custom module's phtml file. Is there any way I can include it either through xml layout or via coding directly in phtml file? I know we can add a cms block but how can we add a cms page?
Try the below code in your phtml file
$page = Mage::getModel('cms/page')->load('home_page','identifier');
echo $page->getContent();
This code check if cms page is active then it will display page content
$page = Mage::getModel('cms/page')->load('top_offer','identifier');
echo $page->getIsActive()?$page->getContent():'';

Resources