This topic is locked

php logic for 2 pricing groups

3/16/2007 12:09:34 PM
PHPRunner General questions
D
dlpirl author

My wholesale users are in the group 'whlsale' -- that is their value in the 'group' field of the 'username' table. I have both wholesale and retail prices in my products and pricing table. How can I show wholesale prices in orderdetails list, edit, add, and view screens for wholesale users, and retail prices for all others?

J
Jane 3/19/2007

Donald,
I recommend you to create custom views for wholesale and other users on the Datasource tables tab and use custom code on the "View as" settings dialog on the Visual Editor tab.

D
dlpirl author 3/20/2007

Donald,

I recommend you to create custom views for wholesale and other users on the Datasource tables tab and use custom code on the "View as" settings dialog on the Visual Editor tab.


Thanks, Jane. can you give me some same custom code to enable me to determine group membership? Once I have that I believe I will be able to grab the right fields for pricing.

J
Jane 3/21/2007

Here is a sample. No guarantee it works.

if ($_SESSION["OwnerID"]=='your value')

{

...

}

D
dlpirl author 3/26/2007

Here is a sample. No guarantee it works.




FYI, I've learned that

if ($_SESSION["GroupID"]=='your value')

{

...

}
is the test I was looking for.