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

select wholesale price in ecart and on detail page when session variable exists.

Thread began 9/07/2009 8:35 pm by dave315749 | Last modified 9/14/2009 9:00 am by dave315749 | 1270 views | 4 replies

Eric Mittman

I do not have a step by step guide for you on this but here is the general idea:

You set the session variable when the user logs in. You will check this session variable to determine the price to charge.

How you do that is to make sure you have a whole sale price in your table for your items. There should be a public price and the wholesale price.

Once you have that worked out you should just set it up to use the public price. Then you will need to manually edit the code on the page to have it use the wholesale price if the session variable is set to a particular value.

So if your session variable is called 'wholesaler' and has a value of 1 and the recordset on your product detail page was call rsProducts and the columns were 'price' and 'wholesale' you would update the code for the price in the add to cart server behavior like this:

$ATC_itemPrice = ($_SESSION['wholesaler'] == 1)?$row_rsProducts['wholesale']:$row_rsProducts['price'];

This type of selection statement to choose one value over another based on a condition is called a ternary expression. If the condition is true then the value after the question mark is used, if the condition is false then the value after the colon is used instead. So in this case if the session variable wholesaler holds a value of 1 then the wholesale price from the db will be used, otherwise use the regular price column.

This is only meant to be a high level overview, not a step by step guide. If you have any questions about any part of this please post back with your questions and I will do what I can to help clarify, or make other suggestions that may help.

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