How to show a Joomla Print/Email icon on Product P

  • Posts: 32
  • Thank you received: 1
11 years 11 months ago #89200

Hi,

How do you show a Joomla 2.5 Print/Email icon on a Product Page? They show fine on a Joomla Article page but not on the product page.

The product page is in div format.

Thanks in advance for your help.

Regards,

Dennis

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #89377

Hi,

You have to edit the view "product / show_default" to add an email button.
We actually have no options for that.

If I remember well, this question has already been posted on our Forum, try to use the search in the forum to find that post.
You will maybe find how to do that.

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 1
11 years 10 months ago #90670

Hi,

I've extensively searched the forum, Google, bing and can't find how to do as you suggested. Can you show me, please?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #90810

Hi,

Yes sure. You have to edit the view "product / show_default" and add the code:

if($tmpl != 'component'){
    $popup = hikashop_get('helper.popup');
    echo $popup->display(
	'<span class="icon-32-print" title="'. JText::_('HIKA_PRINT').'"></span>'. JText::_('HIKA_PRINT'),
	'HIKA_PRINT',
	hikashop_completeLink('product&task=show&product_id='.$this->element->product_id,true),
	'hikashop_print_cart',
	760, 480, '', '', 'link'
    );
}else{
	$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");
}

In the "if($tmpl != 'component')" you can put all the element not wanted for the print view.

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 1
11 years 10 months ago #91080

Hi Xavier,

Thank you for your effort, but this did not work. Besides, I really would like an Email Icon or Email Text to recommend the item to a fried on the Product Page. Is this possible as it is on a Joomla Article?

Thanks again,

Dennis

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #91332

Hi,

Thanks to try with that code:

<?php
$tmpl = JRequest::getString('tmpl','??');
if($tmpl != 'component'){
    $popup = hikashop_get('helper.popup');
    echo $popup->display(
	'<span class="icon-32-print" title="'. JText::_('HIKA_PRINT').'"></span>'. JText::_('HIKA_PRINT'),
	'HIKA_PRINT',
	hikashop_completeLink('product&task=show&product_id='.$this->element->product_id,true),
	'hikashop_print_cart',
	760, 480, '', '', 'link'
    );
}else{
	?>
	<script>
		do_nothing( function() {setTimeout(function(){window.focus();window.print();setTimeout(function(){hikashop.closeBox();}, 1000);},1000);});
	</script>
	<?php
}
?>
For the email it's a bit more complex.
You have to create a new view to display a contact form to fill the desired email, then on the product page link to this form and give the product id, then on the email form add a button submit, which will call a function to send the email.

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 1
11 years 10 months ago #91439

Thank you, but how do you create a new view for the email function on the Product Page?

Dennis

Please Log in or Create an account to join the conversation.

  • Posts: 83050
  • Thank you received: 13412
  • MODERATOR
11 years 10 months ago #91609

You should use such component to do that:
extensions.joomla.org/extensions/content...rk-a-recommend/13584
Otherwise, it would require to ask a developer to do that project for you as it's really complex if you're not a developer.

Please Log in or Create an account to join the conversation.

Time to create page: 0.079 seconds
Powered by Kunena Forum