Jump to content

Product page - facebook social sharing button issue (presta 1.6.1.10)


Recommended Posts

I am using the default social sharing buttons on the product page (presta 1.6.1.10 / default bootstrap theme). When I click on the facebook button it shares this url http://mysite.com/index.php?id_product=4741. But if you open this url it shows the home page. When I am browsing my site I can see that this product url is: http://mysite.com/index.php?id_product=4741&controller=product .

 

I can edit the code and make it work but I want to know if this a configuration issue or a bug.

Link to comment
Share on other sites

I found that when I click on the share button it opens the fb window and in its address bar the product url is correct but not encoded. That caused fb to share only the url before the &.

 

Added urlencode before addcslashes to modules/socialsharing/socialsharing.php

'sharing_url' => urlencode(addcslashes($this->context->link->getProductLink($product), "'")),

 

And now it's working! When I click the share button the fb window that opens show the the url encoded

"https://www.facebook.com/sharer.php?u=http%3A%2F%2Fmysite.com%2Findex.php%3Fid_product%3D4741%26controller%3Dproduct"

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...