[interchange-docs] xmldocs - docelic modified refs/discount
docs at icdevgroup.org
docs at icdevgroup.org
Wed May 14 20:15:05 UTC 2008
User: docelic
Date: 2008-05-14 20:15:05 GMT
Modified: refs discount
Log:
* small fix in synopsis layout
* add example
Revision Changes Path
1.10 xmldocs/refs/discount
rev 1.10, prev_rev 1.9
Index: discount
===================================================================
RCS file: /var/cvs/xmldocs/refs/discount,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- discount 9 Jul 2007 11:11:47 -0000 1.9
+++ discount 14 May 2008 20:15:05 -0000 1.10
@@ -13,9 +13,9 @@
</row>
<row>
<entry>
- <group choice='plain'>
- <arg>discount_space</arg>
- <arg>space</arg>
+ <group choice='opt'>
+ <arg choice='plain'>discount_space</arg>
+ <arg choice='plain'>space</arg>
</group>
</entry>
<entry></entry>
@@ -171,6 +171,28 @@
</programlisting>
__END__
+
+__NAME__ example: Using wholesale price for special promotions
+In the following example, items with modifier "promotion" receive the
+price defined in <database class='field'>products:wholesale</database>
+instead of <database class='field'>products:price</database>.
+<programlisting>
+[perl tables='products']
+my %seen = ();
+
+foreach $item (@{$Items}) {
+ next unless $item->{promotion};
+ next if $seen{$item->{code}}++;
+
+ my $promo_price = $Tag->data('products','wholesale',$item->{code});
+
+ $Session->{discount}->{$item->{code}} = "$promo_price * \$q";
+}
+[/perl]
+
+</programlisting>
+__END__
+
__NAME__ see also
DiscountSpacesOn, DiscountSpaceVar, discount, discount-space
__END__
More information about the docs
mailing list