Why do tax and subtotal equal 0 in Magento when a customer with a coupon code adds a bundle to their cart? - magento

If a customer is logged in and chooses a bundle product and puts it into their shopping cart, everything is okay. All Taxes and Subtotals are included if I look into the invoice.
A special customer has a 5% discount of every product (via a shopping cart rule) and chooses a bundle product and put its into the shopping cart. Again, everything is okay.
But if the special customer adds a coupon code (about 20€), the tax and the subtotal equals 0 and the price is not correct. It equals something magical.

Change the variable data type from int to float. You are likely using Data Type integers, which can not represent decimal places (e.g .0001). Therefore, your numbers are being rounded down and changing results. Hope this helps, if not, please post your code so we can actually help rather than making assumptions.

Related

WC: Negative Stock from Order while Backorder is disabled

This is my problem: a customer bought a product that was out of stock. So the stock went from 0 to -1.
My out of stock threshold is at 0 and back ordering is disabled with all products.
I tried to recreate the scenario on my staging site but it was not possible to me. The product is greyed out and not selectable when I set its quantity to 0.
I thought maybe some caching issue (I'm using Hummingbird) prevented it from updating the stock. So these were the further scenarios I tried:
- selecting product on single product page, set stock in back-end to 0 --> not possible
- product in basket, set stock in back-end to 0 --> not possible
- product in checkout, set stock in back-end to 0 --> not possible
Would anyone of you know how it could have happened? I'm not sure how to proceed.
thanks
Jan
After carefully reading the WooCommerce source code I think you can recreate the problem if you have two computers.
Consider a product P with stock quantity equal to 1. There are 2 different customers A and B. Customer A puts product P into his cart. Before customer A places his order customer B puts product P into his cart. Then customer A places his order reducing the stock quantity of product P to 0. Then customer B places his order reducing the stock quantity of product P to -1. Unfortunately to test this it requires two computers (or two browsers) since you need two simultaneously logged in customers. I only have one computer and don't want to install another browser.
The problem is in the function WC_Cart::add_to_cart(). It calls WC_Product::has_enough_stock() with references to only the stock quantity of the product and the quantity ordered in its cart. It doesn't not take into account the quantities of the product that exists in other carts. In fact WooCommerce should be able to do better as it has knowledge of the contents of customer A's cart when customer B adds product P to his cart A.
Of course there is a bit of a dilemma here because if WooCommerce prevents customer B from adding product P to his cart because customer A has it in his cart and customer A doesn't actual place the order then the company may have lost a sale.
Alternatively, WooCommerce can reject customer B's order when B places the order but unless I missed something I did not see any code to do that. That would seem to me to be a reasonable solution.

Magento coupon code for multiple time use until offer value zero

I need a coupon code in magento. But the condition is one user can use the code more then one time. But cant't get more discount then code discount amount.
Like admin create a coupon code of $100 fixed amount. But my first order total $70. So if I use this code I will get $70 discount. For next when I use same code, I want $30 discount. That process will go until I get full amount($100) of discount.
Is that possible in magento?

Magento Shopping Cart Rules Buy X get 10% off everything

I'm having some problems getting my Magento Cart Rules to apply.
What I am trying to do is encourage users to purchase gift cards, so if you purchase a gift card you get 10% off the entire transaction assuming you purchase 2 or more items (including the gift card).
This is what I am using at the moment:
In Conditions
If ALL of these conditions are TRUE :
Total Items Quantity equals or greater than 2
If an item is FOUND in the cart with ANY of these conditions true:
SKU is 7667 (Gift Card)
In Actions
Apply Fixed amount discount for whole cart
Discount Amount 10
All the rest are as default.
Any help would be greatly appreciated
Your conditions seem to be correct. But in actions you have defined a fixed amount discount instead of a percent discount.
In Actions:
Apply Percent of product price discount
Discount Amount 10
Also you have to keep in mind that this way someone could simply put 2 giftcards in his cart to get the discount. You should add another rule check for an item where SKU IS NOT 7667.

Magento - VAT for shipping

I'm trying to figure out where to locate the function(s) that set the VAT for the shipping in Magento; both in the checkout and in the order made by the customer. If possible, the last function that is run that calculates the final VAT for the shipping might be the best one to override. The thing is that I want to make the VAT for shipping vary depending on the VAT on the products in the cart.
Take for example two products that cost 100$ each.
One product has a 25% VAT, while the other product has a 12.5% VAT.
Now, what I'd like to do is to calculate the VAT of the shipping by running the following calculation:
((100*25)+(12.5*100))/200 = 18.75
This would mean that the VAT on the shipping would be 18.75%.
While I'm on it, I also wonder how to get the VAT for each product in the cart, since each product can have a different tax-class.

Magento - How can I add a non-taxable fee to a taxable product?

We are using Magento EE 1.12. We have associated fees with individual products that cannot be taxed, however the product itself can be. The desired solution will be similar to a custom option where the fee is included on the same line item as the product and included in the product's price and therefore in the order subtotal. The only problem with a custom option is that the fee is taxed along with the product.
We've gone through several scenarios but I think the most likely solution is to use a custom option, but after the tax has been calculated we will reduce the tax to the correct amount. We tax on the subtotal and shipping. We will have access to the amount of fees so we can get the tax on that total and reduce the order tax amount.
Does this seem like a good solution? Does anyone have other ideas?
Make it a bundle product, and put in a product which is not taxable.

Resources