Announcement

Collapse
No announcement yet.

Subcats are duplicated

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

    Subcats are duplicated

    I'm trying to figure out why the subcategories are duplicated http://www.neptunediving-ski.com/RGM.html This seems to be a problem with every category that has subcategories. This is the code that is in place:

    Code:
    <mvt:foreach array="cattree_categories" iterator="cattree_category">
        <mvt:if expr="l.settings:cattree_category:parent_id EQ l.settings:category:id">
            <mvt:assign name="l.null" value="miva_array_insert(l.settings:subcats, l.settings:cattree_category, -1)" />
        </mvt:if>
    </mvt:foreach>
    <mvt:assign name="l.settings:subcat_count" value="miva_array_elements(l.settings:subcats)" />
    <mvt:if expr="l.settings:subcats GT 0">
        <div class="row bg-white main-content-row sub-category-layout">
            <mvt:foreach iterator="sub_category" array="subcats">
                <mvt:comment><!-- Load First Product From Sub Category & It's resized Main image --></mvt:comment>
                    <mvt:if expr="ISNULL l.settings:sub_category:image AND ISNULL l.settings:category:cf:category_hide_sub_category_images">
                        <mvt:do file="g.Module_Library_DB" name="l.result" value="Runtime_ProductList_Load_Offset_Category( l.settings:sub_category:id, 1, 1, l.settings:sub_category:sub_products:next_offset, l.settings:sub_category:sub_products:list )" />
                        <mvt:assign name="l.settings:sub_category:product" value="l.settings:sub_category:sub_products:list[1]" />
                        <mvt:do file="g.Module_Library_DB" name="l.settings:sub_category:product:image_count" value="ProductImageDataList_Load_Product(l.settings:sub_category:product:id, l.settings:sub_category:product:images)" />
                        <mvt:foreach iterator="image" array="sub_category:product:images">
                            <mvt:if expr="l.settings:image:imagetype:code EQ 'main'">
                                <mvt:assign name="l.settings:sub_category:product:main_image" value="l.settings:image" />
                                <mvt:foreachstop/>
                            </mvt:if>
                        </mvt:foreach>
                        <mvt:if expr="l.settings:sub_category:product:main_image:image:id">
                            <mvt:do file="g.Module_Library_DB" name="l.result" value="GeneratedImage_FindOrInsert_Image_Dimensions( l.settings:sub_category:product:main_image:image, '300', '200', l.settings:sub_category:product:main_image:generated )" />
                        </mvt:if>
                        <mvt:if expr="l.settings:sub_category:product:main_image:generated:id">
                            <mvt:assign name="l.settings:sub_category:image" value="l.settings:sub_category:product:main_image:generated:image" />
                        </mvt:if>
                    </mvt:if>
    
                <div class="column half medium-one-third sub-category category-product uppercase">
                    <a href="&mvt:sub_category:link;" title="&mvt:sub_category:name;">
                        <mvt:if expr="l.settings:sub_category:image AND ISNULL l.settings:category:cf:category_hide_sub_category_images">
                            <img src="&mvt:sub_category:image;" alt="&mvt:sub_category:name;" title="&mvt:sub_category:name;" />
    
                        </mvt:if>
    &mvt:sub_category:name;
                    </a>
                </div>
            </mvt:foreach>
        </div><!-- end sub-category listings -->
    </mvt:if>
    I have also tried this code:

    Code:
    <mvt:foreach array="cattree_categories" iterator="cattree_category">
        <mvt:if expr="l.settings:cattree_category:parent_id EQ l.settings:category:id">
            <mvt:assign name="l.null" value="miva_array_insert(l.settings:subcats, l.settings:cattree_category, -1)" />
        </mvt:if>
    </mvt:foreach>
    <mvt:assign name="l.settings:subcat_count" value="miva_array_elements(l.settings:subcats)" />
    <mvt:if expr="l.settings:subcats GT 0">
        <div class="row bg-white bottom-shadow main-content-row sub-category-layout">
            <mvt:foreach iterator="sub_category" array="subcats">
                <mvt:if expr="l.settings:sub_category:image">
                <div class="column half medium-one-third sub-category uppercase">
                        <a href="&mvt:sub_category:link;" title="&mvt:sub_category:name;">
                            <img src="&mvt:sub_category:image;" alt="&mvt:sub_category:name;" title="&mvt:sub_category:name;" />
                            &mvt:sub_category:name;
                        </a>
                    </div>
                <mvt:else>
                <div class="column half medium-one-third sub-category uppercase">
                        <a href="&mvt:sub_category:link;" title="&mvt:sub_category:name;" class="bold">&mvt:sub_category:name;</a>
                    </div>
                </mvt:if>
            </mvt:foreach>
        </div>
        <!-- end sub-category listings -->
    </mvt:if>
    Oddly, the first code snippet works perfectly in the dev site. The live site layout is a framework of the dev site. What the heck is going on?
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    #2
    Hi Leslie,

    Do you have a duplicate call to the subcategory item, like one in the page and one in the product layout?
    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
      Originally posted by Matt Zimmermann View Post
      Hi Leslie,

      Do you have a duplicate call to the subcategory item, like one in the page and one in the product layout?
      None that I can see. The code in the dev site is the same as the live site - it was exported as a framework. I did copy and paste the Content (subcategory_listing) from the dev site to the live site to make sure it was the same (before I made the post) but the results remain the same.
      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

      Comment


        #4
        Hi Leslie,

        Nothing looks erroneous with the code you posted. If the page code is stock, then I'm not sure what could be causing the duplication.
        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
          Do I need to open a support ticket?
          Leslie Kirk
          Miva Certified Developer
          Miva Merchant Specialist since 1997
          Previously of Webs Your Way
          (aka Leslie Nord leslienord)

          Email me: [email protected]
          www.lesliekirk.com

          Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

          Comment


            #6
            Probably wouldn't hurt.
            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

            Working...
            X