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
    I solemnly swear that I am up to no good...

  • 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
    Lead Developer / Miva, Inc.
    [email protected]
    http://www.miva.com

    Comment


    • Thank you. We were able to put that code to good use :)
      Colin Puttick
      I solemnly swear that I am up to no good...

      Comment

      Working...
      X

      This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

      This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

      Accept