close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

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

Thread began 6/28/2019 1:12 pm by lr_leal239405 | Last modified 7/09/2019 7:22 pm by Ray Borduin | 75 views | 9 replies |

lr_leal239405

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.

Sign in to reply to this post

Ray BorduinWebAssist

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.

Sign in to reply to this post

lr_leal239405

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.

Sign in to reply to this post

Ray BorduinWebAssist

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.

Sign in to reply to this post

lr_leal239405

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.

Sign in to reply to this post

lr_leal239405

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,

Sign in to reply to this post

lr_leal239405

Why doesn't this work.

Sign in to reply to this post

Ray BorduinWebAssist

This was fixed in a premium support ticket yesterday.

Sign in to reply to this post

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

Sign in to reply to this post

Ray BorduinWebAssist

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.

Sign in to reply to this post
loading

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...