Announcement

Collapse
No announcement yet.

Get Attribute Count without Toolkit

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

    Get Attribute Count without Toolkit

    I know that Toolkit has a function to get the number of attributes for a product, but I'm trying to accomplish the same thing without an extra module. I assume there's a function that I can call with mvt:do that will let me access this, but in digging through the LSK I'm having a hard time determining where would be the best place to pull this info. Has anyone else done this?

    Thanks,
    Josh

    #2
    Re: Get Attribute Count without Toolkit

    Looking at the PROD template using the var list, I see a g.attr_count (&mvt:global:attr_count;) and l.settings:attr_count (&mvt:attr_count;) available.

    I'm not using Toolkit to create any count variable on the product page, so these would seem to be from Miva.

    Comment


      #3
      Re: Get Attribute Count without Toolkit

      Originally posted by nottheusual1 View Post
      Looking at the PROD template using the var list, I see a g.attr_count (&mvt:global:attr_count;) and l.settings:attr_count (&mvt:attr_count;) available.

      I'm not using Toolkit to create any count variable on the product page, so these would seem to be from Miva.
      Thanks for your reply. I guess I should clarify what I'm doing a bit. We use custom product variables to offer cross sells in the shopping cart, and I currently pull that product info onto the BASK page like so:

      Code:
      <mvt:do name="l.return" file="g.Module_Library_DB" value="Product_Load_Code_WithRuntimeInventory( g.alsobought_code, l.settings:product )" />
      However, that doesn't pull any attribute info, so I assume there's a separate function I can call to get that. I want to toggle my "add to cart" button for items that require attributes so it offers a link to the product details instead.

      Alternatively, I'm debating just calling attribute machine (although that seems like overkill for this purpose), or just doing nothing, allowing customers to just click "add to cart" no matter what. They'll get redirected to PATR to choose the attributes, which is functionally similar to linking to the product page anyways. It's really a matter of setting expectations.

      Plus, I'm just hung up on the idea that there has to be a way to do it, and I must know it!


      Thanks,
      Josh

      Comment


        #4
        Re: Get Attribute Count without Toolkit

        I think you want to structure your 'project' as follows:

        Create a new 'Page' that has all the product items you need sans any of the site "framework" (global header/footer, etc). Make sure that product is using the new Ajaxed add to basket functionality

        Based on the alsobought of the current field, make an ajax call to the new Page into a lightbox type of display.
        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


          #5
          Re: Get Attribute Count without Toolkit

          Try:

          Code:
          <mvt:do file="g.Module_Library_DB" value="AttributeList_Load_Product( l.settings:product:id, g.has_attribute )" />
          <mvt:if expr="g.has_attribute" >
                  link to product page
          <mvt:else>
                  add to cart button
          </mvt:if>
          http://www.alphabetsigns.com/

          Comment


            #6
            Re: Get Attribute Count without Toolkit

            Originally posted by alphabet View Post
            Try:

            Code:
            <mvt:do file="g.Module_Library_DB" value="AttributeList_Load_Product( l.settings:product:id, g.has_attribute )" />
            <mvt:if expr="g.has_attribute" >
                    link to product page
            <mvt:else>
                    add to cart button
            </mvt:if>

            That's exactly what I was looking for. Thanks so much!

            Josh

            Comment


              #7
              Originally posted by alphabet View Post
              Re: Get Attribute Count without Toolkit

              Try:

              Code:
              <mvt:do file="g.Module_Library_DB" value="AttributeList_Load_Product( l.settings:product:id, g.has_attribute )" />
              <mvt:if expr="g.has_attribute" >
              link to product page
              <mvt:else>
              add to cart button
              </mvt:if>
              Thanks, this is exactly what I needed..! 2.5 years later...

              Here's how I used it, maybe this will help someone else in a couple of years :-P

              Code:
              
              <mvt:do file="g.Module_Library_DB" value="AttributeList_Load_Product( l.settings:product:id, g.has_attribute )" />
              <mvt:if expr="g.has_attribute" >
                  <a href="&mvte:product:link;" title="Shop for &mvte:product:name;">shop now</a>
              <mvt:else>
                  <form action="&mvte:urls:BASK:auto;" method="POST" class="category-product-form">
                      <input type="hidden" name="Action" value="ADPR">
                      <input type="hidden" name="Product_Code" value="&mvte:product:code;">
                      <input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;">
                      <input type="hidden" name="Quantity" value="1">
                      <button>add to cart</button>
                  </form>
              </mvt:if>

              Comment

              Working...
              X