close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Update Cart Question

Thread began 10/18/2012 7:26 am by Mike Perry | Last modified 10/19/2012 10:17 am by Mike Perry | 1249 views | 4 replies |

Mike Perry

Update Cart Question

One of the fields in my db is reserveDate. This is a timestamp that saves the time someone adds an item to their cart. Visitors have 30 minutes to finish and process their cart, and if the item is not purchased the item shows as available 30 minutes later.

I'm wondering where in the cart UpdateCart function I would put code to set this field to 0 if they remove an item from their cart prior to checking out. Obviously it need to process all items that are checked to be deleted.

Thanks,

Sign in to reply to this post

Jason ByrnesWebAssist

you would need to hand code this in the Update Cart server behavior that is added to the page.

the update cart behavior would look similar to:

php:
<?php

// WA eCart Update
if (isset($_POST["eCart3_Update_100"]) || isset($_POST["eCart3_Update_100_x"]))     {
  
$eCart3->UpdateCart();
  
$Redirect_redirStr="";
  if (
$Redirect_redirStr != "")     {
    
$eCart3->redirStr $Redirect_redirStr;
  }
  
$eCart3->cartAction "Update";
}
?>
Sign in to reply to this post

Mike Perry

Originally Said By: Jason Byrnes
  you would need to hand code this in the Update Cart server behavior that is added to the page.

the update cart behavior would look similar to:
php:
<?php

// WA eCart Update
if (isset($_POST["eCart3_Update_100"]) || isset($_POST["eCart3_Update_100_x"]))     {
  
$eCart3->UpdateCart();
  
$Redirect_redirStr="";
  if (
$Redirect_redirStr != "")     {
    
$eCart3->redirStr $Redirect_redirStr;
  }
  
$eCart3->cartAction "Update";
}
?>
  


Thanks -- I know the code to update the db, but where would I add it to insure that all updated records are changed?? Would it be after this:

php:
$eCart3->UpdateCart();
Sign in to reply to this post

Jason ByrnesWebAssist

sure, it could be after the line:

php:
$eCart3->UpdateCart();



or it could be after this line:

php:
$eCart3->cartAction = "Update";




you could even create a new code block to perform the update and use the trigger if statement around it:

php:
<?php if (isset($_POST["eCart3_Update_100"]) || isset($_POST["eCart3_Update_100_x"]))     { 
<
update code here>
}
?>



the point is to trigger the update when the update button is pressed.

Sign in to reply to this post

Mike Perry

Works great -- thanks, coach!!

Sign in to reply to this post

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