close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Syntax issue with a Discount

Thread began 11/27/2012 10:16 am by bjgarner241692 | Last modified 11/27/2012 10:54 am by Jason Byrnes | 595 views | 3 replies |

bjgarner241692

Syntax issue with a Discount

php:
//eCart Rule

function WAEC_eCart1_promo()  {
  $totalDiscount = 0;
  if (true && ((sizeof($this->Items) > 0) && (( $_POST["promocode"] <>'' )))) {
    $totalDiscount += ($this->TotalColumn("TotalPrice") * ($row_promo['prDiscount']));//Result
  }
  return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule



I believe that my syntax for this: ($row_promo['prDiscount'])) is incorrect because the discount does not set. If I replace this with a simple value it works fine.

This snippet is from the included eCart page.
The value is setting. I can display it on the Confirmation page but I cannot seem to use it in my discount code.

Have I expressed it incorrectly?

Sign in to reply to this post

Jason ByrnesWebAssist

you should not use recordset values in your discount rules, instead, save he recordset value to a session using the Set Session Value behavior, and use the variable in your discount rule.

Sign in to reply to this post

bjgarner241692

I wondered about that, but I have done it this way before in ASP so I figured it should work.

Thanks for the suggestion.

Sign in to reply to this post

Jason ByrnesWebAssist

recordset data is not persistant, sessions are. the recordset may get set on one page, but not on another that would cause the the discount to fail if you went to a page where the recordset does not exist.

rather than define the recordset on all pages of your site, use sessions to save the recordset value so that it will persist through the other pages once set.

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