Announcement

Collapse
No announcement yet.

Another Failing Toolkit Function

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

    Another Failing Toolkit Function

    For the longest time, this worked perfectly (Copy and pasting here may make it look broken - I hate that):

    Code:
    <mvt:item name="toolkit" param="footsteps|fcount|9" />
    <mvt:if expr="g.fcount GT 0">
    <div class="row bottom-shadow product-carousel nm">
    <div class="column whole h3"><span class="uppercase">You Recently Viewed</span></div>
    <div id="js-footsteps-products-carousel" class="column whole float-none whats-popular-carousel">
    <mvt:foreach iterator="footstep" array="footsteps">
    <mvt:if expr="l.settings:product:customfield_values:custom fields:product_flag NE 'none'">
    <mvt:assign name="l.settings:product:flag" value="'flag--' $ tolower(l.settings:product:customfield_values:customfields:product_flag)" />
    </mvt:if>
    <div class="category-product">
    <a href="/&mvta:footstep:code;.html"><span class="flag flag--price" data-flag="$&mvt:footstep:price;">
    <mvt:item name="toolkit" param="customimage|ipath|l.all_settings:footstep:id|main|200|150|" />
    <mvt:if expr="g.ipath">
    <img src="graphics/00000001/loading.gif" data-src="&mvt:global:ipath;" alt="&mvt:footstep:name;" style="height:150px;" />
    <mvt:elseif expr="NOT ISNULL l.settings:footstep:thumbnail">
    <img src="graphics/00000001/loading.gif" data-src="&mvt:footstep:thumbnail;" alt="&mvt:footstep:name;" style="height:150px;" />
    <mvt:else>
    test: no image found
    </mvt:if></span>
    <span class="breaker"></span></a>
    <div class="revstars">
    <mvt:item name="productreviews" param="stars|footstep:id" />
    <mvt:if expr="g.ReviewStars"> &mvt:global:ReviewStars; <a class="openreviews" href="/&mvta:footstep:code;.html#reviewbox"><span style="font-weight:normal;">(&mvt:global:Total_Reviews;)</span></a></mvt:if>
    </div>
    </div>
    </mvt:foreach>
    
    </div>
    </div>
    </mvt:if><!-- end of footsteps -->
    Now it refuses to display the "main" image, period.

    Now what is interestingly odd, this code still works (again ignore any breaks that copy & paste may have caused):


    Code:
    <mvt:item name="toolkit" param="visitors|vcount|'9'|'prod'|1" />
    <mvt:if expr="g.vcount GT 0">
    <div class="row bottom-shadow product-carousel nm">
    <div class="column whole h3"><span class="uppercase">Shoppers Are Viewing</span></div>
    <div id="js-visitors-products-carousel" class="column whole float-none whats-popular-carousel">
    <mvt:foreach iterator="visitor" array="visitors">
    <mvt:if expr="('prod' CIN l.settings:visitor:screen) GT 0">
    <mvt:if expr="l.settings:product:customfield_values:custom fields:product_flag NE 'none'">
    <mvt:assign name="l.settings:product:flag" value="'flag--' $ tolower(l.settings:product:customfield_values:customfields:product_flag)" />
    </mvt:if>
    <div class="category-product">
    <a href="/&mvt:visitor:code;.html"><span class="flag flag--price" data-flag="$&mvt:visitor:price;">
    <mvt:item name="toolkit" param="customimage|ipath|l.all_settings:visitor:id |main|200|150|" />
    <mvt:if expr="g.ipath">
    <img src="graphics/00000001/loading.gif" data-src="&mvt:global:ipath;" alt="&mvt:visitor:name;-main" style="height:150px;" />
    <mvt:elseif expr="NOT ISNULL l.settings:visitor:thumbnail">
    <img src="graphics/00000001/loading.gif" data-src="&mvt:visitor:thumbnail;" alt="&mvt:visitor:name;-legacy" style="height:150px;" />
    <mvt:else>
    test: no image found
    </mvt:if></span><span class="breaker"></span></a>
    <div class="revstars">
    <mvt:item name="productreviews" param="stars|visitor:id" />
    <mvt:if expr="g.ReviewStars"> &mvt:global:ReviewStars; <a class="openreviews" href="/&mvta:visitor:code;.html#reviewbox"><span style="font-weight:normal;">(&mvt:global:Total_Reviews;)</span></a></mvt:if>
    </div>
    </div>
    </mvt:if>
    </mvt:foreach>
    </div>
    </div>
    </mvt:if><!-- end of visitors -->
    I thought maybe I should try some of the code I have posted in the past (something that worked in 2019 and again ignore any spaces in the coding...):

    <mvt:item name="toolkit" param="footsteps|fcount|9" />
    <mvt:if expr="g.fcount GT 0">
    <div class="row bottom-shadow product-carousel nm">
    <div class="column whole h3"><span class="uppercase">You Recently Viewed</span></div>
    <div id="js-footsteps-products-carousel" class="column whole float-none whats-popular-carousel">
    <mvt:foreach iterator="footstep" array="footsteps">
    <mvt:if expr="l.settings:product:customfield_values:custom fields:product_flag NE 'none'">
    <mvt:assign name="l.settings:product:flag" value="'flag--' $ tolower(l.settings:product:customfield_values:cust omfields:product_flag)" />
    </mvt:if>
    <div class="category-product">
    <a href="/&mvta:footstep:code;.html"><span class="flag flag--price" data-flag="$&mvt:footstep:price;">
    <mvt:item name="toolkit" param="customimagec|ipath|l.all_settings:footstep: code|main|200|150|" />
    <mvt:if expr="l.settings:toolkitadditionalimages[1]:generated:image">

    <img src="graphics/00000001/loading.gif" data-src="&mvt:global:imageroot;&mvte:toolkitadditional images[1]:generated:image;" alt="&mvt:footstep:name;-main" style="height:150px;" />
    <mvt:elseif expr="NOT ISNULL l.settings:footstep:thumbnail">
    <img src="graphics/00000001/loading.gif" data-src="&mvt:footstep:thumbnail;" alt="&mvt:footstep:name;-legacy" style="height:150px;" />
    <mvt:else>
    test: no image found
    </mvt:if></span>
    <span class="breaker"></span></a>
    <div class="revstars">
    <mvt:item name="productreviews" param="stars|footstep:id" />
    <mvt:if expr="g.ReviewStars"> &mvt:global:ReviewStars; <a class="openreviews" href="/&mvta:footstep:code;.html#reviewbox"><span style="font-weight:normal;">(&mvt:global:Total_Reviews;)</span></a></mvt:if>
    </div>
    </div>
    </mvt:foreach>

    </div>
    </div>
    </mvt:if><!-- end of footsteps -->
    There are a number of Toolkit functions that we all have come to rely on that now are dying a slow painful death. I'll be happy to continue posting ones that need to be converted because I know there are others out there that need this stuff too.






    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
    Are you open to doing this in regular SMT code? I feel like the toolkit is an outdated tool that should pretty much not be used anymore. If you want to do it in SMT code I'll write something up.
    M.A.D.* since 1997

    http://www.scotsscripts.com

    *miva application developers

    Comment


      #3
      Originally posted by Scot - ScotsScripts.com View Post
      Are you open to doing this in regular SMT code? I feel like the toolkit is an outdated tool that should pretty much not be used anymore. If you want to do it in SMT code I'll write something up.
      Yes, please. It's time to move on from 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

      Working...
      X