Announcement

Collapse
No announcement yet.

How do I Call Custom fields For Categories or Products?

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

    How do I Call Custom fields For Categories or Products?

    Hi all:

    Is there a way to call category and product custom fields natively in MM9?

    I had been using toolkt to call them using the toolkit.

    while it still works, I would like to switch to native miva merchant functionality wherever possible.

    So if I have a custom field with the code of:

    CAT_NEW_TITLE

    How would I call it on the category page?

    thanks in advance.
    Mark Romero
    ~~~~~~~~

    #2
    Re: How do I Call Custom fields For Categories or Products?

    Here is the custom field reference guide for the new method: https://docs.miva.com/template-langu...-documentation

    This works for 5.5 and M9.
    Last edited by sartaingerous; 01-14-19, 01:41 PM.

    Comment


      #3
      Re: How do I Call Custom fields For Categories or Products?

      Hi Mark,

      You could do the following

      Code:
      <mvt:item name="customfields" param="Read_Category_Code( g.Category_Code, 'CAT_NEW_TITLE' )" />
      The custom field value is &mvte:customfields;
      Also here is more information on Custom Fields
      David Carver
      Miva, Inc. | Software Developer

      Comment


        #4
        Re: How do I Call Custom fields For Categories or Products?

        Thank you both, Dan and David.

        So basically to summarize:

        1) first, one has to READ the custom field using an mvt item and a read parameter, and then

        2) they have to DISPLAY the field value using an &mvte

        Is that correct?

        Thanks in advance.
        Mark Romero
        ~~~~~~~~

        Comment


          #5
          Re: How do I Call Custom fields For Categories or Products?

          Yes that is correct. There are also some good videos walking though how to use these custom field functions. See the Custom Fields section on this page:

          https://docs.miva.com/dts/developer-training-series
          Last edited by sartaingerous; 01-14-19, 01:41 PM.
          Brennan Heyde
          VP Product
          Miva, Inc.
          [email protected]
          https://www.miva.com

          Comment


            #6
            Re: How do I Call Custom fields For Categories or Products?

            Thanks for the link to the DTS videos, Brennan.

            it sure answers a lot of questions.

            Thanks again.
            Mark Romero
            ~~~~~~~~

            Comment


              #7
              Re: How do I Call Custom fields For Categories or Products?

              When I try this, it prints my code to the page. I'm trying to display a Pinterest button. It prints the coding to the page, instead of displaying my button.

              See http://dev.paulamontgomery.com/produ..._Necklace.html (the Pinterest button that is showing currently, is from Toolkit)

              Can anyone help?
              Thanks!

              Code:
              <mvt:item name="customfields" param="Read_Product_Code( g.Product_Code, 'pinterest' )" />
              &mvte:customfields;
              Trent Studios, LLC
              Graphic Design, Website Design
              TrentStudios.com
              (970) 568-8652

              Comment


                #8
                Re: How do I Call Custom fields For Categories or Products?

                It is because the output is being encoded since you are using &mvte: vs &mvt:

                See here:

                https://docs.miva.com/videos/output-encoding
                Last edited by sartaingerous; 01-14-19, 01:42 PM.
                Brennan Heyde
                VP Product
                Miva, Inc.
                [email protected]
                https://www.miva.com

                Comment


                  #9
                  Re: How do I Call Custom fields For Categories or Products?

                  Thanks, Brennan!
                  Trent Studios, LLC
                  Graphic Design, Website Design
                  TrentStudios.com
                  (970) 568-8652

                  Comment


                    #10
                    Re: How do I Call Custom fields For Categories or Products?

                    In the video for Custom Field Functions, it says the same coding could be used anywhere. I put it on my CTGY page template, but it doesn't work.

                    This is working, however:

                    Code:
                    &mvt:product:customfield_values:customfields:pinterest;
                    Last edited by cway; 03-06-15, 11:16 AM. Reason: Solution found
                    Trent Studios, LLC
                    Graphic Design, Website Design
                    TrentStudios.com
                    (970) 568-8652

                    Comment


                      #11
                      Re: How do I Call Custom fields For Categories or Products?

                      Originally posted by dcarver View Post
                      Hi Mark,

                      You could do the following

                      Code:
                      <mvt:item name="customfields" param="Read_Category_Code( g.Category_Code, 'CAT_NEW_TITLE' )" />
                      The custom field value is &mvte:customfields;
                      Also here is more information on Custom Fields
                      Color me confused. I'm trying to pull in a custom category code into the subcategory_listing field - I've tried a couple different variations but nothing is working.
                      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
                        Re: How do I Call Custom fields For Categories or Products?

                        Try:

                        <mvt:item name="customfields" param="Read_Category_Code( l.settings:category_code, 'custom_field_code', l.settings:customfields )" />

                        where

                        l.settings:category_code is a LOCAL variable of the current sub cat. (assuming you might be still looking for the global, which could still be the parent cat.
                        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


                          #13
                          Re: How do I Call Custom fields For Categories or Products?

                          Thanks Bruce, I wound up going old school.

                          Code:
                          <mvt:item name="toolkit" param="customcategory|cust1|l.all_settings:sub_category:id|catadd1" />
                          <h4>&mvte:global:cust1;</h4>
                          Guess I'll have to retake the class...
                          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


                            #14
                            Re: How do I Call Custom fields For Categories or Products?

                            I too have been struggling with this for several hours. I have setup a category custom field called "mobile_cat_image" for an image upload.

                            I have uploaded an image to the custom field in a category and assigned the 'Store' item to the page. (It happens to be the Mobile Category Tree Page)

                            I have tried many variations - too many to list or remember but this is my latest:

                            Code:
                            <mvt:item name="customfields" param="Read_Category_Code( g.Category_Code, 'mobile_cat_image', g.mobile_cat_image )" />
                            <img src="&mvte:global:mobile_cat_image;">

                            Comment


                              #15
                              Re: How do I Call Custom fields For Categories or Products?

                              That code looks correct. Where are you use it on. The Category page or Product page? You need to make sure g.Category_Code is available on the page.
                              Brennan Heyde
                              VP Product
                              Miva, Inc.
                              [email protected]
                              https://www.miva.com

                              Comment

                              Working...
                              X