Announcement

Collapse
No announcement yet.

Odd basket behavior in MM9

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

    Odd basket behavior in MM9

    Hi folks,

    One of my clients is a store that sells tea, including loose teas that you buy by the ounce. Sometimes a client will order two or more packages of the same tea, e.g. for gifts. So if a customer puts qty. 4 of some product in their basket, and then clicks Add To Basket again for 4 more, they don't want the store to combine them into a single line item with qty. 8.

    I wrote a custom module to implement this, and it worked quite well in v5. But in v9, although the add-to-basket operations still work, the store will combine the items later. It happens on the BASK page if the customer clicks a Remove or Update-qty. button for any item. Also, as you go through checkout, the items will be combined by the time you get to OSEL.

    This is not just a display issue. I already edited all the basket-contents templates to use basket:items instead of basket:groups. I looked at the DB to confirm that the store is actually deleting BasketItem records. After a look at the LSK, I gather that this is being caused by the Runtime_Discount_Basket() function, which is pretty complex; I didn't dig much deeper than that.

    All I really need to know is: can we turn off this item-combining functionality, and if so, how? The store does use some price groups.

    Thanks --
    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

    #2
    Re: Odd basket behavior in MM9

    The basket contents component now has a drop down to determine if products are displayed as individual line items or groups. This is also what controls if basket:items or basket:groups is used for the array. Try adjusting this settings. You'll have to change to point and click mode, update the setting then past back in your template code, because adjusting the setting will overwrite your existing code.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Odd basket behavior in MM9

      Originally posted by Kent Multer View Post
      All I really need to know is: can we turn off this item-combining functionality, and if so, how? The store does use some price groups.
      There's no way to disable that functionality. You are correct that it is part of the discounting system. You could work around it with a module that inserts a BasketOption with a differing value for the two items, which would cause the discounting system to think they are different items.

      Comment


        #4
        Re: Odd basket behavior in MM9

        Hi Burch, your suggestion seems to have done the trick. My module is now creating an extra BasketOption on the fly for these "must stay separate" items. The :data field of the option contains the line ID, an easy way to make it unique for every item. The extra options are preventing the grouping behavior. We can write a little template code to prevent the options from being displayed to customers.

        Thanks --
        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: Odd basket behavior in MM9

          Hi Burch, I have a follow-up question. Suppose a customer buys qty. 4 (4oz.) of some tea, and then qty. 12 of the same tea. With my module running, this will create two separate BasketItems. But the store is giving both items the volume discount for qty. 16. The client is wondering if we can modify this, so that the qty.-4 item and the qty.12 item will each get the volume discount that's specified for those numbers. Is that do'able?

          Thanks --
          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


            #6
            Re: Odd basket behavior in MM9

            Miva's Volume Price Group allows you to group by variant. I'm not sure if your attribute is considered a variant but it's worth a try.
            http://www.alphabetsigns.com/

            Comment


              #7
              Re: Odd basket behavior in MM9

              I don't think you'll be able to accomplish what you want.

              Comment


                #8
                Re: Odd basket behavior in MM9

                Originally posted by alphabet View Post
                Miva's Volume Price Group allows you to group by variant. I'm not sure if your attribute is considered a variant but it's worth a try.
                Hmmm, that might work, but the setup would be complex, because the quantities need to tie in with inventory. So we'd need to create variants representing quantities from 1 to 16, so customers could buy that many ounces in a package. For this to work, I think we'd need two products for each tea: the master product to carry the variants, and a separate product representing one ounce of the actual tea. That's a long way to go for a solution ... but Thanks for the creative thinking!
                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


                  #9
                  Re: Odd basket behavior in MM9

                  OK, one more question please. I'm seeing some odd behavior with a module that stores data about BasketItems in a custom table, keyed by line_id. It seems like some data loss is occurring, possibly during checkout.

                  In version 9, is there some "housekeeping" operation that can cause the store to delete a BasketItem and re-create it, resulting in a change of the line_id, even though all the other data remains the same?

                  Thanks --
                  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


                    #10
                    Re: Odd basket behavior in MM9

                    Yes, as the discounting system combines and splits lines, the line_ids can change.

                    Comment


                      #11
                      Re: Odd basket behavior in MM9

                      Just to be clear: what about cases where there's only one item in the basket? (Or multiple items, but no discounts in effect for any of them.) Could some line_ids still be changed as a result of the store's normal basket-checking process?

                      Also: what happens to BasketInfo records when the store changes line_ids?

                      Thanks --
                      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


                        #12
                        Re: Odd basket behavior in MM9

                        The line_ids should not change for a single item, or when there are no discounts applied/removed.

                        BasketInfo records are not tied to a line_id (from the core software's perspective, anyway), so nothing happens to them.

                        Comment

                        Working...
                        X