Use ToolKit to display custom fields at variant level?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • godogo
    Mivite

    • Jun 2006
    • 153

    #1

    Use ToolKit to display custom fields at variant level?

    Thanks to the brilliant ToolKit I have been able to display product messages via custom product fields on basket pages and order confirmation emails. What I would really like now would be to display messages pulled from the product variant level.

    Take this scenario:
    Product A has variants x, y, and z. Tracking inventory at the variant level, y sells out. I want to allow customers to buy y, but see in the basket and in the order confirmation email that y is backordered and will be shipped out Jun 15.

    I've played around with the inventory tracking settings/messages at the variant/attribute level but can't seem to get that working to assist in the above scenario - but maybe I'm doing something wrong.

    I've noticed that each product variant *could* be treated as a product (by default it's not active - which is what I want), and thus has access to custom fields. I'm guessing that as long as the variant product is inactive ToolKit can't capture the custom field there? Otherwise, it would be a great way to put in custom messaging at the variant level.

    Am I going about this the wrong way? Advice would be most appreciated.
  • wcw
    Developer Partner

    • Mar 2006
    • 11329

    #2
    Re: Use ToolKit to display custom fields at variant level?

    You can use Tool Kit to get the custom fields if the product id and variant id is known. Then use variantlistbasketinfo to get the variant product id. Then use custom to get the custom field data.
    Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
    Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
    Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
    Facebook http://www.facebook.com/EmporiumPlus
    Twitter http://twitter.com/emporiumplus

    Comment

    • godogo
      Mivite

      • Jun 2006
      • 153

      #3
      Re: Use ToolKit to display custom fields at variant level?

      Great! I think this will work!

      I'm just having trouble combining the variantlistbasketinfo with custom.

      The custom field that I have working at the master product level is this:
      <mvt:item name="toolkit" param="custom|policy|l.all_settings:item:product_i d|POLICY" />
      <mvt:if expr="g.policy">
      <font size ="2" color="red">&mvte:global:policy;</font>
      </mvt:if>

      and here is the variantlistbasketinfo code:

      <mvt:item name="toolkit" param="variantlistbasketinfo|vcount|l.all_settings :item:product_id|l.all_settings:item:variant_id" />
      <mvt:if expr="vcount GT 0">
      <mvt:foreach iterator="part" array="basketitem:variant:parts">
      <br> &mvte:part:code; &mvte:part:name;
      </mvt:foreach>
      </mvt:if>

      How do I get the POLICY custom field at the variant level? Sorry to be so dense. I'm sure it's simple, but I'm not having luck with my first attempts.

      Thanks in advance!

      Comment

      • wcw
        Developer Partner

        • Mar 2006
        • 11329

        #4
        Re: Use ToolKit to display custom fields at variant level?

        Use the part:code and tool kit function customc and see if you can get it for each part in that foreach loop.
        Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
        Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
        Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
        Facebook http://www.facebook.com/EmporiumPlus
        Twitter http://twitter.com/emporiumplus

        Comment

        Working...
        X