Miva Merchant 4 Module FAQs » Phone Order Manager (BROK_PHONEORDERS)


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')|%

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:


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

Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry

Records in this category