Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 01330ec25d
Fetching contributors…

Cannot retrieve contributors at this time

92 lines (76 sloc) 3.012 kb
__NAME__ purpose
specify products table columns containing values for product attributes
__END__
__NAME__ missing
improve description based on syntax seen in examples
in the examples, explain mv_sku lookup, not clear now
__END__
__NAME__ see also
UseModifier
__END__
__NAME__ synopsis
<arg choice='opt'><replaceable>name</replaceable>=</arg><arg choice='plain' rep='repeat'><arg choice='opt'><replaceable>table</replaceable>:</arg><replaceable>column</replaceable><arg choice='opt'>:<replaceable>key</replaceable></arg>
</arg>
__END__
__NAME__ description
The directive specifies names of the product &glos-attribute;s
which should be automatically loaded from table columns.
Table, column and key identifiers belonging to a single specification
are separated by a colon (<literal>:</literal>), while multiple specifications
are separated by whitespace.
</para><para>
In other words,
when an item is added to the shopping cart using &IC;'s routines, the
attributes declared in &conf-AutoModifier; will be set to the values of the
fields in the <database>products</database> database.
</para><para>
This facility will often be employed in determining product
&glos-price;, &glos-discount;, &glos-tax; and &glos-shipping;, and
other custom attributes; these attributes will probably
be used in custom &PERL; code that will scan the electronic
&glos-cart; contents and perform decisions. For example, by defining
columns <database class='field'>heavy</database> and
<database class='field'>downloadable</database>, you will be
able to perform decisions
based on <code>$item-&gt;{heavy}</code> and
<code>$item-&gt;{downloadable}</code> (but there are more access methods,
see the &glos-attribute; &GE;).
__END__
<!-- TODO
This one has a bit of "magic" associated. To account for matrix-option
products, the various product tables are searched, for both the item
code and the base SKU associated with the item.
-->
__NAME__ notes
This can useful when doing shipping calculations or in embedded
&PERL; code that works on item attributes.
</para><para>
See &glos-attribute; for a complete introduction to item attributes.
__END__
__NAME__ example: Specifying AutoModifier
To set whether an item is defined as "heavy" and requires truck shipment, or
is "downloadable", set:
<programlisting>
AutoModifier heavy downloadable
</programlisting>
<para>
Also make sure to have the
<database class='field'>heavy</database> and
<database class='field'>downloadable</database> columns defined in your
<database>products</database> database.
__END__
__NAME__ example: set attribute 'heavy' from table 'inventory'
<programlisting>
AutoModifier inventory:heavy
</programlisting>
__END__
__NAME__ example: set attribute 'weighty' from table 'inventory', column 'heavy'
<programlisting>
AutoModifier weighty=inventory:heavy
</programlisting>
__END__
__NAME__ example: set attribute 'heavy' from table 'inventory', with a different SKU
<programlisting>
AutoModifier inventory:heavy:mv_sku
</programlisting>
__END__
Jump to Line
Something went wrong with that request. Please try again.