I would like to allow 0 quantity on Woocommerce Line order when edit.
Currently it will automatically remove when it is 0.
Kindly advise.
Thanks.
Related
I want to change or reset the total_sales to 0 at worst.
When I modify in phpMyAdmin (wc_product_meta_lookup) nothing happens and everything goes back to the way it was before after a new order.
I searched for 2 hours without finding anything.
thank you in advance.
total_sales is a post meta field, a row in postmeta table. wc_product_meta_lookup just contains consolidated data from postmeta to avoid making multiple postmeta selects when product data are needed.
postmeta is the source of truth in this case, you need to set your desired value in there. Either directly in the database or using a custom field in the product edit view.
Reports (including total sales value in the dashboard widget) are dynamically generated, so I believe the value your setting in the database will just be set back to it's true value when WordPress runs.
According to the docs, you need to delete all prior orders (permanently) and clear your browser cache for new reports.
More info: https://docs.woocommerce.com/document/reports/#section-12
I have a problem with the round function (woocommerce) for the value in the cart.
Problem is that the value 8.4903€ is rounded to 8.50€. It should be 8.49€
Take a look a the captures:
In capture 1 I set the woocommerce to show 4 decimals in the prices so that we can see the real values.
In capture 2 I set the woocommerce to show 2 decimals. Here you will see that the rounded values are wrong.
How can I trace this issue? I already deactivate all plugins (except woocommerce, of course), so that I can be sure this issue is not caused by other plugin.
I already opened (week ago) an issue for this in the plugin author page, but nothing yet. So, I guess if we can sort this out with a function in the function.php file of my child theme.
I know how to use the php round() functions but I need help to target ALL woocommerce values in the cart.
---------------capture 1--
---------------capture 2--
---------------capture 3--
Fixed!. I just enabled 'Round tax at subtotal level, instead of rounding per line' and the issue is gone. Thank you #MujeebuRahman!
https://s.nimbusweb.me/share/2533555/4x99afoss5d7vtfny98w
Round tax at subtotal level, instead of rounding per line
I have a woocommerce store and I want to change the order that star ratings are displayed in the single product page. Now the star rating system is from 1 to 5. I want to display first the 5 and go to 4 - 3 - 2 - 1. Any thoughts?
Thanks
Based on your pastebin , i have edited it so that the ordering becomes 5-4-3-2-1 , check it out if it works properly
`https://pastebin.com/A2gXJnDu`
Please help me how to set programmatically woocommerce dynamically generate coupon code usage limit per user 1 for guest users.
Any one know solutions for this then please inform me.
https://docs.woocommerce.com/document/create-a-coupon-programatically/
Thanks.
Use following coupon code meta in your custom code:
update_post_meta( $new_coupon_id, 'usage_limit_per_user', '1' );
You can change number value as per your requirements.
Thanks,
Ketan.
How to detect reorder of old order in woocommerce?
I want to remove any product if customer is reordering any old order, please help.
I know how to remove any product but I am unable to detect that customer is re-ordering any old order.
eg. Suppose user has purchased any order that's have 2 products and when user is trying to purchase same order I want to remove 1 product from the order. I don't want that user remove this product from cart.
After searching a lot and after reading some woocommerce core files I found below solution:
add_action("woocommerce_ordered_again", "dbr_remove_all_product_except_the_subscription_func");
function dbr_remove_all_product_except_the_subscription_func()
{
$cart_items = WC()->cart->get_cart(); /* if needed get cart like this */
/* code here as per your requirement. */
}