Hi,
Here is an example of a print icon that you can add in a HikaShop view :
<?php
$popup = hikashop_get('helper.popup');
$url = hikashop_currentURL()."/print-true/tmpl-component";
$html. = $popup->display(
'<span class="icon-32-print" title="'. JText::_('PRINT_PRODUCT').'"></span>'. JText::_('HIKA_PRINT'),
'PRINT_PRODUCT',
$url,
'hikashop_print_product',
760, 480, '', '', 'link'
);
?>
And in the file "components/com_hikashop/views/product/view.html.php" at the beginning of the function "show()" add this code :
$print = JRequest::getVar('print','');
if($print){
$js = "do_nothing( function() {setTimeout(function(){window.focus();window.print();setTimeout(function(){hikashop.closeBox();}, 1000);},1000);});";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration("\n<!--\n".$js."\n//-->\n");
//JHTML::script('mootools.js', JURI::base(true) .'media/system/js/');
if(!HIKASHOP_J30)
JHTML::_('behavior.mootools');
else
JHTML::_('behavior.framework');
}
If you are not using the SEF, use:
$url = hikashop_currentURL()."&print=true&tmpl=component";
instead of:
$url = hikashop_currentURL()."/print-true/tmpl-component";
If you want this button in the product page, put the first code in the view "product / show_default" via the menu Display->Views and replace the code:
$html. = $popup->display(
by:
echo $popup->display(
in that code.