how to get variant_id in marketing feeds?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dreamingdigital
    Mighty Mivite









    • Aug 2006
    • 804

    #1

    how to get variant_id in marketing feeds?

    How do we get the variant's variant_id variable in marketing feeds? It's not in the l.settings:record:variant data at all. Why?? Because when you append ?variant_id=## to the master product's URI then Miva's attribute machine will automatically 'click' the appropriate attributes to select that variant. This makes markeplace feeds happy because the link you give them for the variant will be what's displayed on the page. EX: Large Blue Shirt variant goes to the Shirt and selects Large and Blue because we put ?variant_id=## in the URI.

    So... other than running some SQL, which I can do but don't want to, I can't seem to find any API functions that I can use to get me the variant_id if the variant.

    PS: yes, this is a marketing feed and variants checkbox is checked. That's all 'easy' stuff.
    Colin Puttick
    Miva Web Developer @ Glendale Designs
  • Nick
    Super Moderator











    • Dec 2011
    • 578

    #2
    You can do something like this within the Advanced Version of the feed template:

    Get variant_id in Miva Feed - @MivaLearn shared this Cacher snippet. Cacher is the code snippet organizer that empowers professional developers and their teams to get more coding done, faster.


    That will give you the variant_id using the variant record ID.

    Here is another example on how that function works:

    https://docs.miva.com/code-samples/l...nt-part-codeid

    Hope that works!


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

    Comment

    • dreamingdigital
      Mighty Mivite









      • Aug 2006
      • 804

      #3
      Thank you. We were able to put that code to good use :)
      Colin Puttick
      Miva Web Developer @ Glendale Designs

      Comment

      Working...
      X