AbanteCart Community
eCommerce construction => How-to questions => Topic started by: jimcooncat on March 08, 2019, 10:14:54 PM
-
I'd like to make a Facebook Share link on individual product pages, so visitors can share the product pages with their friends. Seems I could make a custom HTML block to show the link. Are there field codes available in the HTML editor that I can embed the current URL? Or another trick to accomplish something like the attachment here shows.
-
Perhaps our free AddThis extension would be easier for you
Here's the MarketPlace link
http://marketplace.abantecart.com/addthis?keyword=addthis&category_id=0 (http://marketplace.abantecart.com/addthis?keyword=addthis&category_id=0)
This is our manual of how it workds
https://abantecartextensions.com/docs/addthis (https://abantecartextensions.com/docs/addthis)
-
Thank you. It looks like an easy implementation, but I'm hoping for something even simpler and without oversharing to fourth parties.
-
Stumbled across this code for a Wordpress implementation. Would something similar work with AbanteCart? Are php variables accessible in this manner?
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>" title="<?php the_title(); ?>" target="_blank">Share on Facebook</a>
-
Found a solution, I think. Any drawbacks to this?
<a href="#" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href),'facebook-share-dialog','width=626,height=436');return false;">Share on Facebook</a>
-
Stumbled across this code for a Wordpress implementation. Would something similar work with AbanteCart? Are php variables accessible in this manner?
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>" title="<?php the_title(); ?>" target="_blank">Share on Facebook</a>
PHP vars are not accessible in HTML.