Announcement

Collapse
No announcement yet.

Miva 10 upgrade from 9 and toolkit

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

    Miva 10 upgrade from 9 and toolkit

    In the past we used Bill's Toolkit to array the subcategories into a list

    Now the code can not pull the subcategory URL.

    What does appear is the Image, Sub Cat Name and custom Category Field.

    What will no longer work is the URL. None of the tokens seem to work.

    the original went

    <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="sub_categories">
    <tbody>
    <tr><td headers="Name"><a href="https://&mvt:global:domain:name;/&mvt:sub_category:code;.html ">&mvt:sub_category:name; </a> <mvt:item name="toolkit" param="categorymeta|CODE|l.all_settings:sub_catego ry:code" /></td><td headers="Description"><mvt:item name="toolkit" param="customcategory|info|l.all_settings:sub_cate gory:id|catdescription" />&mvte:global:info;</br></td><td headers="Image"><mvt:item name="toolkit" param="catimage|bigimage|l.all_settings:sub_catego ry:code" /><a href="https://&mvt:global:domain:name;/&mvt:sub_category:code;.html "><mvt:if expr="bigimage"><img src="&mvte:global:bigimage;" alt="&mvt:sub_category:name;" border="0"></mvt:if></td></tr><mvt:if expr = "(pos1 MOD 1 ) EQ 0">
    </tr><tr>
    <td colspan="3"><hr></td>
    </tr>
    <tr>
    </mvt:if>

    </mvt:foreach>

    </tr>

    </table>
    </tbody>
    </table>
    <mvt:else>
    <mvt:item name="toolkit" param="subcat|ccount|g.Category_Code" />
    <mvt:if expr="ccount GT 0">
    <div><table width="90%" border="0" cellspacing="0" cellpadding="0">
    <tr>

    <mvt:foreach iterator="sub_category" array="sub_categories">

    <td align="center"><hr align="center" width="90%" size="1">
    <mvt:item name="toolkit" param="catimage|bigimage|l.all_settings:sub_catego ry:code" />
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="236" rowspan="2" align="left" valign="top"><a href="https://&mvt:global:domain:name;/&mvt:sub_category:code;.html "><mvt:if expr="bigimage"><img src="&mvte:global:bigimage;" alt="&mvt:sub_category:name;" border="0"></mvt:if>
    </a></td>
    <td colspan="2" align="left" valign="top"><a href="https://&mvt:global:domain:name;/&mvt:sub_category:code;.html ">&mvt:sub_category:name; </a> <mvt:item name="toolkit" param="categorymeta|CODE|l.all_settings:sub_catego ry:code" /></td>
    </tr>
    <tr>
    <td width="27" align="left" valign="top">&nbsp;</td>
    <td width="445" align="left" valign="top">
    <mvt:item name="toolkit" param="customcategory|info|l.all_settings:sub_cate gory:id|catdescription" />
    &mvte:global:info;</br></td>
    </tr>
    </table></td>

    <mvt:comment>After every 3 table cells, close the row and open a new one</mvt:comment>
    <mvt:if expr = "(pos1 MOD 1 ) EQ 0">
    </tr>
    <tr>
    </mvt:if>

    </mvt:foreach>

    </tr>

    </table><br><br></div>
    </mvt:if> </mvt:if>
    </div>

    <!-- end sub-category listings -->


    #2
    I am using Toolkit in a Miva 10 store to do this, and it's working for me. My code differs significantly from yours, but here's what I have. Perhaps you can use this to edit yours.

    Code:
    <mvt:item name="toolkit" param="parentcat|pccount" />
    <mvt:foreach iterator="parent_category" array="parent_categories">
    <mvt:if expr="l.settings:parent_category:code EQ g.Category_Code">
    <li class='lvl1 active'><a href="/shop/&mvte:parent_category:code;.html" title="&mvte:parent_category:name;">&mvte:parent_c ategory:name;</a>
    <mvt:else>
    <li class='lvl1'><a href="/shop/&mvte:parent_category:code;.html" title="&mvte:parent_category:name;">&mvte:parent_c ategory:name;</a>
    </mvt:if>
    <mvt:item name="toolkit" param="subcat|ccount|l.all_settings:parent_categor y:code" />
    <mvt:if expr="ccount GT 0">
    <ul class="sub-menu">
    <mvt:foreach iterator="sub_category" array="sub_categories">
    <mvt:if expr="l.settings:sub_category:code EQ g.Category_Code">
    <li class="lvl2 active"><a href="/shop/&mvte:sub_category:code;.html" title="&mvte:sub_category:name;">&mvte:sub_categor y:name;</a>
    <mvt:else>
    <li class="lvl2"><a href="/shop/&mvte:sub_category:code;.html" title="&mvte:sub_category:name;">&mvte:sub_categor y:name;</a>
    </mvt:if>
    
    <mvt:item name="toolkit" param="subcat2|ccount2|l.all_settings:sub_category :code" />
    <mvt:if expr="ccount2 GT 0">
    <ul>
    <mvt:foreach iterator="sub_category2" array="sub_categories2">
    <mvt:if expr="l.settings:sub_category2:code EQ g.Category_Code">
    
    <li class="lvl3 active"><a href="/shop/&mvte:sub_category2:code;.html" title="&mvte:sub_category2:name;">&mvte:sub_catego ry2:name;</a></li>
    <mvt:else>
    <li class="lvl3"><a href="/shop/&mvte:sub_category2:code;.html" title="&mvte:sub_category2:name;">&mvte:sub_catego ry2:name;</a></li>
    </mvt:if>
    </mvt:foreach>
    </ul>
    </mvt:if>
    </li>
    </mvt:foreach>
    </ul>
    </mvt:if>
    </li>
    </mvt:foreach>
    Todd Gibson
    Oliver + S | Sewing Patterns for Kids and the Whole Family

    Comment


      #3
      Thank you for the reply and your assistance.

      It seems to have the same results.

      Using &mvte:sub_category2:code; and &mvte:sub_category:code; only pulls the sub category code. If someone is using the built in URI settings these two codes will not work properly.

      none of these seems to work
      &mvt:category_children:link;
      &mvt:category_children:uri;
      &mvt:cattree_category:uri;
      &mvt:child:link:uri;

      Comment


        #4
        paypal ready to fix my above script

        Comment


          #5
          Originally posted by field View Post
          Thank you for the reply and your assistance.

          It seems to have the same results.

          Using &mvte:sub_category2:code; and &mvte:sub_category:code; only pulls the sub category code. If someone is using the built in URI settings these two codes will not work properly.

          none of these seems to work
          &mvt:category_children:link;
          &mvt:category_children:uri;
          &mvt:cattree_category:uri;
          &mvt:child:link:uri;
          I hate to ask the obvious but because this just happened to me - is your license for the Toolkit module still in place? I kept trying to get a snippet work and no matter what I did it wouldn't. It finally dawned on to check and see if it was still licensed. In my case, it was not. It might be a long shot for you to check it.

          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
            Originally posted by field View Post
            Thank you for the reply and your assistance.

            It seems to have the same results.

            Using &mvte:sub_category2:code; and &mvte:sub_category:code; only pulls the sub category code. If someone is using the built in URI settings these two codes will not work properly.

            none of these seems to work
            &mvt:category_children:link;
            &mvt:category_children:uri;
            &mvt:cattree_category:uri;
            &mvt:child:link:uri;
            As far as native coding goes take a look at this:

            Code:
             <mvt:foreach array="cattree_categories" iterator="category_children">
            <mvt:if expr="l.settings:category_children:parent_id EQ l.settings:category:id">
            <mvt:assign name="l.null" value="miva_array_insert(l.settings:subcategories, l.settings:category_children, -1)" />
            </mvt:if>
            </mvt:foreach>
            <mvt:assign name="l.settings:subcategory_count" value="miva_array_elements(l.settings:subcategorie s)" />
            
            <section class="o-layout u-grids-1 u-grids-3--l x-product-list" style="margin-top:16px;">
            <mvt:foreach iterator="subcategory" array="subcategories">
            <div class="o-layout__item u-text-center x-product-list__item">
            
            <figure class="x-product-list__figure">
            <mvt:if expr="l.settings:subcategory:image">
            <img class="x-product-list__image" src="&mvt:subcategory:image;" alt="&mvt:subcategory:name;">
            </mvt:if>
            
            <h2 style="text-align:left; font-size:1.2rem; font-weight:bold;"><a href="&mvt:category:link;#&mvt:subcategory:code;"> <span class="u-icon-chevron-right u-color-red"></span> &mvte:subcategory:name;</a></h2>
            
            
            <mvt:do name="l.result" file="g.Module_Library_DB" value="Category_Load_Code( l.settings:subcategory:code, l.settings:sub_subcategory )" />
            <mvt:do name="l.result" file="g.Module_Library_DB" value="CategoryList_Load_Parent( l.settings:sub_subcategory:id, l.settings:sub_subcategories )" />
            
            <mvt:if expr="l.settings:sub_subcategories">
            <mvt:foreach iterator="sub_subcategory" array="sub_subcategories">
            <figure class="x-product-list__figure" style="text-align:left;">
            <figcaption><a href="&mvt:category:link;#&mvt:sub_subcategory:cod e;"><span class="u-icon-chevron-right u-color-red"></span> &mvte:sub_subcategory:name;</a>
            </figcaption>
            </figure>
            
            
            </mvt:foreach>
            <mvt:assign name="l.settings:sub_subcategory" value="''"/>
            <mvt:assign name="l.settings:sub_subcategories" value="''"/>
            </mvt:if>
            </figure>
            
            </div>
            </mvt:foreach>
            </section>
            <section class="o-layout">
            <div class="o-layout__item">
            <mvt:item name="subcategory_listing" />
            </div>
            </section>
            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


              #7
              I must head out in In-Laws now

              error I got
              subcategory_listing is not in the list of items

              Comment


                #8
                Originally posted by lesliekirk View Post

                I hate to ask the obvious but because this just happened to me - is your license for the Toolkit module still in place? I kept trying to get a snippet work and no matter what I did it wouldn't. It finally dawned on to check and see if it was still licensed. In my case, it was not. It might be a long shot for you to check it.
                everything works for tool kit. Except of sub cat links <a></a>

                Comment


                  #9
                  [QUOTE=lesliekirk;n715619]


                  Leslie. I was able to figure this out this morning. It was actually very very simple. You might laugh

                  Export All Categories to Flat File.

                  Export Category Code and Canonical URI fields

                  Create a Custom Field for Category

                  upload the Canonical URI to the custom field.

                  Using the Toolkit recall the Canonical URI custom field as the category link.

                  ;-)
                  Last edited by field; 11-28-21, 04:51 AM.

                  Comment


                    #10
                    Originally posted by field View Post
                    Originally posted by lesliekirk View Post


                    Leslie. I was able to figure this out this morning. It was actually very very simple. You might laugh

                    Export All Categories to Flat File.

                    Export Category Code and Canonical URI fields

                    Create a Custom Field for Category

                    upload the Canonical URI to the custom field.

                    Using the Toolkit recall the Canonical URI custom field as the category link.

                    ;-)
                    As long as it's fixed, that is all that matters. Good job!
                    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

                    Working...
                    X