I have a woocommerce shop with the woocommerce booking system. At my website, you can book meal deliveries based on time slots. I used the booking system because some meals are available some days. And, you can book meals on multiple days in one order.
My problem is that I want to apply a fixed shipping cost (3,5euros) based on deliveries/time slots. I can’t group meals of the same delivery in one order.
My question is : is there a way to make a php script to calculate shipping cost based on delivery time slots?
My current cart page and what i need
currently, i use this calculation method on woocommerce settings : 3,5 * [qty]
The problem in my case is that don't want to charge multiple times for the same delivery.
Thank you!
Related
I have WooCommerce Subscriptions and Discounts for WooCommerce Subscriptions which allows me to offer discounts according to the number of renewals.
However I can't find any plugin or method that allows me to offer the same subscription with different lengths (with discounts if the length exceeds a certain number of months).
For example:
3 months: -10%
6 months: -20%
12 months: -30%
It's currently impossible for a customer to buy multiple months of a subscription at once.
Do you know any solution ?
Thanks!
Maybe it'd be easier to just use a variable subscription?
https://woocommerce.com/document/subscriptions/store-manager-guide/#section-6
For the products in a cake shop, the cakes can get ordered for different order dates (order attribute) within the same order.
The stock should only be considered, if the cakes are ordered for the next day. For orders further in the future, the stock is irrelevant.
So I want to modify the cart that in get_cart_item_quantities() the item quantities get only grouped for cakes ordered for the next day.
So far, I managed to write a plugin extending the original cart and overriding get_cart_item_quantities()and add_to_cart().
But with the recent update, the plugin is no longer working due to new class hierarchies.
So I'm looking for a solution with standard filters and actions which is more update proof.
Can anyone help?
Here's more information on what I want to achieve:
The cakes can be ordered as a whole cake (12 or 16 pieces) – which is the main product – or as a variation of a quarter cake (3 or 4 pieces).
The shop keeper wants to manage the stock in number of pieces for the whole cake, not with the variations as well.
Moreover, the cakes can be ordered for next day delivery or sometime in the further future.
ONLY if the cake gets ordered for the next day, the stock should get checked.
Let's say there is 12 pieces of a cake in stock.
One customer buys a whole cake (12 pieces in this case) for tomorrow and a quarter for sometime next week.
When adding this to the cart, the cart should contain:
amount 1 of the whole cake for tomorrow
amount 1 of the quarter cake for sometime later
I add the delivery date in woocommerce_add_cart_item_data.
Internally, WC_Product::has_enough_stock() should check the stock only for the items ordered for tomorrow and in the actual number of pieces, in this case 12 for the whole cake for tomorrow (even though the amount in the cart is 1)
So far, I implemented the number of pieces by overriding WC_Cart::get_cart_item_quantities() and adding a custom filter.
And by overriding WC_Cart::add_to_cart() to modify has_enough_stock().
During checkout, I reduce the stock amount by the correct number of pieces by filtering woocommerce_order_item_quantity.
But of course, with the plugin solution I need to update the plugin with almost every update of WooCommerce.
The possibilities I see at the moment:
As WC_Product::has_enough_stock() is not applying any filters itself, I could filter woocommerce_product_variation_get_stock_quantity and return the actual quantity if the delivery date is relevant and return a fake number like 9999 in all other cases.
Like this, stock management should workg during add to cart, in the cart and during checkout when relevant.
What do you think?
I am working with Stripe subscription and I don't want to create different plans with xy users included but set the price simple to 10$ per user per month. See the pricing at https://www.box.com/en_GB/pricing/ to get an idea what I mean.
How can i realize that subscription behavior in Stripe? Do I need to create an own plan for every count of users? (eg. oneuserplan 10$, twouserplan 20$, threeuserplan 30$,.....)
Or can I somehow multiply the 10$/month base subscription with with the count of users?
You can find a quantity field in stripe documentation
The quantity you'd like to apply to the subscription you're creating.
For example, if your plan is $10/user/month, and your customer has 5
users, you could pass 5 as the quantity to have the customer charged
$50 (5 x $10) monthly....
Hi i’m developing a eCommerce site in Magento for jewellery business and its based on a “weight”, not the price because gold rate is changing in day by day or more then 3 times in a day.So it is not possible to change the product price every time according to gold rate. Then, how to manage the prices on this scenario?
Example case: Today I have added a 18K gold ring of 10gm to my site and right now gold rate is Rs30,000 per 10gm, so today price of this ring is Rs30,000 but, Next day the rate will be changed (Rs32,000 per 10gm) then, my product price must be changed from Rs30,000 to Rs32,000.
This is not possible to update the price of all products every time.
I am using Magento platform. Please, Share your idea regarding this situation.
To make this simple, you should work on a 2 ways solutions.
In the frontend, do not show price ($_product->getPrice()) but just show the real price according to weight.
Example if you have price/grm stored in the backend use $product->getWeight * Mage::getStoreConfig('mycompany/gold/dayprice').
That way price will be shown dynamically in the product page or list page.
Now you should use an Observer on the add to cart event to change the price to the good one.
This way, don't matter what price is set on the product because showing and adding will use the formulae.
I'm using Ubercart in Drupal for a simple web store. I'm having trouble calculating a product discount based on the total number of all products in the cart. For example, I'm easily able to define discounts for if a user buys more than one of the same product, using the uc_custom_price module. But I want to give the discount if they buy more than one of any product. If they buy item 1 for 10 dollars and then add item 2 for 10 dollars, then I want both items to now cost 8 dollars.
Hopefully this makes sense. I searched the forums and googled for a couple of hours, but I just can't get this to work correctly. Thanks for your help.
Check Rules + Ubercart module. Or write custom code on order creation