Looking for a Graphic designer in Tring? We have teamed up with Andrew Cook at Metal House to bring some professional high quality graphic design skills (more…)
Archive for the ‘Website Design & Development’ Category
CMSMS Page Title in UDT
Saturday, November 26th, 2011Short post on how to get the page title into a UDT for further use in CMSMS (more…)
(not provided) in Google analytics
Monday, November 14th, 2011October 18th saw a big change to how Google deals with users that are logged into one of Googles services and how this affects keyword reports in Google Analytics and webmasters (more…)
How to use Paid On Results Data Feeds in a Website
Thursday, October 27th, 2011This tutorial uses SymphonyCMS to control the XML product feeds, so you should have that installed first. The Paid on Results feeds are standard, we haven’t added/removed/changed any of the fields. (more…)
3D objects in HTML
Sunday, October 23rd, 2011You know when you search around trying to find out how to achieve a particular task and you stumble on something that is so unique… (more…)
Blur part of a video – face, licence plate
Tuesday, October 18th, 2011The job of editing video and adding effects is always time consuming – I don’t do it very often but on occasions need to add effects such as blur to parts of a video (more…)
CMSMS Content Blocks
Monday, October 17th, 2011The default for CMSMS content template tag is {content}. This will pull in the content that your client inputs through the backend. But what if they want more than one content block? You could use a Global Content Block (GCB) but that adds another layer for yor client to learn. How abot more than one content block on the same page? This is easy to accomplish using more than one content tag in the same template. It’s a little known fact that CMSMS content tag actually has some extra features that add additional functionality. (more…)
Google Ecommerce Tracking in Opencart
Sunday, October 9th, 2011This will be a quick tutorial on adding Google Analytics Ecommerce tracking to opencart shops
1. Add the following to a new template file in /public_html/catalog/view/theme/YOUR TEMPLATE FILES/template/common/gasuccess.tpl
<?php echo $header; ?>
<?php echo $column_left; ?>
<?php echo $column_right; ?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxxx']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'<?php echo $order_id; ?>', // order ID - required
'Shop Name', // affiliation or store name
'<?php echo $order_total; ?>', // total - required
'0', // tax
'0', // shipping
'<?php echo $order_city; ?>', // city
'<?php echo $order_county; ?>', // state or province
'UK' // country
]);
// add item might be called for every item in the shopping cart
// where your ecommerce engine loops through each item in the cart and
// prints out _addItem for each
<?php
foreach ($products as $product) {
echo '_gaq.push([\'_addItem\',';
echo '\'' . $order_id . '\',';
echo '\'' . $product['model'] . '\',';
echo '\'' . $product['name'] . '\',';
/* Removed options as caused error */
/* foreach ($product['option'] as $option) {
echo '\'' . $option['name'] . '\',';
}
*/
echo '\'Null Product Variations\',';
echo '\'' . $product['price'] . '\',';
echo '\'' . $product['quantity'] . '\'';
echo ']);';
}
?>
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
2. Add the following to /public_html/catalog/controller/checkout/success.php, just below:
<?php
class ControllerCheckoutSuccess extends Controller {
public function index() {
$this->data['order_id'] = $this->session->data['order_id'];
/*
Extract order details and assign to a variable(s) for Google Ecommerce tracking
*/
$this->load->model('account/order');
$order_info = $this->model_account_order->getOrder($orderRedirect);
if ($order_info) {
// Data required for _addTrans
$this->data['order_id'] = $orderRedirect;
$this->data['store_name'] ='SHOP Name';
$this->data['order_total'] = $order_info['total'];
$this->data['order_tax'] = '0';
$this->data['order_shipping'] = '0';
$this->data['order_city'] = $order_info['payment_city'];
$this->data['order_county'] = $order_info['payment_zone'];
$this->data['order_country'] = 'UK';
// Data required for _addItem
$this->data['products'] = array();
$products = $this->model_account_order->getOrderProducts($orderRedirect);
foreach ($products as $product) {
$options = $this->model_account_order->getOrderOptions($orderRedirect, $product['order_product_id']);
$option_data = array();
foreach ($options as $option) {
$option_data[] = array(
'name' => $option['name'],
'value' => $option['value'],
);
}
/*
The below should sit in gasuccess.tpl line 34 for the google e-commerce tracking code
however it gives the following PHP warning, so it is easier to omit if there are no product options
<b>Warning</b>: Invalid argument supplied for foreach() in <b>/home/shop/catalog/view/theme/lms/template/common/gasuccess.tpl</b> on line <b>35</b>
<b>Notice</b>: Undefined index: name in <b>/home/shop/catalog/controller/checkout/success.php</b> on line <b>65</b>
<b>Notice</b>: Undefined index: name in <b>/home/shop/catalog/controller/checkout/success.php</b> on line <b>65</b>
<b>Notice</b>: Undefined index: name in <b>/home/shop/catalog/controller/checkout/success.php</b> on line <b>65</b>
foreach ($product['option'] as $option) {
echo '\'' . $option['name'] . '\',';
}
*/
$this->data['products'][] = array(
'name' => $product['name'],
'model' => $product['model'],
// 'option' => $option_data['name'], (see above comment)
'quantity' => $product['quantity'],
'price' => $product['price'],
);
}
}
/*
End of Google Ecommerce tracking
*/
Finding Category ID in WordPress
Sunday, October 9th, 2011If you are excluding WordPress blog categories from pages and RSS feeds you will need to know the category ID number first.
This sometimes stumps people as it is not so easy to find. Along the way of WordPress Updates they removed the ID number from the Category page in WordPress Admin
Go to edit Categories which is under Posts in WordPress Admin, then hover over the category name you want the ID for exclusion.
Look at the URL in the browser for tag_ID and make a note of the number. In our example below our Portfolio category has an ID of 26
