I don't know if I tested this properly when we did the support ticket, but clicking on 'Same as billing' will still retrigger and display the shipping.
the code edited on confirm_cart.php on line 274 was
if ($eCart1->GetShipping() > 0 && (isset($_POST["forShipping"]) || isset($_POST["CheckoutWizard_submit"]))) {
I need it to work that way because I added a form field that needs to display only on the very last step, before submitting, along with the shipping display.
and the update QtyLeftInStock doesn't update on the Table, specifically, when the value should go to 0. ?? (it stops anytime it evaluates to '0' left)
Here's the script:
<?php
// Update Items Left in Stock
if (isset($_POST["CheckoutWizard_submit2"]) || isset($_POST["CheckoutWizard_submit2_x"])) {
while (!$eCart1->EOF()) {
$UpdateQuery = new WA_MySQLi_Query($convacc_cx);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "eCart_products";
$UpdateQuery->addFilter("prod_id", "=", "i", "".($eCart1->DisplayInfo("ID")) ."");
$UpdateQuery->bindColumn("In_Stock_Qty", "i", ($eCart1->DisplayInfo("InStockQty") - $eCart1->DisplayInfo("Quantity")), "WA_DEFAULT");
$UpdateQuery->execute();
$eCart1->MoveNext();
}
}
$eCart1->MoveFirst();
?>
UPDATE:
I changed the above code to below,and seems to work (making it to a string), but can you tell me why it would not update when equation results equals 0 ? Thank you.
<?php
// Update Items Left in Stock
if (isset($_POST["Payment_submit"]) || isset($_POST["Payment_submit_x"])) {
while (!$eCart1->EOF()) {
$QtyLeftInStock = ($eCart1->DisplayInfo("InStockQty") - $eCart1->DisplayInfo("Quantity"));
if ($QtyLeftInStock == 0) {
$QtyLeftInStock = '0';
}
$UpdateQuery = new WA_MySQLi_Query($convacc_cx);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "eCart_products";
$UpdateQuery->addFilter("prod_id", "=", "i", "".($eCart1->DisplayInfo("ID")) ."");
$UpdateQuery->bindColumn("In_Stock_Qty", "i", $QtyLeftInStock, "WA_DEFAULT");
$UpdateQuery->execute();
$UpdateGoTo = "";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
$eCart1->MoveNext();
}
}
$eCart1->MoveFirst();
?>