Announcement
Collapse
No announcement yet.
product uri link from product code in an array
Collapse
X
-
Sorry, but it is using the toolkit function ( like you, I know of no other way of doing it) but I think I have optimized the way of doing it in combination with miva script
-
Originally posted by Strat1979 View PostThanks Matt! That did the trick.
BTW My goal was to, using the readytheme carousel, pull random products (which is what that array is for) from a readytheme category and get the proper uri product links. Success!
- 1 like
Leave a comment:
-
Thanks Matt! That did the trick.
BTW My goal was to, using the readytheme carousel, pull random products (which is what that array is for) from a readytheme category and get the proper uri product links. Success!
Leave a comment:
-
That function requires the product ID which is different from the product code. If it is available in the array you are using, you would want to pass it as <mvt:assign name="l.uri:product_id" value="l.settings:product:id" />. If it is not available, you will have to perform a product load and pull the ID.
https://docs.miva.com/code-samples/load-canonical-uri
Leave a comment:
-
product uri link from product code in an array
I am using this array:
<mvt:foreach iterator="product" array="sub_products">
Each product code is obtained via: &mvt:product:code;
My code to obtain each uri product link is below, however, no luck getting the product uri link. Any suggestions?
<mvt:foreach iterator="product" array="sub_products">
<mvt:assign name="l.uri:product_id" value="l.settings:product:code" />
<mvt:do file="g.Module_Feature_URI_DB" name="l.have_uri" value="URI_Load_Item_Canonical( l.uri, l.settings:canonical_uri )" />
<mvt:if expr="l.have_uri">
&mvt:canonical_uri:uri; //comment even &mvt:product:link; is a no go
</mvt:if>Tags: None
Leave a comment: