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
Records in this category
- Making "Additional Charge" Display When Using COD Payment Module
- Unable to Sort by Product Code OR Name
- Eliminating Out of Stock Items From Displaying In the Product List
- Specifying a Quantity For Each Item In Product List
- Displaying Tax Module Fields on Phone Order Manager Interface
- In previous versions of the module I could enter addresses that were missing elements otherwise required during normal Merchant checkout (such as a shipping email address) but now I am returned to the OINF screen to provide missing information.
- 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?
- When I attempt to add a product with insufficient inventory or when I try to increase the quantity of a product in the basket past the available inventory the page simply refreshes. How can I display a message to the user about what happened?
- Is there a token similar to %basketprice_nochange% for the tax and shipping prices. Looking to have the boxes not be editable unless under a specific login.
- With the %recalculatetax% token, is there a way that after the page is updated, for that box to remain checked after update?
- I would like to configure Phone Order Manager so that I can copy entire orders into the basket to make "re-ordering" easier. Can I do this?
- The page loads sometimes take a little while. Is it possible to display a "loading" graphic to remind the user that the page is loading?
- What does the "Add all products in ctgy:" option do?
- Is it possible to enter items into the basket which are not in Merchant's databases, such as auction items?
- Is there any way to add a negative number to the basket total, for example, to give a discount to a customer?
- Is it possible to display a link in Phone Order Manager which will add a product to the basket or bring up the Product Search window with results for a particular search term? For example, I'd like to be able to see all results for "certs".
- I am looking for a module that will allow me to use my phone order manager and while in that process be able to hit a link or button that will put the exact last order back into the system from the customers last order.
- Is there any way to look up a customer's previous order information?
















