Announcement

Collapse
No announcement yet.

NTFD - error_message_count

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

    NTFD - error_message_count

    I have 2 different sites using Levels where the error messages array doesn't seem to be working on NTFD. <mvt:if expr="l.settings:messages:error_message_count EQ 0"> Is always 0, so the default message is always displayed. Even if I change the expression to NE 0, the messages array is empty. The messages item is assigned to the page.

    I have another site using Devino and the error messages work as expected. So I copied the NTFD page template from Devino to Levels and made sure the exact same page items are assigned to the sites using Levels. The messages still don't work. The only difference I can think of between the 3 sites is that the 2 Levels sites where the error messages don't work are using URI Management. The Devino site is using Legacy SEO.

    Is there any reason why this works with Legacy SEO settings but not URI Management? That's the only difference I can find...

    Code:
    <mvt:if expr="l.settings:messages:error_message_count EQ 0">
                    <p class="message message-warning">The item you requested is not available at this time.</p>
                <mvt:else>
                    <mvt:foreach iterator="message" array="messages:error_messages">
                        <mvt:if expr="'page' CIN l.settings:message">
                            <p class="message message-warning">We're sorry but it appears that the "&mvte:global:Screen;" page is not available at this time.</p>
                            <p>Please <mvt:item name="cssui_links" param="screen:SFNT">click here</mvt:item> to return to our home page.</p>
                        <mvt:elseif expr="'category' CIN l.settings:message">
                            <p class="message message-warning">We're sorry but it appears that the "&mvte:global:Category_Code;" category is not available at this time.</p>
                            <p>Please <mvt:item name="cssui_links" param="screen:SFNT">click here</mvt:item> to return to our home page.</p>
                        <mvt:elseif expr="'product' CIN l.settings:message">
                            <p class="message message-warning">We're sorry but it appears that product "&mvte:global:Product_Code;" is not available at this time.</p>
                            <p>Please perform a Search to find a similar product.</p>
                            <form method="post" action="&mvte:urls:SRCH:rr;" class="whole medium-one-third">
                                <div class="form-row">
                                    <label for="l-ntfd-search">Search For:</label>
                                    <input type="search" name="Search" value="&mvte:global:Product_Code;" id="l-ntfd-search" />
                                </div>
                                <div class="form-row align-right">
                                    <mvt:item name="buttons" param="Search" />
                                </div>
                            </form>
                            <br class="clear" />
                        <mvt:else>
                            <p class="message message-warning">&mvte:message;</p>
                        </mvt:if>
                    </mvt:foreach>
                </mvt:if>
    Ron Frigon
    Jedi Webmaster Obi-Ron Kenobi

    #2
    Hi Ron,

    To the best of my knowledge, URI Management should have no impact on the error messages. On our newer ReadyThemes, we have removed most of this code and reduced it to the following:
    Code:
                <mvt:if expr="l.settings:messages:error_message_count EQ 0">
                    <p class="message message--warning">The item you requested is not available at this time.</p>
                <mvt:else>
                    <p class="message message--warning">
                        <mvt:foreach iterator="error" array="messages:error_messages">
                            &mvte:error;<br />
                        </mvt:foreach>
                    </p>
                </mvt:if>
    Matt Zimmermann

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment


      #3
      Thanks Matt, I did some testing on some of the Demo stores and I was only able to trigger the default "The item you requested is not available at this time." message. They also seem to be using URI Management.

      Using the code above works as expected on my Devino site using Legacy SEO. I get error messages for Page, Category, Product etc. But the sites using Levels and URI Management only return the default item you requested message.

      Ron Frigon
      Jedi Webmaster Obi-Ron Kenobi

      Comment


        #4
        confirm, the array is blank when URI is activated. Tested on a couple stores.Looks like Ron found a bug.
        Andreas Toman
        PCINET, LLC

        Miva Merchant Design, Development, Integration & Support
        We built over 200 Miva Merchant stores!
        Miva shopping cart design & integration service and see our Portfolio!


        e-mail: [email protected]
        web: www.pcinet.com
        LinkedIn: Andreas Toman
        phone: (786) 250-2056 (Miami, FL)

        Comment


          #5
          Hi Ron

          How are you triggering these errors? I am trying to reproduce this issue in my store.

          Thanks

          -Eric
          Eric Foresman
          Software Tester
          Miva Merchant
          http://www.mivamerchant.com/
          [email protected]

          Comment


            #6
            How are you triggering these errors? I am trying to reproduce this issue in my store.
            Visit a Product or Category page. Edit the Product or Category Code in the address bar to break it.
            Ron Frigon
            Jedi Webmaster Obi-Ron Kenobi

            Comment


              #7
              Hi Ron

              With URI management, when you try to modify the product code in the URL bar you are just modifying the URI, making it point to a different URI. One that does not exist and there for give you the default not found error.

              Without it being a valid URI the system has no idea what kind of page you were looking for, it can’t tell you that the category does not exist because it doesn’t know that you were looking for a category page.

              You can test this by enabling URI management and then going to a product/category that does not have a URI generated for it. this will force the system to use Long URLs instead of a URI and then modify the product/category code to something that doesn’t exist. You should get the error you are expecting event though URI management is turned on.

              Hope this helps
              -Eric
              Eric Foresman
              Software Tester
              Miva Merchant
              http://www.mivamerchant.com/
              [email protected]

              Comment

              Working...
              X