Jump to content

Resolved - Shopping Basket Prices - Need Help Modifiying


duckmansweb
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...