How to prevent Shipping and Total from Displaying when SameAs (billing) clicked
What do I comment out to prevent the Shipping and Grand total from displaying when Shipping Same As Billng Input clicked?
I only want to show subtotal at that point.
What do I comment out to prevent the Shipping and Grand total from displaying when Shipping Same As Billng Input clicked?
I only want to show subtotal at that point.
You would probably have to use javascript and the onclick event to hide or show the regions based on the checkbox click. I think those rows already have an ID, so you can use that to change the visibility.
trying that...but because that segment is already loaded, and it's simply pushing it down, it does not refresh on the next page (after pressing 'continue' button).
I'll have to learn Ajax this weekend I think.
This is better for a premier support ticket. It would only take me 10-15 minutes to figure out, but it would likely involve some custom javascript to dynamically update the page based on the checkbox click.
The issue is the following:
If someone ads to cart, gets to the checkout page, hits 'Same as billing' checkbox, it calculates the shipping. Fine. However, if they go back to the shopping list (because they want to add something else at that point (for any reason), then add something else, then get back to checkout, the Shipping totals retains the original shipping amt. instead of the updated amt, which will only update on the next screen (after pressing 'Continue' btn.
That is the reason I wanted to Not Display the Shipping (and the Grand Total (only the subtotal), until that page. (it looks like it stays on the Checkout.php page but simply Includes the Confirm.php, which in turn Includes the Confirm_cart.php page.)
I am able to hide the fields with css of course (named eC_SummaryShipping and eC_SummaryFooter (this latter one I added as it wasn't there for the tr).Tried hiding on checkout.php and showing on confirm.php with css 'visibility', but, I can't make it reappear after pressing 'Continue'. So it'ls hidden for good.
(I also tried with JQuery, but can't make it reappear).
But that is our dilema.
make it works so that it just doesn't show the Shipping, Discounts, Tax and Grand Totals table rows on the confirm_cart.php file until the button 'Continue' is pressed on the checkout.php.
If you fix it and it works,
This was fixed in a premium support ticket yesterday.
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();
?>
This line:
$UpdateQuery->bindColumn("In_Stock_Qty", "i", $QtyLeftInStock, "WA_DEFAULT");
The last argument tells it what to do when the value is blank. A numeric zero is the equivalent of blank. If you changed it from WA_DEFAULT to WA_ZERO, then I think it would have worked with the original code.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.