Announcement

Collapse
No announcement yet.

disable quickview for specific categories

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

  • disable quickview for specific categories


    I have 2 categories that I do not want to use the quickview. They are 1) ELECTRIC GUITARS & 2)ACOUSTIC GUITARS.
    If I use this code for each category individually on the CTGY page, it works.

    FOR ELECTRIC GUITARS:
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( g.Category_Code, l.settings:current_category )" />
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_ID( l.settings:current_category:parent_id, l.settings:parent_category )" />

    <mvt:if expr="l.settings:parent_category:name NE 'Electric Guitars'">
    <mvt:if expr="l.settings:seo_settings:sl_active">
    <span class="button button-square bg-yellow white uppercase quick-view" data-product-link="&mvte:product:link;?show=quickview"><font size="-1">Quick View</font></span>
    <mvt:else>
    <span class="button button-square bg-yellow white uppercase quick-view" data-product-link="&mvte:product:link;?show=quickview"><font size="-1">Quick View</font></span>

    </mvt:if>
    </mvt:if>

    FOR ACOUSTIC GUITARS:
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( g.Category_Code, l.settings:current_category )" />
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_ID( l.settings:current_category:parent_id, l.settings:parent_category )" />

    <mvt:if expr="l.settings:parent_category:name NE 'Acoustic Guitars'">
    <mvt:if expr="l.settings:seo_settings:sl_active">
    <span class="button button-square bg-yellow white uppercase quick-view" data-product-link="&mvte:product:link;?show=quickview"><font size="-1">Quick View</font></span>
    <mvt:else>
    <span class="button button-square bg-yellow white uppercase quick-view" data-product-link="&mvte:product:link;?show=quickview"><font size="-1">Quick View</font></span>

    </mvt:if>
    </mvt:if>

    However, if I want to make one statement this does not work:

    FOR ELECTRIC GUITARS & ACOUSTIC GUITARS:
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( g.Category_Code, l.settings:current_category )" />
    <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_ID( l.settings:current_category:parent_id, l.settings:parent_category )" />

    <mvt:if expr="l.settings:parent_category:name NE 'Electric Guitars' OR l.settings:parent_category:name NE 'Acoustic Guitars'">
    <mvt:if expr="l.settings:seo_settings:sl_active">
    <span class="button button-square bg-yellow white uppercase quick-view" data-product-link="&mvte:product:link;?show=quickview"><font size="-1">Quick View</font></span>
    <mvt:else>
    <span class="button button-square bg-yellow white uppercase quick-view" data-product-link="&mvte:product:link;?show=quickview"><font size="-1">Quick View</font></span>

    </mvt:if>
    </mvt:if>

    BTW I know this happens twice on the CTGY page.

    So, is there a way to make this work with one statement?


  • Looking at the code, I don't see anything that should prevent it from working. Any reason you are checking the category name and not the code? If this code is to check for those two specific categories, why are you checking the parent category and not the current category?
    Matt Zimmermann
    Director of UI/UX Standards and Theme Development
    / Miva, Inc.

    Comment


    • Thanks Matt.

      Taking your advice, I used the category code:
      <mvt:if expr="l.settings:parent_category:code NE 'CORTACOUSTIC' OR l.settings:parent_category:code NE 'CORTELECTRIC'">

      However, no luck when using the OR in the statement. Both work fine individually.
      I am using the parent because both of the categories belong to a parent category as well as others that I also want to include.

      Comment


      • This might be a case where AND will work instead of OR. Alternately, you could try <mvt:if expr="NOT (l.settings:parent_category:code CIN 'CORTACOUSTIC,CORTELECTRIC'">
        Matt Zimmermann
        Director of UI/UX Standards and Theme Development
        / Miva, Inc.

        Comment


        • Also, that inside <mvt:if> seems unnecessary as they both resolve to the same page html code.

          <mvt:if expr="NOT(l.settings:category:code EQ 'electric_guitars') OR NOT(l.settings:category:code EQ 'acoustic_guitars')">

          <span class="button button-square bg-yellow white uppercase quick-view" data-product-link="&mvte:product:link;?show=quickview"><font size="-1">Quick View</font></span>

          </mvt:if>

          Should suffice (if you put in the correct actual category codes).
          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


          • Thanks Matt & Bruce.

            WORKED
            <mvt:if expr="l.settings:parent_category:code NE 'CORTELECTRIC' AND l.settings:parent_category:code NE 'CORTACOUSTIC'">

            DID NOT WORK
            <mvt:if expr="NOT(l.settings:category:code EQ 'CORTELECTRIC') OR NOT(l.settings:category:code EQ 'CORTACOUSTIC')">

            Comment


            • ...should have mentioned I have no exact idea of the correct variable cause it depends on where that code chunk is running. :)
              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



              • Actually in the above code, CORTELECTRIC & CORTACOUSTIC are the correct values. For some reason it doesn't work. Could be what Matt said about the OR not functioning on this for some reason.


                BTW This also worked
                <mvt:if expr="NOT (l.settings:parent_category:code CIN 'CORTACOUSTIC,CORTELECTRIC')">

                Comment


                • hmmm...all three should have worked with the correct values.
                  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

                  Working...
                  X

                  This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

                  This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

                  Accept