Announcement

Collapse
No announcement yet.

Multiadd Product Flag

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

    Multiadd Product Flag

    I'm trying to get the Product Custom Field to display on a Product Multi-Add Display page. This code will display the class but it's not displaying the custom field (it should display SALE)

    Code:
    <mvt:item name="customfields" param="Read_Product_Code(l.settings:multiprod:code , 'product-flag', l.settings:multiprod:prod_flag)" />
    <mvt:if expr="l.settings:multiprod:prod_flag NE 'none'">
    <mvt:assign name="l.settings:multiprod:flag" value="'flag--' $ tolower(l.settings:multiprod:prod_flag)" />
    </mvt:if>
    <span class="flag &mvt:multiprod:flag;">&mvt:multiprod:customfield_values:customfields:product_flag;</span>
    I know I must be missing something, I just do not know what

    Help, please.
    Leslie
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    #2
    You have two different variables that you are using to call the product flag custom field. In your first one, you are calling 'product-flag' and inside your span you are calling product_flag.

    Comment


      #3
      wow leslie, stealing my routine now :)

      remember kids always get the habit of using _ in code variable...ALWAYS. (says the person that too frequently doesn't)
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


        #4
        So bear with me here. On the Quick View page this works

        Code:
        <mvt:item name="customfields" param="Read_Product_Code(l.settings:product:code, 'product-flag', l.settings:product:prod_flag)" />
        <mvt:if expr="l.settings:product:prod_flag NE 'none'">
        <mvt:assign name="l.settings:product:flag" value="'flag--' $ tolower(l.settings:product:prod_flag)" />
        </mvt:if>
        <span class="flag &mvt:product:flag;">&mvt:product:customfield_values:customfields:product_flag;</span>
        So of course I "assumed" if I tweaked it a little if would work for the Multiview page. Color me confused now...

        Leslie Kirk
        Miva Certified Developer
        Miva Merchant Specialist since 1997
        Previously of Webs Your Way
        (aka Leslie Nord leslienord)

        Email me: [email protected]
        www.lesliekirk.com

        Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

        Comment


          #5
          So, what is the code for the product flag custom field? Is it product-flag* or product_flag? And is the product_flag custom field assigned in the layout?

          *Bad general practice as you know to use hyphens in custom field codes.

          Comment


            #6
            Originally posted by Leanne View Post
            So, what is the code for the product flag custom field? Is it product-flag* or product_flag? And is the product_flag custom field assigned in the layout?

            *Bad general practice as you know to use hyphens in custom field codes.
            product-flag and yup, I know but it's inherited code that I'm trying to make work.




            The end goal is to get the two things to happen - get the Flag span class to display and the Flag text
            Leslie Kirk
            Miva Certified Developer
            Miva Merchant Specialist since 1997
            Previously of Webs Your Way
            (aka Leslie Nord leslienord)

            Email me: [email protected]
            www.lesliekirk.com

            Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

            Comment


              #7
              Okay, I correct the Product Custom Field price-flag to price_flag. Did a Template Search and Replace and then went in and reassigned the Custom Field to the templates.

              Now back to getting the Multiprod template to work
              Leslie Kirk
              Miva Certified Developer
              Miva Merchant Specialist since 1997
              Previously of Webs Your Way
              (aka Leslie Nord leslienord)

              Email me: [email protected]
              www.lesliekirk.com

              Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

              Comment


                #8
                So since you’ve already called the prod_flag custom field using Read_Product_Code, and you say that is successfully appending the custom field value to the flag— class, could you not just use &mvt:multiprod:prod_flag; to output it inside the span?

                (Be kind if I’m missing something obvious, I’m still on my first cup of coffee…)

                Comment


                  #9
                  I'm stuck


                  Code:
                   <mvt:if expr="l.settings:multiprod:customfield_values:customfields:product_flag NE 'none'">
                  <mvt:assign name="l.settings:multiprod:flag" value="'flag--' $ tolower(l.settings:multiprod:customfield_values:customfields:product_flag)" />
                  
                  <span class="&mvt:multiprod:flag;">&mvt:multiprod:customfield_values:customfields:product_flag;</span>
                  </mvt:if>
                  This just does not work.

                  ​​​​​​&mvt:multiprod:customfield_values:customfiel ds:product_flag;

                  When I check the tokens it's empty (well duh).

                  This just displays flag--
                  &mvt:multiprod:flag;

                  Leslie Kirk
                  Miva Certified Developer
                  Miva Merchant Specialist since 1997
                  Previously of Webs Your Way
                  (aka Leslie Nord leslienord)

                  Email me: [email protected]
                  www.lesliekirk.com

                  Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                  Comment


                    #10
                    Originally posted by Leanne View Post
                    So since you’ve already called the prod_flag custom field using Read_Product_Code, and you say that is successfully appending the custom field value to the flag— class, could you not just use &mvt:multiprod:prod_flag; to output it inside the span?

                    (Be kind if I’m missing something obvious, I’m still on my first cup of coffee…)
                    It was worth a try. I did but it didn't output anything.

                    I also went back an looked at the token

                    ​​​​​​ &mvt:multiprod:flag; value is flag--

                    BUT

                    ​​​​​​&mvt:product:flag; value is flag--sale. (which is also what the Multi should be

                    I think I've gotten stuff really crossed up after too many tries....
                    Leslie Kirk
                    Miva Certified Developer
                    Miva Merchant Specialist since 1997
                    Previously of Webs Your Way
                    (aka Leslie Nord leslienord)

                    Email me: [email protected]
                    www.lesliekirk.com

                    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                    Comment


                      #11
                      Another FWIW - this Multiadd is super custom. After digging even deeper I've discovered that the ability to assign the products is done via a Custom Product field. It makes me wonder if what would appear (to me) to be this custom field within a custom field (and might even be even another layer deeper).
                      Leslie Kirk
                      Miva Certified Developer
                      Miva Merchant Specialist since 1997
                      Previously of Webs Your Way
                      (aka Leslie Nord leslienord)

                      Email me: [email protected]
                      www.lesliekirk.com

                      Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                      Comment


                        #12
                        OMG - I got it to work. Just for giggles here's what I did:


                        Code:
                        <mvt:item name="customfields" param="Read_Product_Code(l.settings:multiprod:code , 'product_flag', l.settings:prodflag)" />
                        <mvt:if expr="l.settings:prodflag NE 'none'">
                        <mvt:assign name="l.settings:multiprod:flag" value="'flag--' $ tolower(l.settings:prodflag)" />
                        <span class="&mvt:multiprod:flag; &mvt:prodflag; inline-block">&mvt:prodflag;</span>
                        </mvt:if>
                        Leslie Kirk
                        Miva Certified Developer
                        Miva Merchant Specialist since 1997
                        Previously of Webs Your Way
                        (aka Leslie Nord leslienord)

                        Email me: [email protected]
                        www.lesliekirk.com

                        Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                        Comment


                          #13
                          Yay for getting it working!

                          Comment

                          Working...
                          X