PEPPE83 Posted June 12, 2015 Share Posted June 12, 2015 Hello, I am writing to report that the module "social sharing" has some problems. When I click on one of the four keys to share the product on one of the social network nothing happens. PS version 1.6.0.14Module version 1.3.0 by PrestaShop I have tried uninstalling and reinstalling and reset the module, but nothing has changed. can someone help me? Thank you. Link to comment Share on other sites More sharing options...
NemoPS Posted June 12, 2015 Share Posted June 12, 2015 Is there any javascript error on the page? hit f12 to bring up the developer console, then console tab, look for red entries Link to comment Share on other sites More sharing options...
PEPPE83 Posted June 12, 2015 Author Share Posted June 12, 2015 (edited) Thank you Nemo1, i partially solved my problem deleting the dir in /themes/mytheme/modules/socialsharing Now the module work correctly but i dont see the social network icon. Any idea? Edited June 12, 2015 by PEPPE83 (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted June 13, 2015 Share Posted June 13, 2015 Well that's no real solution, I guess you needed that to style icons. You should really take it back and troubleshoot as I mentioned Link to comment Share on other sites More sharing options...
PEPPE83 Posted June 17, 2015 Author Share Posted June 17, 2015 Hello Nemo1, i have restored the dir in /themes/mytheme/modules/socialsharing now i see the icons but in the developer console i get this error: ReferenceError: socialsharing_facebook_click is not defined Link to comment Share on other sites More sharing options...
NemoPS Posted June 19, 2015 Share Posted June 19, 2015 Try to download the module's folder and look for that entry (the main folder). socialsharing_facebook_click There, or the original theme's one (tpl and js)See where and if it's defined Link to comment Share on other sites More sharing options...
artenautico Posted September 19, 2015 Share Posted September 19, 2015 Hi Nemo1 I have the same problem with the module but the error is different. Social Sharing module shows the buttoms in product page but when you click on them nothing happens. The error showed by the console is "Uncaught SyntaxError: Unexpected token ILLEGAL" And the .tpl for the buttoms I think is correct. I show it at the end. I've been looking for a solution for days and it seems like in every forums nobody says a solution. I've uninstalled and reinstalled the module. I've try to click on the buttoms without the adblocker of the web browsers etc. Does anybody know how can I correct it? Thanks in advance <p class="socialsharing_product list-inline no-print"> {if $PS_SC_TWITTER} <button type="button" class="btn btn-outline btn-twitter" onclick="socialsharing_twitter_click('{$product->name|addslashes} {$link->getProductLink($product)|addslashes}');"> <i class="fa fa-twitter"></i> Tweet <!-- <img src="{$link->getMediaLink("`$module_dir`img/twitter.gif")}" alt="Tweet" /> --> </button> {/if} {if $PS_SC_FACEBOOK} <button type="button" class="btn btn-outline btn-facebook" onclick="socialsharing_facebook_click();"> <i class="fa fa-facebook"></i> Share <!-- <img src="{$link->getMediaLink("`$module_dir`img/facebook.gif")}" alt="Facebook Like" /> --> </button> {/if} {if $PS_SC_GOOGLE} <button type="button" class="btn btn-outline btn-google-plus" onclick="socialsharing_google_click();"> <i class="fa fa-google-plus"></i> Google+ <!-- <img src="{$link->getMediaLink("`$module_dir`img/google.gif")}" alt="Google Plus" /> --> </button> {/if} {if $PS_SC_PINTEREST} <button type="button" class="btn btn-outline btn-pinterest" onclick="socialsharing_pinterest_click();"> <i class="fa fa-pinterest"></i> Pinterest <!-- <img src="{$link->getMediaLink("`$module_dir`img/pinterest.gif")}" alt="Pinterest" /> --> </button> {/if} </p> Link to comment Share on other sites More sharing options...
artenautico Posted September 19, 2015 Share Posted September 19, 2015 Hello, I solved it changing the socialsharing.js. My code had a different intro. This is the new one /*** 2007-2014 PrestaShop** NOTICE OF LICENSE** This source file is subject to the Open Software License (OSL 3.0)* that is bundled with this package in the file LICENSE.txt.* It is also available through the world-wide-web at this URL:* http://opensource.org/licenses/osl-3.0.php* If you did not receive a copy of the license and are unable to* obtain it through the world-wide-web, please send an email* to [email protected] so we can send you a copy immediately.** DISCLAIMER** Do not edit or add to this file if you wish to upgrade PrestaShop to newer* versions in the future. If you wish to customize PrestaShop for your* needs please refer to http://www.prestashop.com for more information.** @author PrestaShop SA <[email protected]>* @copyright 2007-2014 PrestaShop SA* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)* International Registered Trademark & Property of PrestaShop SA*/function socialsharing_twitter_click(message){ if (typeof message === 'undefined') message = encodeURIComponent(location.href); window.open('https://twitter.com/intent/tweet?text=' + message, 'sharertwt', 'toolbar=0,status=0,width=640,height=445');}function socialsharing_facebook_click(message){ window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(location.href), 'sharer', 'toolbar=0,status=0,width=660,height=445');}function socialsharing_google_click(message){ window.open('https://plus.google.com/share?url=' + encodeURIComponent(location.href), 'sharergplus', 'toolbar=0,status=0,width=660,height=445');}function socialsharing_pinterest_click(image_url){ window.open('http://www.pinterest.com/pin/create/button/?media=' + encodeURIComponent(image_url) + '&url=' + encodeURIComponent(location.href), 'sharerpinterest', 'toolbar=0,status=0,width=660,height=445');} Link to comment Share on other sites More sharing options...
zod Posted October 6, 2018 Share Posted October 6, 2018 If you are using an old theme perhaps you should watch the "socialsharing.tpl" template too. Prestashop changed the javascript functions so you need to copy the original code from the updated module. Remove the "onclick" add the class "social-sharing" add the "data-type" attribute For example the code is from: <button type="button" class="btn btn-outline btn-twitter" onclick="socialsharing_twitter_click('{$product->name|addslashes} {$link->getProductLink($product)|addslashes}');"> to: <button type="button" class="btn btn-outline btn-twitter social-sharing" data-type="twitter"> Do this for all buttons. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now