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

Disount Code from a recordset

Thread began 7/01/2013 11:24 am by jon392819 | Last modified 7/01/2013 3:30 pm by jon392819 | 475 views | 5 replies


Disount Code from a recordset

Hi Guys, I amended the discount code to look up a discount voucher value via recordset. I get an undefined variable error.
The code is below. Before I amended the code the voucher was hard coded and checked against a session created when person put in a valid code. Worked fine. To enable the site owner to change these codes on a whim I set up a dataabse table to hold the voucher. I then created a recordset in eCart1_PHP.php and changed the below. I know the variable $discountcode gets the correct value but On the cart page its says undefined. Any help really appreaciated. I have put 3 # sybols in front of and at the end of the code I inserted to help you see what I changed.

function WAEC_eCart1_discountRule() {
$totalDiscount = 0;
#####$discountcode = $row_Recordset1['voucher'];####
if (true && ((sizeof($this->Items) > 0) && ((isset($_SESSION['coupon'])?$_SESSION['coupon']:"") == ###$discountcode###))) {
$totalDiscount += ($this->ConditionalTotal("TotalPrice", "sale", "no") * 0.20);//Result

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