Woocommerce - Save and display product previous sales prices - woocommerce

In our country,under the new law, the display of discounted product prices will change.
We have to display:
Regular Price
Sales Price
Lowest sales price in the last 30 days.
And the % discount should be calculated with a new logic.
e.g. if in the last 30 days there was a 20% discount from the regular price, and later we give a 25% percent, the appeared % discount wouldnt be 25%, that would be only 5% (because this is the difference between new and past sales prices)
Could you give me an idea how could we do this?

Related

Increase price of all products after every sale (WOOCOMMERCE)

I would like to increase the price by $20 of all products after every new sell in woocommerce
Exemple:
Starting prices $50
First order : all products prices become $70
Second order : all products prices become $90
Third : all products prices become $110
and so...
I believe this plugin should give you what you want it is a bit outdated so use at your own caution
https://wordpress.org/plugins/raise-prices-with-sales-for-woocommerce/

Display discount price also on price without tax

I set discout percentage on 5% and it's ok it works fine but only for regular price with tax.
I also displaying prices with no tax included.
It looks like:
First price is with 5% discount.
second price is the price without tax.
How can I also display it like above?
Old price crossed and correct price next to.
Second price is counted by sufix {price_excluding_tax}

Spillting Tax & Fetching Same Tax Labels In Woocommerce

As per my country's tax system, I have added two tax classes. 5% & 18%. Standard rate is empty so I can use it for shipping. In my country, the tax system works this way. For example, consider one class only.
If the customer billing address state is DIFFERENT from the business state, it will be called IGST. So, the order will show 18% IGST.
Now if the customer billing address state is SAME as the business state, it gets divided into two parts, SGST & CGST. So the total tax will be divided equally as 9% CGST & 9% SGST, making it total 18%.
Same will apply for every tax class. I have created two dummy orders by considering the above mentioned scenario. Checkout those in images.
5% Rate Setup - https://snipboard.io/HJgLBu.jpg
18% Rate Setup - https://snipboard.io/e2Q3Ku.jpg
Orders reflecting the same.
Order with different state than business state - https://snipboard.io/w12sJO.jpg
Order with same state as business state - https://snipboard.io/d8QFme.jpg
Now, I am facing difficulties in two things while working on custom invoice template for Woocommerce PDF Invoices & Packaging Slips.
Fetching respective tax label in front of tax rates. e.g. IGST / CGST / SGST . These values are already stored in Woocommerce tax rates.
For the second scenario, for orders in same state, in pdf invoice it show rates as 9%, 9% (for 18% class)in single column. I want to print those outputs in two separate rows instead.
For this, logic may be like if customer billing state is equal to business state, then it will print/split tax rate in two columns like this https://snipboard.io/l3gbJe.jpg
For different state, same invoice will be https://snipboard.io/SwAGVW.jpg
I can answer the 2nd part only. Select the Vat and on the row label write gst. then select the comination option from the botton dont click the single total. It will bifurcate your GST in 2-parts. suppose you have 18% GST and we want to div it 9% as cgst and 9% as sgst. then will will divide the gst as 9% in equal parts. On the tax rate select static text and then write the label as Tax rate and value as 18% as in this case.
Hope this will help you out.
Regards,
Tylor.

Show tax rates in percentage instead of total tax value - woocommerce

In my cart beside total amount it shows how much amount of tax included. But I want to show the tax rate only ( percentage value just) instead of the amount. Please help how to do this .
Thanks in advance
Shows the tax amount but i want to change it to % vlaue
This should be configurable in the options however, i'm pretty sure u would have to show the total tax value according to laws.
WooCommerce > Settings > Tax > Your Tax Rates
there is a display option.

Woo commerce customer see custom product price

Please provide some solution on this conditions.
Retailer adds a price x, admin has added a commission of 10% so the customer will see x+10% price. But when the product is sold the 10% deduction id done on the total price.
For example:
Retailer price - 500
Admin commission 10% - 50
Customer purchase price is - 550
When distribution of price is done it is 55 to admin (10% of the customer purchase price) and retailer 495 (remaining amount)
need a solution so as retailer gets the price entered of 500
Please show some code. This must be a wrong mathematical calculation. If you add 10% to the product and then you want to subtract that 10% you added you just can't subtract 10% because it wont be the results you are expecting.
The approach I would taken as multiplying the retailers price by 1.1 is the same as adding 10%. You can the divide the total amount by 1.1
Like this:
500 * 1.1 = 550
550 / 1.1 = 500
Hope this works!

Resources