News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Add CSS to "print product" popup window

Started by Georgios Kolomvos, May 19, 2012, 09:37:50 AM

Previous topic - Next topic

Georgios Kolomvos

To add a CSS file to the popup window that appears when a shopper clicks on the print icon of a product page do the following:

Copy the file "components/com_virtuemart/views/productdetails/tmpl/default.php" to your template directory at folder: templates/my_Joomla_template/html/com_virtuemart/productdetails/ (if it's already there, then go to the next step)

Edit file  templates/my_Joomla_template/html/com_virtuemart/productdetails/default.php and just after the line:

defined('_JEXEC') or die('Restricted access');

insert the following code:
$doc = JFactory::getDocument();
$css_path =  JRoute::_(JURI::base()."templates/my_template/css/my_product_page.css");
$doc->addCustomTag('<link rel="stylesheet" type="text/css" href='.$css_path.' media="all">');


This way the file "templates/my_template/css/my_product_page.css" will always be inserted in the product page even if this page appears in the popup window of the print icon.
In this css file you can put a style like this for example:

body.contentpane .main-image img {
  width:200px;
  border:red solid 1px;
}

Georgios Kolomvos
Patras, Greece