Announcement

Collapse
No announcement yet.

product uri link from product code in an array

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

  • Strat1979
    replied
    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

    Leave a comment:


  • lesliekirk
    replied
    Originally posted by Strat1979 View Post
    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!
    Wait! What? You have been able to randomize a carousel? Ohhhh how I have begged for that. I'd be able to replace one more Toolkit function

    Leave a comment:


  • Strat1979
    replied
    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:


  • Matt Zimmermann
    replied
    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:


  • Strat1979
    started a topic product uri link from product code in an array

    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>
Working...
X