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**
Questions tagged [cart]
3190 questions
7
votes
1 answer
Add tax free fees to WooCommerce cart programmatically
I try to add fees based on some calculations I do on Woocommerce cart, but I want to exclude it from VAT. This is my code:
function woo_add_cart_fee( $cart ) {
global $woocommerce; $bookable_total = 0;
foreach(WC()->cart->get_cart() as…

Tasos
- 7,325
- 18
- 83
- 176
7
votes
2 answers
WooCommerce: Cart price override with text
We have a bunch of products with either:
No price
Zero price
We made them purchasable with the built-in hook but the cart still displays them as having a 0 price during checkout.
We'd like the cart & checkout summary to display "Special order" or…

radug
- 111
- 1
- 2
- 8
7
votes
1 answer
Get shipping country during cart view - WooCommerce
I want to get the chosen shipping country when on the cart / checkout (so before the order is placed).
This is to determine if an extra fee (above the normal shipping costs) must be added.
How can i get the chosen country for this function?
I use it…

Cedric De Clercq
- 163
- 2
- 2
- 4
7
votes
4 answers
Creating a Shopping Cart using only HTML/JavaScript
I'm not sure what to do in order to complete this project. I need to create a shopping cart that uses only one HTML page. I have the table set up showing what is being sold but where I am lost is the JavaScript.
I don't know how to link the "Add…

user2334778
- 79
- 1
- 1
- 2
7
votes
1 answer
Changing line item properties on cart in Shopify
Is it possible to change line item properties after they have been added to the cart? (Either via a normal form submission, or via AJAX?)
I've tried a POST to /cart/change with a "properties[MyProperty]" key, but no luck so far. This is coupled with…

joecritch
- 1,095
- 2
- 10
- 25
6
votes
3 answers
Missing the X-WC-Store-API-Nonce header. This endpoint requires a valid nonce. Postman Error
POST : xyz.com/wp-json/wc/store/cart/add-item
I'm Developing a mobile woocommerce application and try to add-item in cart but getting some error please help to fix this problem thanks.
In Body:
{
"id": "8924",
"quantity":1,
"variation": [
…

Permendra Singh
- 97
- 1
- 7
6
votes
1 answer
Append a text to total price only in Woocommerce checkout page
I have the following code that adds suffix text in the total section of BOTH cart and checkout pages:
add_filter( 'woocommerce_cart_total', 'custom_total_message' );
function custom_total_message( $price ) {
$msg = 'Prices for grocery items may…

Les
- 330
- 5
- 15
6
votes
1 answer
Change wc_empty_cart_message function in WooCommerce 3.1
I've been trying to change my layout for the empty-cart message. I've removed the action, and try to replace it.
I'd like to change the htm structure output from:
to:

Onno V.
- 117
- 1
- 1
- 13
6
votes
1 answer
Why does the second product dynamically added to the cart loose it's options in Magento2
I am dynamically adding products to the cart in Magento2 with some custom options. Every product has the same base product id with different options. Represent Product has been properly overridden so that all products added to the cart are separate.…

dubloons
- 1,136
- 2
- 12
- 25
6
votes
3 answers
Check if cart is NOT empty in Woocommerce 3
I can' figure this out, how to check if cart is empty. What am I doing wrong?
My code:
add_action( 'wp_footer', 'redirecionar' );
function redirecionar(){
global $woocommerce;
if ( is_page('carrinho-de-compras') and…
user5483053
6
votes
2 answers
How to remove order total from cart and checkout page woocommerce
I would like to remove order total block on cart and checkout page.
I am not able to find any action or filter to remove order total.
I don't want to use css to hide this column.

Karan Rpn
- 85
- 1
- 1
- 6
6
votes
1 answer
Changing WooCommerce cart item names
The goal is to change the name of the item as it gets passed to our payment gateway, but leave it as-is for display on our product pages.
I've tried this in my functions.php:
function change_item_name( $item_name, $item ) {
$item_name =…

Drew Angell
- 25,968
- 5
- 32
- 51
6
votes
2 answers
Change price of product in WooCommerce cart and checkout
I'm creating a WooCommerce add-on to customize the product, based on selected options by the visitor and custom price is calculated and stored into session table also.
I am able to get that value in cart page also.
My problem: I would like to…

Thilip Kumar
- 81
- 1
- 4
6
votes
3 answers
Get Cart Tax Total programmatically in WooCommerce
How do you get the tax total in WooCommerce in the functions.php page in WordPress, Using :
global $woocommerce;
$discount = $woocommerce->cart->tax_total;
But is not returning any value.
How can I get Cart Tax Total?
Essentially I want the Tax…

DEVPROCB
- 483
- 2
- 5
- 19
6
votes
2 answers
WooCommerce Get Order Product Details Before Payment in Plugin
I need to display order details from cart before payment in plugin.
I work on one plugin what connect woocommerce and an payment API and there I need to send array of product details like product ID, name, description, quantity and individual…

Ivijan Stefan Stipić
- 6,249
- 6
- 45
- 78