duckmansweb Posted August 13, 2013 Share Posted August 13, 2013 Hi guys , im looking at modifying the prices of the products in the shopping cart , currently the prices are worked out as follows with included 10% tax setup... Quick Snatch Kit - Small Truck - OAQUICKSKST ($139.00 INC Tax) Unit Price (ex tax) Price (Ex Tax) QTY 2 $126.36 $252.73 SUBTOTAL (ex tax) $252.73 TAX $25.27 TOTAL (inc tax) $278.00 now what i want to do is , i want to make the cart show the values like this.... Quick Snatch Kit - Small Truck - OAQUICKSKST Unit Price (INC tax) Price (INC Tax) QTY 2 $139.00 $278.00 SUBTOTAL (ex tax) $252.73 TAX $25.27 TOTAL (inc tax) $278.00 any ideas what i need to do to make them changes, that would be great , thanks Store : www.ava4x4.com.au Cubecart 5.2.2 Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 14, 2013 Share Posted August 14, 2013 The phrases in red, (inc tax), etc, is that your addition to the skin? Or is this just a clue for these examples? Quote Link to comment Share on other sites More sharing options...
duckmansweb Posted August 14, 2013 Author Share Posted August 14, 2013 oh no they are just examples of what the $ figure is representing my question/mod has also been asked here ... http://www.cubecartforums.org/index.php?s=&showtopic=16505&view=findpost&p=68866 Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 14, 2013 Share Posted August 14, 2013 Ok, the only real difference (so far) comparing your examples is that you need the base_price_display (unit price as entered in the admin Product Edit screen with Tax Included enabled) moved from the product details column to the Unit Price column. Also, you need what is the quantity multiple of the base_price_display. CubeCart does not provide the second value. We will need to make it. In /classes/cart.class.php, find the function called get(). It should be near line 583. About 40 lines down, find: $product['price_display'] = $product['price']; $product['base_price_display'] = $GLOBALS['tax']->priceFormat($product['price'], true); On the blank line that follows, add: $product['base_quantity_price_display'] = $GLOBALS['tax']->priceFormat($product['price']*$item['quantity'],true); In your skin template content.checkout.php, find (I can't give specific line numbers because the actual skin in use may have this in a different area): {foreach from=$ITEMS key=hash item=item} <div class="basket_product"> Within this area, there will be something like: {if $item.base_price_display}({$item.base_price_display}){/if} Make it look like: {if false && $item.base_price_display}({$item.base_price_display}){/if} That removes the base price from the details area. Next, find: {$item.price_display} Replace with: {$item.base_quantity_price_display} That gives us the quantity total base price - with tax included. Next, find: {$item.line_price_display} Replace with: {$item.base_price_display} That shows in this location the unit price - with tax included. There are still two issues of how any cost differentials are displayed when product options are in use. This code: {if !empty($option.price_display)} ({$option.price_display}){/if} says to show the option price if there is one. Also, the base_quantity_price_display does not include the cost differentials of the options. So, be aware of that. If it is an problem for you, I can try to find where to fix that. Let us know how it works. Quote Link to comment Share on other sites More sharing options...
duckmansweb Posted August 14, 2013 Author Share Posted August 14, 2013 awesome that worked !! , i do have a product that has options , +$350 on top of the list price for that particular option , if that amount could change in the Unit Price - Price field that would make it 100% perfect , ive attached an image of the current fix Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 14, 2013 Share Posted August 14, 2013 So the 350.00 price of the option also includes a tax? Therefore, take the 995.00 and simply add the tax-inclusive cost of the option to show in the line-item Unit Price and Price? Quote Link to comment Share on other sites More sharing options...
duckmansweb Posted August 14, 2013 Author Share Posted August 14, 2013 correct Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 14, 2013 Share Posted August 14, 2013 This may or may not work. In cart.class.php, where you entered$product['base_quantity_price_display'] = $GLOBALS['tax']->priceFormat($product['price']*$item['quantity'],true); Change that to:$product['base_quantity_price'] = $product['price']*$item['quantity']; Then, about 110 lines down, find:$product['line_price_display'] = $GLOBALS['tax']->priceCorrection($product['price_display']+$option_price_ignoring_tax); $product['price_display'] = $GLOBALS['tax']->priceCorrection(($product['price_display']+$option_price_ignoring_tax)*$item['quantity']); On a new blank line, add:$product['base_quantity_price_display'] = $GLOBALS['tax']->priceFormat($product['base_quantity_price']+($option_price_ignoring_tax*$item['quantity'])); The question is, is $option_price_ignoring_tax the variable we need? Quote Link to comment Share on other sites More sharing options...
duckmansweb Posted August 14, 2013 Author Share Posted August 14, 2013 that appears to have worked ! , here is a screen shot attached of the mod results , just to make sure ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.