Announcement

Collapse
No announcement yet.

how to get variant_id in marketing feeds?

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

    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

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

    https://snippets.cacher.io/snippet/9d0589c50432d42c2d21

    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


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

      Comment

      Working...
      X