Announcement

Collapse
No announcement yet.

Hiding Products in Category on PLST

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

    Hiding Products in Category on PLST

    I am using the Base ReadyThemes framework. On the PLST page, I want to hide all products in a certain category. The problem is that the product gets hidden, but leaves a blank space where it should be in the layout. Any suggestions?

    Thanks,
    Shannon

    #2
    Re: Hiding Products in Category on PLST

    This is the old way of hiding a product that I was using in the MMUI PLST... but it doesn't work with the new CSSUI PLST layout.

    <mvt:if expr="NOT('A-' CIN l.settings:product:code)">
    Display all products except those starting with "A-"
    </mvt:if>

    Comment


      #3
      Re: Hiding Products in Category on PLST

      I think the missing image is not displaying because you do not have an image type assigned to the product.
      Try this...

      <mvt:if expr=" 'A-' CIN l.settings:product:code ">
      (if the product code contains A-)
      <mvt:foreachcontinue/>
      (skip the rest of the current foreach iteration)
      </mvt:if>

      I hope this helps
      Happie Mendenhall
      Support Technician
      Miva, Inc.

      Comment


        #4
        Re: Hiding Products in Category on PLST

        All the images are assigned as "main" image and they show up just fine in the PLST. But I am trying to exclude a whole category of $0.00 "products" from showing up in this list. All the products in this category start with "A-". I tried the code you provided within the foreach loop for product display, and it does hide the products from the list, but still is leaving blank spaces where the product that is skipped should be in the layout. This is the same thing that occurs even if I don't use the <mvt:foreachcontinue>.

        Here is what I tried...
        <mvt:foreach iterator="product" array="all_products:products">
        <mvt:if expr=" 'A-' CIN l.settings:product:code ">
        <mvt:foreachcontinue/>
        </mvt:if>
        <div class="col-md-3 col-sm-4 col-xs-6">
        ...rest of foreachloop...
        </mvt:foreach>

        If I move the </mvt:if> down to just above the </mvt:foreach>, then all of the products are hidden.


        Thanks,
        Shannon

        Comment


          #5
          Re: Hiding Products in Category on PLST

          URLs to the example page ALWAYS (ok, almost always) help. Otherwise, just guessing. Also, posting the whole code snippet will get you answers faster.

          I'm going to guess (actually, quite sure, just can't be specific) that you have some HTML formatting between

          <foreach>

          and

          <cat conditional>

          or

          </cat conditional>

          and

          </foreach>
          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
            Re: Hiding Products in Category on PLST

            Originally posted by hmendenhall View Post
            I think the missing image is not displaying because you do not have an image type assigned to the product.
            Try this...

            <mvt:if expr=" 'A-' CIN l.settings:product:code ">
            (if the product code contains A-)
            <mvt:foreachcontinue/>
            (skip the rest of the current foreach iteration)
            </mvt:if>

            I hope this helps
            So the original code you had will also work but the if statement needs to end further down the page.
            I copied all of the code from my PLST page and bolded in red where the conditional should start and end.


            Product List Layout

            <mvt:foreach iterator="product" array="all_products:products">
            <mvt:if expr="NOT('A-' CIN l.settings:product:code)">




            <div class="col-md-3 col-sm-4 col-xs-6">
            <div class="category-item">
            <div class="item-image">
            <mvt:if expr="NOT ISNULL l.settings:product:imagetypes:main">
            <a href="&mvte:product:link;"><img src="&mvte:product:imagetypes:main;" alt="&mvte:product:name;" class="img-responsive" /></a>
            <mvt:else>
            <a href="&mvte:product:link;">&nbsp;</a>
            </mvt:if>
            </div>
            <div class="item-details">
            <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields :highlightTag">
            <h5><a href="&mvte:product:link;">&mvt:product:name;</a><span class="ico"><img src="graphics/00000001/images/&mvt:product:customfield_values:customfields:highl ightTag;.png" alt="&mvt:product:customfield_values:customfields: highlightTag;" /></span></h5>
            <mvt:else>
            <h5><a href="&mvte:product:link;">&mvt:product:name;</a></h5>
            </mvt:if>
            <div class="clearfix"></div>
            <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields :shortDescription">
            <p>&mvt:product:customfield_values:customfields:sh ortDescription;</p>
            </mvt:if>
            <div class="item-price">&mvt:product:formatted_price;</div>
            <div class="button"><a href="&mvte:product:link;">More Info</a></div>
            <div class="clearfix"></div>
            </div>
            </div>
            </div>
            </mvt:if>
            </mvt:foreach>

            I made two test products with the product codes that start with A- and now they are no longer present on the PLST
            This should have you squared away :)
            Last edited by hmendenhall; 11-21-14, 02:05 PM.
            Happie Mendenhall
            Support Technician
            Miva, Inc.

            Comment


              #7
              Re: Hiding Products in Category on PLST

              Thanks for everyone's help and quick replies.

              So, I copied the code supplied above directly and applied it to my PLST Product List Layout. The same problem still exists. Yes the products with codes containing "A-" are hidden, but there is a blank space in their place.

              Here is a direct link to my dev site page:
              http://dev.essense-of-life.com/mm5/m...t=24&Offset=24

              The page is set to display 16 products, and does w/the default frameworks readythemes base code. But when adding the code that excludes product codes beginning w/"A-", page 1 displays only 3 products, and each page after that displays between 4-7 products with blank space where additional products should display.

              Any thoughts?

              Thanks,
              Shannon

              Comment


                #8
                Re: Hiding Products in Category on PLST

                Well, one of the problems you are going to have with this approach is that the Pagination display control works on a separate count. So if you use a conditional to suppress the display, its still going to go against the page per count.

                Question is, why use this approch. A "Show All Product List" is rather pointless IMO, customers should rely on categories or search.
                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


                  #9
                  Re: Hiding Products in Category on PLST

                  Okay I went ahead and turned off pagination and products per page, so now all the products display on 1 page, but there are no "gaps" where the hidden products were left out. This is ultimately what I wanted.

                  As to the question about why even use the PLST page, it actually goes back to the top ReadyThemes navigation/navbar area. I created a dropdown called "All Products" which listed all my product categories. But I found that the css for the dropdown isn't configured correctly if the top "parent" navigation item isn't linked. I can't track down what in the css styles controls this, so after wasting much time on that, I just decided to link to the PLST page.

                  Comment

                  Working...
                  X