kieranbarnes Independent PHP, WordPress & CubeCart Programmer

CubeCart Tax Classes on Product Page

Posted on November 25, 2009

A client of mine sells a mix of VAT and VAT exempt products via a CubeCart 4 store I setup.

Although CubeCart allows this and calculates the VAT right on the checkout process, it doesn't have any facility to show the customer which tax class the product falls into on the viewProd page.

Annoying.

cc tax As you can see we've got two main tax classes set. "+VAT" and "VAT Exempt".

Here's how to display this information on your viewProd page.

Step One - Edit includes/content/viewProd.inc.php

Around line 36 you will see $query. Replace with

$query = "SELECT I.*, C.cat_name, C.cat_father_id, I.taxType , ".$glob['dbprefix']."CubeCart_taxes.taxName
FROM ".$glob['dbprefix']."CubeCart_inventory AS I
LEFT JOIN ".$glob['dbprefix']."CubeCart_category AS C ON I.cat_id = C.cat_id
LEFT JOIN ".$glob['dbprefix']."CubeCart_taxes ON I.taxType = ".$glob['dbprefix']."CubeCart_taxes.id
WHERE I.disabled='0'
AND I.productId = ".$db->mySQLSafe($_GET['productId']);

Further down find,

 $view_prod->assign("TXT_DESCRIPTION",$prodArray[0]['description']);

Add below

$view_prod->assign("TAX_TYPE",$prodArray[0]['taxName']);

Step Two - Edit skins/YOUR SKIN/styleTemplates/content/viewProd.tpl

Put the {TAX_TYPE} where you want the Tax Name to appear. Probably next to the price.

vat 2

vat


Related posts

  1. CubeCart – Product Thumbnail in viewProd.tpl
    Here's something that bugged me for a while. I'm working on an alternative image viewer...
  2. CubeCart Mod – Show sub-category products on category page
    This modification is for CubeCart 3. It will show all the products belong to the...
  3. Unique home page mod CubeCart 4
    Here's a quick modification to allow you to have a unique home page. A page...
  4. CubeCart and WordPress Integration
    Following my 100% CubeCart orientated posts, here's another late night hack. It integrates a WordPress...
  5. CubeCart Mod – Side by Side Products Mod
    This universal modification allows you to show your products side by side on the "View...

Posted by Kieran


Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.