Announcement

Collapse
No announcement yet.

Delete Entire Cart Wipes Out Inventory

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

    Delete Entire Cart Wipes Out Inventory

    I don't know if anyone else has experienced this. I'm testing inventory on a dev store running Shadows using the "Remove Products from Available Inventory when added to basket" setting. If I delete something from the cart by editing the quantity or deleting an individual item, then stock is returned to the inventory correctly. But if I use the "Delete Entire Cart" button, it does not return the stock to inventory. It's basically gone! It's not listed in basket inventory and it's not reflected in the total inventory.

    For example, if I have 10 items and I add 5 to the basket. If I delete the entire basket, the inventory count will stay at 5 and the basket inventory will be 0.

    Is this a setting or glitch? Anyone know? If I can't figure this out, I'll probably just disable the "delete entire cart" option as that would be chaotic to say the least!
    Tony Pavao
    Studio6t6
    Vancouver BC Canada
    [email protected]

    #2
    Hi Tony,

    The Delete Entire Cart button and function was removed in Shadows v2 because of this very issue. Once I can figure out a more streamlined solution, the function will be added back in.
    Matt Zimmermann

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment


      #3
      Thanks, Matt. Good to know!
      Tony Pavao
      Studio6t6
      Vancouver BC Canada
      [email protected]

      Comment


        #4
        We've observed essentially the same thing on the backend in Miva Admin when using the "Review Baskets" module: when deleting baskets (individually or all at once), or even when removing particular items from a basket, the system also does NOT return the stock to inventory.

        Is this also a known bug, or alternately, is there a way to ensure that the system returns the stock to inventory when deleting baskets in Admin?

        Comment


          #5
          We found a fix for the "Delete Entire Cart" functionality on BASK by switching from the Basket_Reset_Contents function to Runtime_Basket_Empty. Additionally, we added BasketDiscountTotal_Delete_All_Basket because we saw that occurring within the LSK for similar actions.

          Code:
          <mvt:comment>
              /**
               * This controls the `Delete Entire Cart` function.
              */
          </mvt:comment>
          <mvt:if expr="g.Clear_Cart">
              <mvt:do file="g.Module_Library_DB" name="l.success" value="Runtime_Basket_Empty( g.Basket:basket_id )" />
              <mvt:do file="g.Module_Feature_PGR_DB" name="l.success" value="BasketDiscountTotal_Delete_All_Basket( g.Basket:basket_id )" />
              <mvt:assign name="l.result" value="miva_output_header( 'Location', encodeentities( l.settings:urls:BASK:auto ) )" />
              <mvt:assign name="l.result" value="miva_output_header( 'Status', '302 Moved Temporarily' )" />
          </mvt:if>
          Last edited by SteveoSoule; 04-12-21, 01:15 PM.

          Comment

          Working...
          X