close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Dynamic Discounts

Thread began 10/05/2009 1:39 pm by Timespider | Last modified 10/05/2009 5:49 pm by Timespider | 1524 views | 3 replies |

Timespider

Dynamic Discounts

Hello, I have the coupon discount working & a discount if user is logged in working that is statically set to 5% (* 0.05). Now my problem is how to get this 0.05 value from the database. In the members table I have this value but it may change if the member is a frequent shopper etc which is why it needs to come from the DB. I have a recordset that gets the value on the cart page.

I have tried a few things & read this article here but this article is like the coupon & I don't want them to submit any form. I don't know whether to bind a new column or set a new eCart session, if its a session what trigger & value do I give it. I have attached the screen shot of the logged in discount so hopefully someone can help me out.

Any help appreciated. Chris

Sign in to reply to this post

Jason ByrnesWebAssist

Just to make sure I understand correctly,

In your users table, you will include a discount column? So the discount percentage will be set on a user by user basis?

Are you using SecurityAssist for login?


If all of the above is true, on the login page, double click the SecurityAssist Authenticate user Server behavior.

On the third page of the wizard, you can select database columns to store in session variables when the user logs in. Click the Plus button and select the Discount column to store the discount percentage from the users table to a session variable

In the eCart discount rule for the calculation, replace 0.05 with $_SESSION['<Session Var Name>']


where <Session Var Name>is the name of the session variable.

Sign in to reply to this post

Timespider

No SecurityAssist

Hi Jason, no I'm not using SecurityAssist, I use Kolection from old InterACT & not the Adobe addt.

I have now (after reading your reply) created a login session bound to the discount column in the DB called kt_standaeddiscount_usr

So now I have it, do I go to discounts & instead of

0.05 replace with $_SESSION['<kt_standaeddiscount_usr>']

I have loaded a screen shot of the new one & have used

"if session variable exists" times $_SESSION['<kt_standaeddiscount_usr>']

this is not working either. Should I be using "based on a session value"?

Thanks Chris

Sign in to reply to this post

Timespider

Done It

Thanks Jason. I have got it working. Just needed a push in the right direction, my problem was simple, I was putting the php tags in as well %^&*.

For any one else who has a similar problem, this is how it worked for me.

I created another session on the login page that's bound to my members DB column that holds their discounts as a "double" variable type. So it looks like this in the DB 0.05

Then I put a hidden field in my login form that has the new session value. Then when they login they receive their personal discount.

The screen shot in this post shows my set up on the discount tab in the cart object

I had to logout then login again to see it work the first time.

Thanks again Jason. Chris

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