Integrating the code in the product page
Let's suppose that we want to add the code only in the product page. To do this, perform the following steps:
Go to your theme folders and create a file called
addthis.phtml
inapp/design/frontend/bookstore/default/template/social
.Paste the copied code, as mentioned in the previous section, in the file and save it.
Now, we need to open the
local.xml
file and find the<catalog_product_view>
product view handle (for your reference, this handle is defined first inside thecatalog.xml
file of the base theme inapp/design/frontend/base/default/layout
) and inside it, in<reference name="content">
, add the following code that will declare acore/template
block to be displayed on the product page:<reference name="content"> <block type="core/template" name="socialsharing" template="social/addthis.phtml" before="-" /> </reference>
Now, open the file of the product page,
view.phtml
, located inapp/design/frontend/bookstore/default...