Load Variant Data From Order Items#
Description#
This code needs to be on a page were the order item information is available. Ie: Invoice, Order Batch Report, Order History, etc
Snippet#
<mvt:comment>Load Variant ID based on attributes ordered</mvt:comment>
<mvt:do file="g.Module_Library_Utilities" name="l.success" value="OrderItem_DetermineVariant_WithOptions(l.settings:item, l.settings:item:options, g.order_option_count, l.settings:product, g.variant_id)" />
<mvt:comment>Load product variant data. Always returns an array of parts </mvt:comment>
<mvt:do file="g.Module_Library_DB" name="l.success" value="ProductList_Load_Variant(l.settings:product:id, g.variant_id, l.settings:productvariants)" />
<mvt:foreach iterator="part" array="productvariants">
&mvt:part:active;
&mvt:part:code;
&mvt:part:name;
&mvt:part:price;
&mvt:part:quantity;
&mvt:part:taxable;
&mvt:part:weight;
</mvt:foreach>
Functions Used#
OrderItem_DetermineVariant_WithOptions
ProductList_Load_Variant