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?


    #2
    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

    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.

      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


        #4
        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

        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


          #5
          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


            #6
            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


              #7
              ...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


                #8

                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


                  #9
                  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