close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

eCart - adding a text area to cart.php

Thread began 2/14/2012 12:19 am by mail393820 | Last modified 2/21/2012 2:19 pm by Jason Byrnes | 1000 views | 7 replies |

mail393820

eCart - adding a text area to cart.php

On the cart.php page I have added a text area so the shopper can add their own message. I have also added a field "DetailMessage" in the "OrderDetails" table of the database. I have created a "Message" in the columns section of the eCart object and it appears as an updatable hidden field in the bindings on the eCart add to cart button. The problem I have is that when an order is placed, the message is not saved in the database. I would be grateful for your advice.
Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

In the Archived documentation section of the eCart support page there is a tutorial for "Creating a Coupon system for your eCart store".


this tutorial walks through adding a text box to the cart page and storing it's value in a session variable. the coupon text box is basically the same idea as your text area.

once you have the text area value stored in a session variable, you can modify the store order summary server behavior on the confirm page to save the session into the order details table.

Sign in to reply to this post

mail393820

Thanks Jason. That's working fine. I now have a slight problem with the text area. If i enter for example "Here's my message" and the hit "update" the message becomes "Here/'s my message". How can I stop it adding the "/"?
Regards

Sign in to reply to this post

Jason ByrnesWebAssist

this usually happens if the gpc_magic_quotes setting is enabled in your php.ini, you should contact your host to have them disable this setting.

If they are not willing to disable it, you can try adding the following code on line 1 of your cart page:

php:
<?php

if($_SERVER["REQUEST_METHOD"] == "POST")     {
    foreach(
$_POST as $k => $v) {
        
$_POST[$k] = stripslashes($v);
    }
}
?>
Sign in to reply to this post

mail393820

eCart - email problem

Thanks Jason. I've come across one more problem. Since adding the new text box for "Message" on the cart page. The email confirmation errors. The page displays the following " Unknown column 'DetailMessage' in 'field list' ". I have universal email installed and it was set-up by the checkout wizard. Could you please advise so the info contained in 'DetailMessage' also gets emailed along with the rest of the orderdetails.
Many thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

that is a database error. tough to tell where it is coming from though.

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

mail393820

Hi Jason. Many thanks for you assistance. The problem has now been fixed. I had simply misspelt the field name in the database.

Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear it is working.

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