Announcement

Collapse
No announcement yet.

Accessing a Product's Canonical Category Code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Accessing a Product's Canonical Category Code

    Is it possible to access the product's canonical category code directly from "Product_Load_ID" or must it be loaded separately like in the example below?

    Code:
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Product_Load_ID(l.settings:loadThisPartID, l.settings:product)" />
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_ID(l.settings:product:cancat_id, g.category)" />
    Canonical Category Code: &mvta:global:category:code;]

    #2
    That value is not available using the Product_Load_ID function in Miva Template Language. The only value stored in the array is going to be the category ID.

    Another way you can get the code of the canonical category is through the JSON API using the ProductList_Load_Query function. That value is available passing in an additional filter:

    https://docs.miva.com/developer/deve...#example-usage

    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment

    Working...
    X