Price of product in woocommerce cart
Budget: $10 – $30 USD
Hello dear,
I'm setting up a wordpress website for a client (farmer) who wants the ability to recieve one time payments for a subscription. Each week the customer picks up a basket of vegetables from the farmer on tuesday or friday. This doesn't last all the year long, a "season" (2023 was from march 7th 2023 to january 19th 2024) must be defined (end date of the next season known after each season).
There are two possibilities:
Small basket 15€/week (Panier Classique)
Large Basket 20€/week (Panier Familial)
The thing is I need some help to be able to calculate the rigth price at the moment the customer begins his subscription (so the number of vegetables basket he will have). Each subscription must be paid in a one time payment with the ability to divide in two/three payments max. It will be also useful the generate invoice on demand. I started some PHP functions to calculate the price in the cart before the checkout but it's a little bit too tricky for me.
I have a variable product which is declined in two products (clasique and familial). I've add a custom field to my product so I can easily change the end date. I'm trying to make it easy for the farmer to edit it itself. In the basket I need to calculate the number of weeks remaining (from a started date selected by the customer or the today date) and then multiply the product price by the number of weeks remaining.
I must be able to add other products which will not be affected by this calculation.
Thank you for reading my request,
I'm setting up a wordpress website for a client (farmer) who wants the ability to recieve one time payments for a subscription. Each week the customer picks up a basket of vegetables from the farmer on tuesday or friday. This doesn't last all the year long, a "season" (2023 was from march 7th 2023 to january 19th 2024) must be defined (end date of the next season known after each season).
There are two possibilities:
Small basket 15€/week (Panier Classique)
Large Basket 20€/week (Panier Familial)
The thing is I need some help to be able to calculate the rigth price at the moment the customer begins his subscription (so the number of vegetables basket he will have). Each subscription must be paid in a one time payment with the ability to divide in two/three payments max. It will be also useful the generate invoice on demand. I started some PHP functions to calculate the price in the cart before the checkout but it's a little bit too tricky for me.
I have a variable product which is declined in two products (clasique and familial). I've add a custom field to my product so I can easily change the end date. I'm trying to make it easy for the farmer to edit it itself. In the basket I need to calculate the number of weeks remaining (from a started date selected by the customer or the today date) and then multiply the product price by the number of weeks remaining.
I must be able to add other products which will not be affected by this calculation.
Thank you for reading my request,