AddThis service allows you to add to your website a great number of bookmarks and major social services buttons, so that customers could share a link with you via any social network.
The script is installed in steps:
- Registeron the AddThis service. This step is required to make the service count the button usage statistics.
- Install and configure the AddThis script.
If you do not need the statistics, you can start directly with the second step.
Step 1. Registering on AddThis
- Go to the AddThis website
- Click “Create Account”
- Complete the registration
- Now log into the system and go to “Settings” –> “Profiles”. Create a profile for any name by clicking “Add a profile” and get a profile ID which will be required to count the statistics.
Step 2. Installing and configuring the AddThis script.
- In the site menu select “Get the Code”
- Configure the buttons view so that it fits your design
- If you have registered you can check the option “Track when users share by copying your URL”
- Copy the generated code by clicking “Grab It”
- Open the file template where you are going to add buttons, for example, the product page
/app/design/frontend/base/default/template/catalog/product/view.phtml
- Then paste the code into the required place, for example, under the description of the goods
Original code:
Partner With Us
Let's discuss how to grow your business. Get a Free Quote.
Talk to Andrey
1 2 3 4 5 6 7 8 |
... <?php if ($_product->getShortDescription()):?> <div class="short-description"> <h2><?php echo $this->__('Quick Overview') ?></h2> <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div> </div> <?php endif;?> ... |
Customized:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
... <?php if ($_product->getShortDescription()):?> <div class="short-description"> <h2><?php echo $this->__('Quick Overview') ?></h2> <div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div> </div> <?php endif;?> <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style addthis_32x32_style"> <a class="addthis_button_preferred_1"></a> <a class="addthis_button_preferred_2"></a> <a class="addthis_button_preferred_3"></a> <a class="addthis_button_preferred_4"></a> <a class="addthis_button_compact"></a> <a class="addthis_counter addthis_bubble_style"></a> </div> <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-51a5fa9c59636a3d"></script> <!-- AddThis Button END --> ... |
An example of a website with installed buttons
Partner With Us
Looking for a partner to grow your business? We are the right company to bring your webstore to success.
Talk to Andrey
Hi Boris, unfortunately, this method can not be applied to 2.1 version.
Hi,
Will it work on Magento 2.1?
BR,
Boris