Woocommerce - Rounding Error - wordpress

I'm trying to fix a rounding error in Woocommerce. It appears that whenever it gets a 5 and needs to round it rounds down instead of up. My client is using two different systems that need to sync but they aren't because of this rounding.
For example one product is $14.10 normally. They have applied a 15% discount to that and Woocommerce shows the total as $11.99 where the other system show it as $11.98. I believe the issue is the discount comes to $2.115. Woocommerce sees the 5 and rounds it down to $2.11 and the other system rounds it up to $2.12.
Is there a way to change the way Woocommerce does rounding so that it will round a 5 up instead of down?

Related

Woocommerce discount codes, rounding up rather than down

I'm hoping this is a straight forward fix, but I'm a bit stuck with getting the discount codes to output a rounded up price.
For example if I'm selling a product at £29.95 with a 50% discount - that should be £14.975 - which would round up to £14.98. At the moment this is rounding down to £14.97.
Normally this wouldn't be a problem but the site exports the sales data in a specific format to a distributor who needs to have this discount appear as £14.98 for it to be processed.
Any ideas?

i want to be sure that woocomerce doesn't sells over the stock

this is my first question and im not a programmer. English isn't my natural Language either.
I need to reduce to 0 or to the minimum possible the chances of woommerce taking orders or accepting payments when the stock reaches 0.
I simulated 2 purchases at the same time and both were received and the stock counter got to -1.
i expect a lot of people buying products at the same time in my website and I want to avoid giving money back because of sells above the stock.
i had another problem with "Mercado Pago" payment method. once an order was already cancelled (due to the time limit) it let the payment be finalised.
thank you very much!
I found out that your issue matches this one: https://wordpress.org/support/topic/negative-stock-quantity/
Also, it could be your payment gateway capturing the payments later or something which is causing the order status to be delayed. In such cases, the stock does go to a negative number which is a known issue.

Woocommerce reduce inventory programmatically when related variation is purchased

Ok, will do my best to explain the problem.
I am selling limited edition prints on my site. They come in multiple sizes, and they also come framed and unframed.
Right now, I set up each product to have 2 attributes: size & frame.
Within the variations, I have 4 options
11x17 unframed
11x17 framed
20x30 unframed
20x30 framed
The problem occurs with the inventory. There are 10 total 11x17 prints, but since I have to enter a stock quantity for each variation, I have to do something like this:
11x17 unframed 10qty
11x17 framed 10qty
Which makes it seems as though there are 20 total prints, instead of 10.
Ideally, I'd want to keep inventory based on attribute, not variation, but there doesn't seem to be a way to do that.
I am unable to set up the Frame as an add-on product because the cost of the frame goes up, as the size of the print goes up.
I am wondering, if there is a way to programmatically reduce the stock of other variations, when one variation is purchased. So, when someone purchases the "11x17 unframed", the "11x17 framed" stock is reduced -1 at the same time.
All of the products on the site are exactly the same, so I wouldn't mind hard-coding the specific variation names in the code.
Not sure if something like this is doable, but I would hugely appreciate any insights.
This is the closest example I could find to customizing how stock is handled:
Reduce WooCommerce Item Inventory By Attribute Value
Thanks in advance,
Jenny

Google Analytics custom dimensions not tracked right after creating dimensions

I have noticed an odd behavior when working on Google Analytics. I have enabled a custom dimension in an existing installation, and then started sending hits to GA with said custom dimension in it right away. (For clarification, this was a previous custom dimension, which was disabled and set to Product scope; I enabled it, renamed it and changed it to User)
The odd thing is that for a while, whenever I tried to show my custom dimensions in reports, I got an empty list, as if there were no hits with custom dimensions in them - even though I'm certain that they were being sent. However, a few hours after I tried again and I checked that this time around, the custom dimensions did appear in my reports - I could add them as a dimension to my reports and get back some results.
What bothers me is that when I checked the times of the rows I was getting in the report, it appears as though I only got results from the attempts I did several hours after setting the custom dimensions - apparently, the first hits weren't getting any custom dimensions with them.
So my question is - is there a setup period for creating or modifying custom dimensions during which GA will not record the new dimension data? Or could it be that I am overlooking something in my setup? (I'm pretty certain the clients were sending the right data at all times.)
Yes, in my experience it can take up to 3 hours (depends on a lot of factors).
So next time anticipate the need for the custom dimension or just be ready to lose some data.

WooCommerce Use Pricing Tables as Product Variations

I'm attempting to emergency-revamp my print company's website after the guy "developing" the site for me simply disappeared off the face of the planet last week, leaving me with no site and potentially countless thousands in lost revenue (not happy isn't close). All goes well until I came across this issue and for the life of me I can't find any answer's anywhere to it:
Creating a tabbed table containing sizes and prices in Wordpress... easy (this is not a stereotypical pricing table)
Integrate woocommerce into the chosen theme...easy
Now, making each price an individual "add to cart" button - major rage quit imminent.
I have no interest in making a product for every single conceivable variation as it's simply not necessary should I be able to get the tabbed table working as described. Having to do so would probably give me heart failure as I would then have to create yet more un-necessary graphics. My customers just want to be able to see the price, click the price (and thus "add it to cart"), purchase, done.
Here's the tabbed table in question in case everything I've just type makes zero sense: http://www.protradeprinting.com/canvasprints/
ANY suggestions would be a big help.

Resources