cart icon indicating copy to clipboard operation
cart copied to clipboard

When Using AJAX Mini cart doesn't update

Open HenryAveMedi opened this issue 3 years ago • 1 comments

When Using AJAX Mini cart doesn't update any idea to what i have to do to access the new cart object and render it in the mini cart?

Current Behavior when adding object to the cart per ajax, the minicart does not update

Expected behavior/output when adding object to the cart per ajax, the minicart should fetch the new {cart} per ajax as well

Environment

  • TYPO3 version(s): 10.4.15
  • cart version: 7.1.8
  • cart_products: 3.0.0

Possible Solution

Additional context Add any other context about the problem here.

HenryAveMedi avatar Jun 19 '21 16:06 HenryAveMedi

In general, retrieving the mini-cart via AJAX would be beneficial, so that a static cache (e.g. via ext:staticfilecache) can still be used.

dahaupt avatar Dec 03 '21 11:12 dahaupt

@HenryAveMedi The JS should update the minicart but you have to follow the syntax which is demanded by the JavaScript: https://github.com/extcode/cart/blob/f1e76da8b29423b2319d470f5b3c1ff777f5d2cf/Build/Sources/JavaScript/add_to_cart.js#L108-L112

Did you follow those requirements but it's still not working?

rintisch avatar Mar 19 '24 20:03 rintisch