Announcement

Collapse
No announcement yet.

Custom Fields only working on Certian Pages

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

    Custom Fields only working on Certian Pages

    I have created a custom product field called fullPrice to allow me to show a saving on certain products ie. £new discount price was £fullPrice.

    On the Product page I have used the code;

    Code:
    <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:FullPrice">
     was £<s>&mvt:product:customfield_values:customfields:FullPrice;</s>
    </mvt:if>
    which has pulled the old full price in fine which you can see an example of on my site here : http://www.grangewoodfencing.com/mm5...ry_Code=CLOSEB

    However when I insert the same code into the Category page (CTGY) the old full price does not display.


    Any ideas what I am doing wrong?
    Last edited by grangewood; 12-01-14, 05:09 AM.

    #2
    Re: Custom Fields only working on Certian Pages

    The syntax of how you are pulling the custom field value requires the custom field to first be assigned to the page. (This is the legacy way of using custom fields, however it should still work)

    Go to CTGY, then Product List Layout, and under the custom field section make sure any custom fields you wish to display are assigned.

    If your interested, the "new" way of using custom field does not require them to be assigned to the page and they can be used on any page.

    Here is what it would look like:

    Code:
    <mvt:item name="customfields" param="Read_Product_Code(l.settings:product:code, 'FullPrice', g.FullPrice)" />
    &mvt:global:FullPrice;
    Here are some references videos as well (See the custom fields section):
    http://www.miva.com/videos/category/...raining-series
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Custom Fields only working on Certian Pages

      Thanks for your help.

      I had already assigned the custom filed as you have suggested but it still does not display.

      How do I modify my existing code to utilise the new code that you suggested?

      Comment


        #4
        Re: Custom Fields only working on Certian Pages

        Originally posted by grangewood View Post
        Thanks for your help.

        I had already assigned the custom filed as you have suggested but it still does not display.

        How do I modify my existing code to utilise the new code that you suggested?
        Could you send a code snippet so I can see your code??
        Happie Mendenhall
        Support Technician
        Miva, Inc.

        Comment


          #5
          Re: Custom Fields only working on Certian Pages

          Pardon the interruption but...

          How would you use the new method in a CONDITIONAL statement.

          Using grangewood's example, could you use it with an if statement to only call the field if it was not null???

          Thanks in advance and sorry for the interruption.
          Mark Romero
          ~~~~~~~~

          Comment


            #6
            Re: Custom Fields only working on Certian Pages

            Yes you can check to see if its value in null (or not null)

            Code:
            <mvt:if expr="NOT ISNULL g.FullPrice">
               // There is a value
            </mvt:if>
            Brennan Heyde
            VP Product
            Miva, Inc.
            [email protected]
            https://www.miva.com

            Comment


              #7
              Re: Custom Fields only working on Certian Pages

              I am currently using the following conditional code (which works fine on the Product Display page but not on the Category page);

              Code:
              <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:FullPrice">
               was £<s>&mvt:product:customfield_values:customfields:FullPrice;</s>
              </mvt:if>
              I have checked that the Custom Field is assigned correctly on the CTGY page (which it is) but the code will still not render. Super Moderator Brennan suggested that I try the 'new' way of using custom fields to see if this would help. He supplied the following code snippet but I wasn't sure how to combine it with my existing code;

              Code:
              <mvt:item name="customfields" param="Read_Product_Code(l.settings:product:code, 'FullPrice', g.FullPrice)" />
              &mvt:global:FullPrice;
              Many thanks for your assistance with this.
              Last edited by grangewood; 12-03-14, 12:53 AM.

              Comment


                #8
                Re: Custom Fields only working on Certian Pages

                Code:
                <mvt:item name="customfields" param="Read_Product_Code(l.settings:product:code, 'FullPrice', g.FullPrice)" />
                
                <mvt:if expr="NOT ISNULL g.FullPrice">
                 was £<s>&mvt:global:FullPrice;</s>
                </mvt:if>

                Comment

                Working...
                X