![]() |
| > Home > Documentation > Latest documentation > Interchange tags > assign |
|
assignAllows you to assign numeric values to preempt the calculation of one or more of the [handling], [salestax], [shipping] and [subtotal] tags. The assignment is persistent within a user's session until you clear it, an assigned tag will return your value instead of calculating a value. Summary
ExamplesPerl example
or similarly with positional parameters:
DescriptionAn assigned tag will return your value rather than calculating its own until you clear the assignment. The assignment is persistent for the duration of the user's session, unless you clear it, and only affects the current user. You can clear all assignments using the clear parameter, or you can clear individual assignments by assigning an empty string (not zero) to the named type(s).
The following eliminates sales tax and sets shipping to 4.99 (regardless of weight and destination etc.):
This restores the usual sales tax calculator and eliminates handling charges:
This restores the normal behaviour to the [shipping] and [handling] tags:
The assignment affects only the value returned by a tag. Other behaviour, such as rounding and formatting for the local currency, will not be affected by the assignment; the display tag will take care of any currency formatting that is required. You cannot use this tag to override the total cost value. The [total-cost] value will always be the sum of [handling], [salestax], [shipping] and [subtotal].
ParametersclearSetting this to a true value clears all pending assignments (i.e. all assignable tags return to normal behaviour). credithandlingThis option sets a total handling cost. The [handling] tag will be inactive, despite your assignment, unless the [value mv_handling] variable is true (i.e. a non-zero, non-blank value). salestaxThis parameter sets an override for the sales tax cost. shippingThis parameter sets an override for the total shipping cost. The [value mv_shipmode] must be set true (i.e. a non-zero, non-blank value) in order for your assignment to [shipping] to have any effect in the [total-cost] calculation. subtotalThis parameter sets an override for the item subtotal cost (the value of all items excluding tax, handling and shipping etc.).
|
| Home | Legal nonsense | Privacy policy | Contact us |