Add Print and Email To Hikashop Social Plugin

  • Posts: 18
  • Thank you received: 0
12 years 1 month ago #71556

Hi

Is there a way I can add a print and email button to the social media plugin.

Thanks

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

  • Posts: 13201
  • Thank you received: 2322
12 years 1 month ago #71625

Hi,

I think that it can be done in the plugin file in "youSite/administrator/components/com_hikashop/extensions/plg_content_hikashopsocial/hikashopsocial.php" in the function "onAfterRender()" you can add what you want in the var $html, you can add the buttons after the code "if($plugin->params) $html.=$this->_addFacebookButton( $plugin);"

This requires knowledge of php

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

  • Posts: 18
  • Thank you received: 0
12 years 1 month ago #71626

Hi

Unfortunately my knowledge of php is very limited and I wont be able to pull this off. If anyone can or will please let me know I think its necessary to have a print and email button per product.

Thanks

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

  • Posts: 72
  • Thank you received: 4
12 years 1 week ago #76370

I guess you were talking about print and email buttons on product page, not on social plugin?
In that case I agree with you, it would be really nice for customers to print out product description easily in that way. Not every site visitor is clever enough to print out desirable site through menu...

I understand that support guys are really busy but maybe you will find a free minute to post on how to do that?
Thank you in advance!

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

  • Posts: 18
  • Thank you received: 0
12 years 1 week ago #76371

Hi

What I meant by the social plugin is for the print and email button to display next to them. I agree users wont print it out the usual way but with a button right there I think it will make them want to especially the email feature. Hopefully someone will do it before I figure out php myself haha B)

Thanks

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

  • Posts: 13201
  • Thank you received: 2322
12 years 1 week ago #76590

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.

Last edit: 10 years 1 month ago by nicolas.
The following user(s) said Thank You: nicashdown

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

  • Posts: 18
  • Thank you received: 0
12 years 1 week ago #76639

Hi Xavier

I did as you said and adding the code to the "components/com_hikashop/views/product/view.html.php" in the function "show()" is fine but when I add the top code to the product/show_default view page the product page comes up blank. I tested this on two separate sites and same result.

Thanks

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 1 week ago #76830

Hi,

The code that Xavier wrote is for HikaShop 2.0
The "popup helper" or the HIKASHOP_J30 constant are in HikaShop 2.0 and are not in previous version.
I think that's why you're having a blank page.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 12 years 1 week ago by Jerome.
The following user(s) said Thank You: nicashdown

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

  • Posts: 86
  • Thank you received: 2
9 years 7 months ago #198728

I just put this code and it works perfectly.

Now I want to know if there is any way to customize the code to make the logo look Store in printing.

Thank you very much.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
9 years 7 months ago #198739

Hi,

If you want to change the logo, you can add custom CSS code on your website for the CSS class icon-32-print

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

  • Posts: 86
  • Thank you received: 2
9 years 7 months ago #198838

Hi Nikolas.

Excuse my English but I probably misspoke.

What I need is that when a visitor print product page, printing contains the logo of the store at the head of the sheet.

Is it possible?

Thank you very much from now.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 7 months ago #198855

Hi,

It will be related to your template and to CSS.
You can create CSS rules for the "print" media and then change the look at the content.
Thanks to that, you can display a different header for the page.
But that kind of customization is not related to HikaShop.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 86
  • Thank you received: 2
9 years 7 months ago #199008

Jerome Thanks for your reply. I commented that articles of Joomla are printed with logo. HikaShop products are printed without logo.

Reviewing the difference between print links have:


www.turismodelprado.tur.ar/brasil/aereo/product/2-imbassai# (the logo is not printed)

But if I put the following url, yes printed with logo:

www.turismodelprado.tur.ar/brasil/aereo/...ponent&print=1&page=


How would you modify the code shown in this thread (above) for the url is generated in this way?

Thank you very much from now.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #202315

Hi,

So you can use the code given in a previous post and jsut replace:

$url = hikashop_currentURL()."/print-true/tmpl-component";
By:
$url = str_replace('#','',hikashop_currentURL());
$url .= "?tmpl=component&print=1&page=";

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

  • Posts: 86
  • Thank you received: 2
9 years 4 months ago #207328

Hello. The above code worked perfectly today. I just upgraded to HikaShop Starter: 2.5.0 and no longer works.

Printed page is not displayed as a popup. It is shown below all with scrolls (I attach capture).

I would appreciate much I indicated that I edited to function properly again. Thank You.


Attachments:
Last edit: 9 years 4 months ago by vilo.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
9 years 4 months ago #207329

Hi,

This issue indicates that your template is not compatible with the bootstrap popups system. Fixing the template is a solution but you can simply modify the "popup mode" setting of the Hikashop configuration to "mootools" and that should circumvent the problem.

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

  • Posts: 86
  • Thank you received: 2
9 years 4 months ago #207422

Nicolas thank you very much! It worked perfectly!

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

  • Posts: 86
  • Thank you received: 2
8 years 1 month ago #251455

Hi. This fix is no longer working with Joomla 3.6.2 and 2.6.4 Starter Hikashop.

How should now be to modify the code?

Thank you very much from now

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 1 month ago #251458

Hi,

What do you mean ? What fix are you talking about ?
The popup mode ?
How did you configure it ? And what error do you have ?
On which page do you have the problem ? Could you provide a link ?

Last edit: 8 years 1 month ago by nicolas.

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

  • Posts: 86
  • Thank you received: 2
8 years 1 month ago #251538

Nicolas:


Each time you update Hikashop, I edit the file components / com_hikashop / views / product / view.html.php and add this code line in about 1059 after "show ()":

$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');
		}


Well, the thing is that this latest version of Hikashop, this file has changed.

"Show ()" is approximately in line 1169. And when I put the code page (frontend) is blank.

If I take the code, everything returns to normal.

Something is happening that this code no longer works.

I apologize because I can not give you an example, as I had to get the code.

Thank you very much and I hope your answer.

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

Time to create page: 0.158 seconds
Powered by Kunena Forum