Miva Merchant JSON Product Schema Code

 In Company Blog

Miva Merchant product Schema to add into miva website on product display page.

<!– Google Rich Snippets –>
<script type=”application/ld+json”>
<mvt:assign name=”g.days_in_future” value=”15″ />
<mvt:assign name=”g.days_in_seconds” value=”(60*60*24) * g.days_in_future” />
<mvt:assign name = “l.settings:month” value = “padl( time_t_month( s.time_t + g.days_in_seconds, ‘local’ ), 2, ‘0’ )” />
<mvt:assign name = “l.settings:day” value = “padl( time_t_dayofmonth( s.time_t + g.days_in_seconds, ‘local’ ), 2, ‘0’ )” />
<mvt:assign name = “l.settings:year” value = “time_t_year( s.time_t + g.days_in_seconds, ‘local’ )” />
<mvt:assign name=”g.future_date” value=”l.settings:year $ ‘-‘ $ l.settings:month $ ‘-‘ $ l.settings:day” />
<mvt:assign name=”l.settings:product:stripped_descrip” value=”miva_html_strip(l.settings:product:descrip, ”)”/>
{
“@context”: “http://schema.org”,
“@type”: “Product”,
“name”: “&mvtj:product:name;”,
“image”: “&mvt:global:socialImage;”,
“description”: “&mvtj:product:stripped_descrip;”,
<mvt:if expr=”NOT ISNULL l.settings:product:sku”>
“sku”: “&mvtj:product:sku;”,
“mpn”: “&mvtj:product:sku;”,
<mvt:else>
“sku”: “&mvtj:product:code;”,
“mpn”: “&mvtj:product:code;”,
</mvt:if>
“category”: “&mvtj:category:name;”,
“brand”: {
“@type”: “Thing”,
<mvt:if expr=”NOT ISNULL l.settings:product:customfield_values:customfields:brand”>
“name”: “&mvtj:product:customfield_values:customfields:brand;”
<mvt:else>
“name”: “&mvtj:global:store:name;”
</mvt:if>
},
“offers”: {
“@type”: “Offer”,
“url”: “&mvtj:product:link;”,
<mvt:if expr=”NOT ISNULL l.settings:product:sku”>
“sku”: “&mvtj:product:sku;”,
<mvt:else>
“sku”: “&mvtj:product:code;”,
</mvt:if>
“name”: “&mvtj:product:name;”,
“description”: “&mvtj:product:stripped_descrip;”,
“seller”: “&mvtj:global:store:name;”,
“itemCondition”: “new”,
<mvt:if expr=”l.availability_inv_level EQ ‘low'”>
“availability”: “http://schema.org/LimitedAvailability”,
<mvt:elseif expr=”l.availability_inv_level EQ ‘out'”>
“availability”: “http://schema.org/OutOfStock”,
<mvt:else>
“availability”: “http://schema.org/InStock”,
</mvt:if>
<mvt:if expr=”l.settings:attributemachine:product:inv_level”>
<mvt:assign name=”l.availability_inv_level” value=”l.settings:attributemachine:product:inv_level”/>
<mvt:do name=”l.formatted_variant_price” file=”g.Module_Root $ g.Store:currncy_mod:module” value=”CurrencyModule_AddFormatting( g.Store:currncy_mod, l.settings:attributemachine:product:price )” />
“price”: “&mvtj:attributemachine:product:price;”,
<mvt:else>
<mvt:assign name=”l.availability_inv_level” value=”l.settings:product:inv_level”/>
“price”: “&mvtj:product:price;”,
“priceValidUntil”: “&mvt:global:future_date;”,
</mvt:if>
“priceCurrency”: “USD”
}
}
</script>

Recommended Posts

Leave a Comment