close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

How to prevent Shipping and Total from Displaying when SameAs (billing) clicked

Thread began 6/28/2019 10:12 am by lr_leal239405 | Last modified 7/09/2019 4:22 pm by lr_leal239405 | 914 views | 9 replies

lr_leal239405

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();
?>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...