Announcement

Collapse
No announcement yet.

Product-attribute combinations for multi-product add to cart

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

    Product-attribute combinations for multi-product add to cart

    I am interested in creating a fast order page for my wholesale customers to use. I've looked through the documentation for multi-product add to cart, and I have a question.

    Many of my products have attributes (sizes, in my case). Rather than showing each product as a row in a table and asking the customer to select a single attribute and input a quantity for the product, I want the page to display all product-attribute combinations that are included in a category and allow the customer to input a quantity for each. So my fast order page would need to look like this:


    Product
    Size
    Qty
    Shirt Small 0
    Shirt Medium 0
    Shirt Large 0
    Pants Small 0
    Pants Large 0
    Socks Small 0
    Socks Large 0
















    Is it possible to iterate through all product-attribute combinations like this and output each to a row and then use the multi-product add to cart to add quantities of selected product-attribute combinations to the cart at once?
    Todd Gibson
    Oliver + S | Sewing Patterns for Kids and the Whole Family

    #2
    Re: Product-attribute combinations for multi-product add to cart

    Yes this should be possible. I'll see if I can get you a code sample to get started.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Product-attribute combinations for multi-product add to cart

      Thanks Brennan. That would be much appreciated.
      Todd Gibson
      Oliver + S | Sewing Patterns for Kids and the Whole Family

      Comment


        #4
        Re: Product-attribute combinations for multi-product add to cart

        I wrote a module to do this for a client's store some years ago. It can provide a 2-D display, e.g. if you have a product with two attributes, such as size and color, the module will display a grid of text boxes for all the different combinations. I can provide a solution for you; if you're interested, you can drop me a line by email to discuss it.

        Thanks --
        Last edited by Kent Multer; 11-25-15, 08:52 AM.
        Kent Multer
        Magic Metal Productions
        http://TheMagicM.com
        * Web developer/designer
        * E-commerce and Miva
        * Author, The Official Miva Web Scripting Book -- available on-line:
        http://www.amazon.com/exec/obidos/IS...icmetalproducA

        Comment


          #5
          Re: Product-attribute combinations for multi-product add to cart

          @todd

          Here is a some basic code using the ADPM action:


          Code:
          <mvt:foreach iterator="attribute" array="attributes">
          
          
          	<mvt:foreach iterator="option" array="attribute:options">
          
          
          		<input type="hidden" name="Products[ &mvt:option:id; ]:code" value="&mvte:product:code;" />
          		<input type="hidden" name="Products[ &mvt:option:id; ]:attributes[ &mvt:attribute:index; ]:code" value="&mvte:attribute:code;">
          		<input type="hidden" name="Products[ &mvt:option:id; ]:attributes[ &mvt:attribute:index; ]:value" value="&mvte:option:code;" class="textfield">
          		
          		&mvte:option:prompt;: <input type="text" name="Products[ &mvt:option:id; ]:quantity" value="" class="textfield"><br>
          
          
          		
          	</mvt:foreach>
          
          
          
          
          
          
          </mvt:foreach>

          You also need to change the action to be ADPM:

          <input type="hidden" name="Action" value="ADPM" />
          Brennan Heyde
          VP Product
          Miva, Inc.
          [email protected]
          https://www.miva.com

          Comment


            #6
            Re: Product-attribute combinations for multi-product add to cart

            Thank you Brennan. Much appreciated!
            Todd Gibson
            Oliver + S | Sewing Patterns for Kids and the Whole Family

            Comment


              #7
              Originally posted by Brennan View Post
              Re: Product-attribute combinations for multi-product add to cart

              @todd

              Here is a some basic code using the ADPM action:


              Code:
              <mvt:foreach iterator="attribute" array="attributes">
              
              
              <mvt:foreach iterator="option" array="attribute:options">
              
              
              <input type="hidden" name="Products[ &mvt:option:id; ]:code" value="&mvte:product:code;" />
              <input type="hidden" name="Products[ &mvt:option:id; ]:attributes[ &mvt:attribute:index; ]:code" value="&mvte:attribute:code;">
              <input type="hidden" name="Products[ &mvt:option:id; ]:attributes[ &mvt:attribute:index; ]:value" value="&mvte:option:code;" class="textfield">
              
              &mvte:option:prompt;: <input type="text" name="Products[ &mvt:option:id; ]:quantity" value="" class="textfield"><br>
              
              
              
              </mvt:foreach>
              
              
              
              
              
              
              </mvt:foreach>

              You also need to change the action to be ADPM:

              <input type="hidden" name="Action" value="ADPM" />

              I have a most ignorant question - where in the Product Attribute Template do I place this code?

              I understand the part about changing the action - that makes sense. But I cannot figure where within all the various form types in the Attributes Template to place this. Also what Attribute Type should I set my attributes at? When I used to use the Sebenza Product Template Manager to do this, the attributes needed to be radio buttons and then everything came out perfectly.

              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