That’s maybe not really the right anwser, but the way to test if prices are pulled into the cart and the way to recalculate cart totals.
add_action('template_redirect', 'test_cart_values');
function test_cart_values(){
$cart_items = WC()->cart->get_cart();
if(is_cart() || is_checkout() ){
var_dump($cart);
foreach($cart_items as $item){
if($item['line_subtotal'] == '' or $item['line_subtotal'] == 0){
$calculate_once_again = true;
}
}
if($calculate_once_again == true){
WC()->cart->calculate_totals();
}
}
}
Note that you can get the cart from session in an other way.
Remove var_dump() if you are on a production server.
Hope it helps
Related Posts:
- Fatal Error when installing woocommerce despite upgrading
- Adding an action within a function that is being called by add_filter
- Pass custom Checkout field value to Stripe gateway in WooCommerce
- How to modify “[Product] has been added to your cart” in WooCommerce?
- woocommerce fail to replace template string in email title [closed]
- WooCommerce Shop Page Not Found 404
- How can I show an empty WooCommerce cart? [closed]
- Woocommerce Pre Orders – Can i override templates?
- Woocommerce checkout via external page [closed]
- Change font size in products listing pages in woocommerce
- Programmatically adding product attributes to WP / Woo commerce
- Display File Types For Woocommerce Downloadable Products On Product Page
- Trying to disable slider for WooCommerce price filter [closed]
- Programmatically setting Woocommerce product price
- Woocommerce reviews xss issue [closed]
- Unable to update Woocommerce Product Permalink
- Add product categories to receipt
- Woocommerce specific product template for product type
- How can I use a gravity form to send an e-card?
- How to select default Woocommerce category page
- Creating Product Table using Gutenberg
- I can ‘t display product images based on the label
- SKU for each product on every page
- Woocommerce get billing state manually
- WooCommerce quick checkout form? [closed]
- woocommerce cart item remove ajax not working in hosted site [closed]
- Set woocommerce product price based on dealer location [closed]
- How can I custom order the product display?
- WordPress plugin cloak link [closed]
- Woocommerce Cart Default Language Not Changing
- Make this Fast and Queryable
- WooCommerce slider filter for numerical attributes
- Woocommerce Update Causing Internal Server Error [closed]
- Reordering product tab under product image [closed]
- How do I change the default state label for a country on the WooCommerce checkout page?
- remove default pagination on woocommerce shop page
- woocommerce – customise notice error in checkout page
- Woocommerce, prevent login after registration and redirect to custom URL
- Remove Bulk Action For non admin user
- Add max-value to hooked quantity selector in woocommerce [closed]
- woo product , wp_insert_post() never displays on the front end. What gives? [closed]
- How to add product filter dropdown in woo commerce order page?
- Single product page doesn’t display price
- Unable to paste google analytics con header.php [closed]
- How to make an edit to an already published post back to Draft
- Woocommerce pre_get_posts query variation meta data not working
- Can’t hide product attributes with css on WooCommerce Product Page
- Updating product image
- Split in 2 columns add to cart button and variable forms
- Images not uploading on product page of woocommercr
- How to access WC()->cart in CF7 hook wpcf7_special_mail_tags
- How to integrate e-transfers with checkout in WooCommerce
- Manual Admin Orders search for billing_company
- Woocommerce to get restaurant table numbers in the checkout fields from the url
- Send all emails to Shop Manager along with admin
- Snippet to copy product affiliate link to a custom field
- Woocommerce Checkout Page Total Price Inside Google Pay Script
- UX Builder not loading for product description edits
- I need help with storefront theme shop page
- How to get rid of variations with unspecified attributes
- Woocommerce shop page not showing all products
- Wrong Billing Information in WC_Checkout->get_checkout_fields(‘billing’)?
- How to display two different custom taxonomy terms on a WooCommerce single product page
- Registration roles
- Change password notification email
- How to show price update date in product single page?
- Sending billing details via POST request to an API
- how can my customers view their purchased products history like an invoice in a specific page on WordPress
- How do I make my products on the homepage responsive?
- How to get users data from wordpress woocomerce database to display
- Simple thing esc_url query
- Tax exclusive if coupon applied else tax inclusive in items
- WooCommerce Registration, Sync User, Billing and Shipping info
- Woocommerce on Subdirectory
- Change WooCommerce state and city checkout fields to dropdowns related to the chosen country
- How to apply a custom coupon to a WooCommerce Subscription recurring amount?
- How to customize product at cart page
- WooCommerce Storefront site-header padding
- WooCommerce: How can I add a certain product to the cart and redirect to the cart from a non-shop page?
- How to check which shortcode is using my template?
- Update products with curl (bash)
- woocommerce: when adding or removing items to cart , it takes cart a few seconds to read changes?
- How to get woocommerce integration instance?
- Create woocommerce order on new user registration
- How to put a date range in a virtual/downloadable product? [closed]
- When to use a child theme for WooCommerce Storefront?
- Redirect whole website or pages to /wp-admin in wordpress
- Changing sale price programmatically, but it’s not shown on front-end
- Woocommerce shows empty columns [closed]
- Product atributes in title of order (not in description)
- How to create custome pdf file of my invioice in wordpress
- How to get sub items of parent menu item?
- WordPress and WooCommerce How to Assign Attribute Based Pricing
- Storefront Child Theme show product attribute [closed]
- How to remove slug from Product category URL in Woocommerce
- Removing ‘woocommerce-no-js’ class from body
- url rewrite doesn’t load woocommerce product
- Woocommerce | I want to the button ‘Add to Cart’ on the (all) product-page changed by just ‘open product’ button
- Adding line breaks in WooCommerce order processing emails
- Add second price option based on payment method at cart item price