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

eCart Checkout Wizard - not saving order details to database.

Thread began 8/12/2015 10:15 am by Nathon Jones Web Design | Last modified 9/03/2015 7:11 pm by Nathon Jones Web Design | 1554 views | 28 replies

Nathon Jones Web Design

The field is set, in the MySQL database table, to have a default value of "0".

The hidden form field on the checkout page is as follows for the Billing Address:
<input id="Company_Name" name="Company_Name" type="hidden" value="<?php echo $_SESSION['HoldForCollectionSESH']; ?>">

...and as follows for the Shipping Address:
<input id="Company_Name_2" name="Company_Name_2" type="hidden" value="<?php echo $_SESSION['HoldForCollectionSESH']; ?>">

This session value depends on whether someone clicks a "Hold for Collection" button on the view basket page (which nullifies the UPS Shipping). It stores a "1" as this session value, if clicked. However, a customer might not click this button (because they want the order delivered) in which case shouldn't it, when saving to database, just default to the database default value considering that value="" is being submitted?

On the view basket page I also have a "Deliver my Order" button which only appears AFTER the user has selected "Hold for Collection". Clicking the "Deliver my Order" button changes the session value to "0".

Should I set the database table to just allow NULL but also have a default value of 0?

One other thing...I'm using the following on the view basket page:
<?php if ($_SESSION["HoldForCollectionSESH"] <> 1) { ?>

In PHP, should this actually be:
<?php if ($_SESSION["HoldForCollectionSESH"] != 1) { ?>

Appreciate the advice, thank you.

EDIT: Setting the MySQL field to allow NULL has resolved it. I can only assume that submitting value="" to a MySQL field that has a default value set doesn't, in fact, mean that the default value will be entered by default. Only when NO value is attempted to be stored, like a TIMESTAMP field for example, does it do that.

Would appreciate clarification on <> and != though as I have that throughout the site. It does seem to work with <> but I'd rather have things correct otherwise I fear I just leave myself open to problems in the future.

Much appreciated.

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





Ease of use


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