0

Website URL- niraame.com

This is our website URL. We want to add size-chart option in our cloth section. I have little knowledge of JavaScript and HTML so i have created a button which does exactly what i wanted to do.

JavaScript and HTML code which i stored as a Static block in Magento-

<p>
<script type="text/javascript">// <![CDATA[
 function popup(){
  sizeWindow = window.open("http://localhost/magento/media/wysiwyg/s.jpg", "sizeWindow", "location=no,width=520,height=520"); 
}
// ]]></script>
</p>
 <p><strong><a href="javascript:popup()">Size Chart</a></strong></p>

This code displays a button on the screen and after clicking it we gets the sizechart loaded on a popup window.

I am not able to figure out how to put this button on the Product page. I tried finding an answer on the Community page.

Can anyone please tell me how to add a button on Product page.

1 Answer 1

1

The template that renders the html for the product page is app/design/frontend/{package}/{theme}/catalog/product/view.phtml.
Put your code in there.
But please don't use hard coded links like http://localhost/magento/media/wysiwyg/s.jpg.
Use

window.open("<?php echo Mage::getBaseUrl('media')?>/s.jpg", "sizeWindow", "location=no,width=520,height=520"); 
3
  • Sir as per your instructions i changed the view.phtml page. But i am getting same size chart for every product. Is there any way to different size-charts for different sections. For example for Male section we have different size chart and for female section we have different size-chart. Can you please tell me how to do that Commented Jun 9, 2015 at 12:46
  • That's a totally different issue. From what I understood you wanted a simple way to display an image in the product view page.
    – Marius
    Commented Jun 9, 2015 at 12:57
  • @ Marius Sir actually i am trying to add size chart for different product category in my website Commented Jun 9, 2015 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.