Skip to content

Load Master Product, Based on Variant Part Code/ID#


Description#

Load Master Product, Based on Variant Part Code/ID

Snippet#

<mvt:comment>
    Lookup product:id based of a variant product code
</mvt:comment>

<mvt:do name="l.success" file="g.Module_Library_DB" value="Product_Load_Code( 'shirt_large_blue', l.settings:product )" />

<mvt:comment>
    Lookup variant information about that product id
</mvt:comment>

<mvt:do name="l.productvariantpart_count" file="g.Module_Library_DB" value="ProductVariantPartList_Load_Part(l.settings:product:id, l.settings:productvariantparts)" />

<mvt:foreach iterator="part" array="productvariantparts">

                Part ID: &mvt:part:part_id;<br>
                Master Product ID: &mvt:part:product_id; <br>
                Quantity: &mvt:part:quantity; <br>
                Variant Id: &mvt:part:variant_id;<br>

</mvt:foreach>

<br>

<mvt:comment>
    Lookup master product information
</mvt:comment>

<mvt:do name="l.success" file="g.Module_Library_DB" value="Product_Load_ID( l.settings:productvariantparts[1]:product_id, l.settings:product )" />
&mvt:product:name;<br>
&mvt:product:code;<br>
&mvt:product:formatted_price;<br>

Functions Used#

  • Product_Load_Code
  • ProductVariantPartList_Load_Part
  • Product_Load_ID