UK Installation Guide

Notes

Your AddShoppers account details:

user: dave.bell@vesternet.com

pass: addshoppers

If you need help with anything or have any questions, please contact;

Mario: mario@addshoppers.com

 

1. Install Social Analytics code

Copy and paste into the global footer template:

<script type="text/javascript">
var js = document.createElement('script'); js.type = 'text/javascript'; js.async = true; js.id = 'AddShoppers';
js.src = ('https:' == document.location.protocol ? 'https://shop.pe/widget/' : 'http://cdn.shop.pe/widget/') + 'widget_async.js#53f21ef3a38764776b2be15e';
document.getElementsByTagName("head")[0].appendChild(js);
</script>

2. Install ROI Tracking code

Copy and paste the following code into app/design/frontend/base/default/YOUR_THEME/checkout/success.phtml

<?php 
$order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId()); 
$amount = number_format($order->subtotal,2); 
?>
<script type="text/javascript">
AddShoppersConversion = {
        order_id: '<?php echo $this->getOrderId(); ?>',
        value: '<?php echo $amount; ?>'
};
var js = document.createElement('script'); js.type = 'text/javascript'; js.async = true; js.id = 'AddShoppers';
js.src = ('https:' == document.location.protocol ? 'https://shop.pe/widget/' : 'http://cdn.shop.pe/widget/') + 'widget_async.js#53f21ef3a38764776b2be15e';
document.getElementsByTagName("head")[0].appendChild(js);
</script>

4. Add sharing buttons

For floating buttons: Copy and paste this code into the global footer template:

<div class="share-buttons share-buttons-tab" data-buttons="facebook,twitter,pinterest,google,email" data-style="big" data-counter="true" data-hover="false" data-promo-callout="true" data-float="right"></div>

For standard sharing buttons: Copy and paste this code into the product view.phtml template where you want the buttons to show up:

<div class="share-buttons share-buttons-panel" data-style="medium" data-counter="true" data-oauth="true" data-hover="false" data-promo-callout="left" data-buttons="facebook,twitter,pinterest,google,email"></div>

This will install our default button style. If you want to use custom sharing buttons, either follow this guide or let us know if you want us to design sharing buttons for you.

5. Discovery Wall Installation

Copy and paste the following code where you want the Discovery Wall to appear:

<div id="AddShoppersWall"></div>

Optional: To add a category-filtered Discovery Wall, use the data-category parameter (it should match up with the "category" variable that you use in step 3. 

<div id="AddShoppersWall" data-category="CATEGORY_HERE"></div>

6. Purchase Sharing Installation

Copy and paste the following code AFTER the ROI Tracking code (step #2) into app/design/frontend/base/default/YOUR_THEME/checkout/success.phtml:

<?php
$highestPrice = 0;
$order_items = $order->getAllItems();
foreach($order_items as $item) {
    $product = Mage::getModel('catalog/product')->load($item->getProductId());
    if($product->getPrice() > $highestPrice){
        $highestPrice = $product->getPrice();
        $prodimgurl = $product->getMediaConfig()->getMediaUrl($product->getData('image'));
        $prodname = $product->getName();
        $proddesc = $product->getData('description');
        $produrl = $product->getProductUrl();
    }
}
?>
<?php /* if all variables are assigned then set them in addshoppers tracking */ ?>
<?php if($prodimgurl && $prodname && $proddesc && $produrl): ?>
    <script type="text/javascript">
        AddShoppersTracking = {
            auto: true,
            header: "Share your purchase with your friends!",
            async: false,
            image: '<?php echo $prodimgurl; ?>',
            url: '<?php echo $produrl; ?>',
            name: '<?php echo $prodname; ?>',
            description: '<?php echo $proddesc; ?>',
        }    
    </script>
<?php endif; ?>

This will share the most expensive item in the order with an automatic popup, let us know if you want to add different logic here.