Price format correction
-
On many products, the price has been mentioned as x.00000 , due to which the products (without sale price) are getting dispalyed in On Sale products. Ones we remove the extra 00, it gets removed from the On Sale products.
There are many such products, how do I correct them in bulk. The wordpress is using WPML, and is in two languages.
-
Hi @raunharmantech,
Thanks for clearly outlining what’s happening here, I can see how the extra trailing zeros in prices like
x.00000would incorrectly flag products as “On Sale”, especially when there’s no actual sale price set. That can definitely cause confusion across your catalog, so let’s work through a scalable way to fix this.From what you’ve described, this is likely happening because WooCommerce treats even slight differences between regular price and sale price values as a valid sale condition. So entries like
100vs100.00000can unintentionally trigger the “On Sale” status.Since you have many products and are using WPML, the best approach would be to correct this in bulk rather than manually editing each product. Here are a few options you can consider:
- Bulk edit via CSV export and import
You can export your products, clean up the price formatting, and re-import:- Go to Products → Export
- Open the CSV file and normalize the
Regular priceandSale pricecolumns by removing unnecessary decimal zeros - Re-import via Products → Import
- Database-level update (advanced option)
If you’re comfortable working with the database or have developer support, you can run a query to normalize price meta values in bulk. This is faster but should be done with a backup in place. - WPML consideration
Since you’re using WPML, ensure that:- Price fields are synchronized across translations
- After cleanup, run WPML troubleshooting tools to sync product data across languages
- Double-check for hidden sale prices
Some products might still have asale_pricemeta value stored even if not visible in the UI. Bulk cleanup should ensure both regular and sale prices match correctly or remove unintended sale values.
If you’d like, you can share a sample of your product export via https://pastebin.com or https://gist.github.com, and I can help review the formatting before re-importing.
Once this cleanup is done, your “On Sale” products list should reflect only the intended discounted items. Let me know how it goes or if you’d like help with any of the steps above.
How I share the product export through pastebin. It is a csv file
Hi @raunharmantech,
Thanks for your follow-up here, I can see you’re trying to share the CSV export so we can take a closer look and guide you properly.
Since CSV files aren’t well suited for Pastebin, you can upload the file to a file sharing service like Google Drive or Dropbox, then share the public link here. That way we can access the file and review the price formatting directly.
If possible, please ensure the link is set to “anyone with the link can view” so we can open it without restrictions. Once you’ve shared the link, I’ll be happy to take a look and help you clean up the pricing values.
Hi there!
Thank you for sharing the CSV file.
I’ve checked it, and I can see some products have prices like 100.00.
Could you please confirm whether those products (with prices like 100.00 and no sale price set) are the ones causing the issue?
I tried to replicate this on my end, but I’m not able to reproduce the issue—prices are appearing correctly, and products are not being marked as “On Sale” unexpectedly.
To investigate further, could you please share more details on how you are displaying “On Sale” products on your site? For example:
- Are you using a shortcode?
- A plugin?
- Or the default WooCommerce on-sale filter?
Also, could you confirm whether removing the “.00” from values like 100.00 fixes the issue on your side?
In the meantime, as a workaround, you can:
- Edit the CSV file
- Remove the “.00” from the price values
- Re-import it into WooCommerce
- Make sure to select “Update existing products”
Once we have a bit more information, we can investigate this further.
screenshot attached.
https://drive.google.com/file/d/17B8Se4k33PNYujmPNTLW7AhamTXJ2B1c/view?usp=sharing
- Bulk edit via CSV export and import
You must be logged in to reply to this topic.
