Questions tagged [cart]

A web cart or online shopping cart is a web app used to shop online. **For questions related to CART -- Classification and Regression Trees -- use the tag [cart-analysis], or consider whether the topic is more appropriate for Cross Validated or Data Science Stack Exchange**

3190 questions
10
votes
3 answers

Is there any way to display the WooCommerce mini-cart on my WordPress site?

I'm developing a website whereby I would like customers to be able to constantly view the contents of their cart so they can add/remove items on the fly (using WooCommerce). The theme I'm currently using is Flatsome (with the UXBuilder) I've noticed…
jvandervoo
  • 103
  • 1
  • 1
  • 5
10
votes
1 answer

Woocommerce: custom jquery event after added to cart

I'm trying (in archive) handle event after some product was added to cart (1 action on picture), I want catch that moment and update "Total number of products" (3 action on picture) of my mini cart in navigation menu. (With action 2 is all ok) Not…
Vitalij
  • 662
  • 2
  • 12
  • 26
10
votes
2 answers

Limit the number of cart items in Woocommerce

I am using Woocommerce and need the following: As product is being sold to another country and that country's customs only allow a total quantity of 6, so I need to prevent customers from order more than 6 items (products). 6 is the total of items…
user1481153
  • 169
  • 2
  • 5
  • 13
10
votes
3 answers

WooCommerce: Display also product variation description on cart items

I'm trying to display my product variation description in my Cart. I have tried inserting this code in the cart.php template: if ( $_product->is_type( 'variation' ) ) {echo $_product->get_variation_description();} By following this documentation…
simplycity
  • 103
  • 1
  • 1
  • 6
10
votes
1 answer

Echo specific Product Attributes and Meta Data in WooCommerce Cart

Update (related to author comments): I would like to customize WooCommerce cart.php to display some meta-data that are working just fine on the product page using Essential Grid premium plugin. I would like to display some product attributes fields…
Steven Wright
  • 121
  • 1
  • 1
  • 4
10
votes
6 answers

If cart is empty, the cart page will redirect to shop page in WooCommerce?

In WooCommerce, I want to redirect the cart page to shop page when the cart page is empty otherwise shows the cart page. Can anyone have the solution ? Here is the code I have tried, but it does not work: function my_empty_cart() { global…
Lipsa
  • 397
  • 3
  • 7
  • 26
10
votes
3 answers

Magento How to check if the shopping cart is empty or not?

I am trying to check if the shopping cart is empty or not. I am trying to do this from a static block and from a phtml file. Anyone know how to do this?
Wesley Smits
  • 1,314
  • 6
  • 23
  • 37
9
votes
1 answer

Which Hook is running after Woocommerce update cart button action

i need to know which hook is running after clicking the update cart button in the cart page . That is in cart page we have 4 button , update cart , continue shopping, proceed to checkout , apply coupon . So i want to know which hook is run after…
Manik
  • 513
  • 1
  • 7
  • 23
9
votes
2 answers

Decision tree using continuous variable

I have a question about Decision tree using continuous variable I heard that when output variable is continuous and input variable is categorical, split criteria is reducing variance or something. but I don't know how it work if input variable is…
BSKim
  • 91
  • 1
  • 1
  • 2
9
votes
2 answers

Subtotal cart variable php WooCommerce

Does anyone know what $variable to use in php to get the subtotal of the cart? Subtotal = total value of cart BEFORE discount or taxes. It would help me a lot. I want to add an extra fee if the subtotal is above 250 euro. Thanks in advance.
Cedric De Clercq
  • 163
  • 2
  • 2
  • 4
9
votes
4 answers

Check if a coupon is applied to cart in WooCommerce

I need to find a way to check if a coupon is applied to WooCommerce checkout, if so I would like to do something. I have tried searching around for this and cannot find a solution. Here is a slimmed down version of what I am…
Derek
  • 4,747
  • 7
  • 44
  • 79
8
votes
3 answers

Apply coupon discount via GET method in URL even if cart is empty in WooCommerce

I have a plugin that sends an advocates referral coupon code to e-mails that they enter. When the audience receives this email I'd like to create a flow where they can click on 'SHOP NOW' in the e-mail and the coupon will be automatically added. As…
Mjall2
  • 253
  • 1
  • 9
  • 24
8
votes
5 answers

Woocommerce - Cart page not displaying

After ADD TO CART option i can see the items are getting updated to CART but when moving to cart page it is redirecting back to homepage. The cart page shortcode is also provided. Please help out!I'm new to woocommerce.
Chinou
  • 461
  • 1
  • 5
  • 23
8
votes
2 answers

WooCommerce: How to retain checkout info when client leaves then comes back?

Is there a simple way or a plugin to retain checkout information entered by the client after he/she leaves and comes back? This plugin retains "fields information for customers when they navigate back and forth" however it has quite a lot of recent…
drake035
  • 3,955
  • 41
  • 119
  • 229
8
votes
1 answer

Adding Cart items Ruby on Rails

I am developing a very basic shopping cart and the issue I am having is that if I add more than one of the same product to my shopping cart I am not seeing the quantity increase and am instead just seeing multiple versions of the item. For example…
Tom Pinchen
  • 2,467
  • 7
  • 33
  • 53