Skip to main content

Add Print and Email To Hikashop Social Plugin

More
13 years 11 months ago #71556 by lionelmnr
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.

More
13 years 11 months ago #71625 by Xavier
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.

More
13 years 11 months ago #71626 by lionelmnr
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.

More
13 years 10 months ago #76370 by Batas
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.

More
13 years 10 months ago #76371 by lionelmnr
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.

More
13 years 10 months ago - 11 years 11 months ago #76590 by Xavier
Hi,

Here is an example of a print icon that you can add in a HikaShop view :
Code:
<?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 :
Code:
$print = JRequest::getVar('print',''); if($print){ $js = "window.addEvent('domready', 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: 11 years 11 months ago by nicolas.
The following user(s) said Thank You: nicashdown

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

More
13 years 10 months ago #76639 by lionelmnr
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.

More
13 years 10 months ago - 13 years 10 months ago #76830 by Jerome
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.
Last edit: 13 years 10 months ago by Jerome.
The following user(s) said Thank You: nicashdown

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

More
11 years 5 months ago #198728 by vilo
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.

More
11 years 5 months ago #198739 by nicolas
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.

More
11 years 5 months ago #198838 by vilo
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.

More
11 years 5 months ago #198855 by Jerome
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.

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

More
11 years 5 months ago #199008 by vilo
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.

More
11 years 4 months ago #202315 by Xavier
Hi,

So you can use the code given in a previous post and jsut replace:
Code:
$url = hikashop_currentURL()."/print-true/tmpl-component";
By:
Code:
$url = str_replace('#','',hikashop_currentURL()); $url .= "?tmpl=component&print=1&page=";

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

More
11 years 3 months ago - 11 years 3 months ago #207328 by vilo
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.


Last edit: 11 years 3 months ago by vilo.

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

More
11 years 3 months ago #207329 by nicolas
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.

More
11 years 2 months ago #207422 by vilo
Nicolas thank you very much! It worked perfectly!

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

More
10 years 19 hours ago #251455 by vilo
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.

More
10 years 7 hours ago - 10 years 19 hours ago #251458 by nicolas
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: 10 years 19 hours ago by nicolas.

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

More
9 years 11 months ago #251538 by vilo
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 ()":

Code:
$print = JRequest::getVar('print',''); if($print){ $js = "window.addEvent('domready', 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.328 seconds
Powered by Kunena Forum