[interchange-docs] xmldocs - docelic modified refs/discount

docs at icdevgroup.org docs at icdevgroup.org
Thu Oct 5 06:08:21 EDT 2006

User:      docelic
Date:      2006-10-05 10:08:21 GMT
Modified:  refs     discount
* Improve description and examples

Revision  Changes    Path
1.7       +15 -5     xmldocs/refs/discount

rev 1.7, prev_rev 1.6
Index: discount
RCS file: /var/cvs/xmldocs/refs/discount,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- discount	5 Jul 2006 10:25:05 -0000	1.6
+++ discount	5 Oct 2006 10:08:20 -0000	1.7
@@ -7,9 +7,13 @@
 The tag is used to implement per-customer discounts. Discounts can 
 be applied to individual items, groups of items, or total orders.
-The tag accepts &PERL; code in its body. To share variables with the
-<!-- TODO only calc or perl would do too ? -->
-rest of your catalog, use &tag-calc;.
+The tag accepts &PERL; code in its body. Two special variables,
+<varname>$q</varname> and <varname>$s</varname>, are available and 
+represent item quantity and base price.
+&PERL; variables can be shared among &tag-calc; blocks
+and the &tag-discount; tag within the same page, allowing for
+greater flexibility. See <xref linkend='discount_examples'/>.
 For an introduction and theory behind item discounts, please see 
 the &glos-discount; glossary entry.
@@ -36,8 +40,14 @@
+__NAME__ example: Discount of 25% for an individual item, only if quantity ordered is 1
+[discount 00-342] $q == 1 ? $s * 0.75 : $s [/discount]
-__NAME__ example: A discount of 5 on entire order:
+__NAME__ example: A discount of 5 on entire order
 [discount ENTIRE_ORDER] $s - 5 [/discount]
@@ -46,7 +56,7 @@
 __NAME__ example: Resetting discounts
 To reset a discount, simply set it to the empty string: 
-[discount ALL_ITEMS][/discount]
+[discount ALL_ITEMS /]

More information about the docs mailing list