mribeiro, on May 7 2008, 03:32 PM, said:
Hi Carbon
Your code information work just fine, thanks for yur help.
Now I found another little problem, when i pass the information from custom_checkout.php to shopping_cart.php, the total values from the build, is greater than the totals of the build plus the tax.These problem only happens with custom computer, the other regular products the totals are correct.
I think that the problem lies on the about line 188 of the shopping_cart.php.
$currencies->display_price
But I can't understand very well that part of code, specialy the relation bettween the currencies variavel and that function dsplay_price, and in what file is located the fuction.
This problem repeats through the rest of the process of the order.
If you could bring me some light in this matter I will be greatful.
Thanks onceagain your cooperation and pacience.
Hi Mribeiro,
Whenever I get stuck like this I follow the "code path" from it's source to the target page and place javascript alerts along the way to test for things like correct variables.
So in this case the code begins in build.php with...
<input type="hidden" name="Total" id="Total">
...around line 227 (notice the capital T in Total), so to check what's in there I would place the following bit of temp code somewhere on the page...
<a href="java script: alert(document.getElementById('Total'))">TEST</a>
Once you have confirmed that the expected value is present we then continue to follow the "code route" to custom_checkout.php. The "Total" variable is injected into custom_checkout.php around line 55 with...
$products_total = $HTTP_POST_VARS['Total'];
...so again place some temp checking code like...
echo $products_total;
...and again check to see if the value is the same as it was in build.php.
The next thing that happens to the variable (now a php string $products_total) is it gets manipulated if you have "Build" and/or "Warranty" enabled so make sure these are turned off, 1: because you want to keep the "code route" as clean as possible, 2: because I have experienced incorrect tax with these two items and 3: because I say so
Now that "Build" and "Warranty" are disabled the next thing that happens is the variable is prepared for insertion into the database around line 81...
'products_price' => $products_total,
...and actually inserted around line 99...
tep_db_perform(TABLE_PRODUCTS, $product_array);
Nothing else happens to $products_total on this page but it would be worth putting some test code in the html body and turning build and warranty back on to see if the value is different from earlier...
<script>alert('<?php echo $products_total;?>');</script>
... my money is on build and/or warranty but if not get back to me and I'll continue with the next page shopping_cart.php
Good luck
Carbon