Ajax “Add to Cart” prepend to top of cart
-
So, I’m using a theme which utilizes the Ajax version of “add to cart” where javascript receives a HTML fragtment response.
I’ve used too much time figure this very small and what should be a simple modification, so now this question.
When I add a new product to my cart, I want it to *prepend* to the list (latest added top > last added item bottom).
How on earth do I accomplish that.
I got it to work for a page-reload via the
woocommerce_cart_loaded_from_session
action and just reverse the$woocommerce->cart->cart_contents
array but it doesn’t work as expected real-time when adding a product.Any help would really be appreciated!
Thanks,
Emil
- The topic ‘Ajax “Add to Cart” prepend to top of cart’ is closed to new replies.