I do not want all users of the module to be able to change the product price and/or quantity while taking orders. How do I do this?
To change the field that displays the product price in the basket to a "non editable" field change the %prodpricebox% token to %prodpriceF%. Similarly, you can change the quantity field by replacing the %prodqtybox% token to %prodinbasket%. However, this is only one step. The module will attempt to update the price, and not finding those fields it will give the product a $0.00 price.
Fortunately, there are some tokens that can be used in the "main template" to control whether or not the price and quantity can be updated. If the %basketprice_nochange% token is in the main template (inside of the %beginform% and %endform% tokens) then the price will not be updated when the "update" button is hit (the price for that product already stored in the basket will be used). If the %basketquantity_nochange% token is used (again, inside of the %beginform% and %endform% tokens) then the quantity will not be updated and the quantity already stored in the basket will be used.
It is possible to make these tokens conditional. The module keeps track of the data about the current user in the database variable Users.d. and the variable Users.d.name stores the name (aka "login") of the current user. So you could make the %basketprice_nochange% token conditional for everyone but the user with the login "admin" by using:
%begin_if|NOT (Users.d.name EQ 'admin')|%
%basketprice_nochange%
%end_if%
this would make the price changeable for only the user with the "admin" login. Similarly, the variable g.User:admin will have a value of 1 for admin users (those user with admin privileges). So to give the price changing privilege only to admins you could use:
%begin_if|NOT(Users.d.admin)|">
%basketprice_nochange%
%end_if%
Note, that changing the %prodpricebox% and %prodqtybox% tokens isn't technically necessary. If you use the %basketprice_nochange% and %basketquantity_nochange% tokens, the price and quantity, respectively, will not be updated regardless of whether or not the price is displayed at all, much less in a changeable field.
Last update: 2007-07-10 21:15
Author: Thor
Revision: 1.0
You cannot comment on this entry
Most Recent FAQ Entries: 
- I have the UPS Custom Integration configured so that ... (2008-07-11 10:21)
- I would like to conditionally display something for a ... (2008-07-03 17:37)
- Is there any way to configure specific global headers ... (2008-06-02 18:28)
- I pay my affiliates with gift certificates from your ... (2008-05-29 10:42)
- Is there any way to add a negative number ... (2008-05-22 13:51)
Top 10 
- 2521 views:
Adding Tokens to Evaluate Expressions - 2510 views:
Why won't you call me for technical support? I ... - 2489 views:
Is there a way to "Limit" the number of ... - 2402 views:
Are license keys valid for more than one store? ... - 2308 views:
I'm trying to enter a license key and get ... - 2270 views:
How do I install a module? - 2133 views:
How do I check for a module upgrade? - 2132 views:
How can display and change the parameters of an ... - 1960 views:
The total on my checkout pages are not correct. ... - 1843 views:
I have select and radio type attributes in my ...
















