Remain constant Woocommerce prices regardless of tax rate - B2C - php

Note - im new, so please be kind. If anything isnt clear please tell me, so i can improve my questioning!
As a person who lives in europe and sells products to end-consumers, the following problem is very ipmortant and in my opinion heavily under-prioritised.
There are a lot of conversation regarding this issue. In the following one #MikeJolley (owner of the wocommerce github repository) was also involved(github.com issues/4131) and linked to the site - How Taxes Work in WooCommerce where you can find the following filter to remain the prices constant regardless of the tax rate
add_filter( 'woocommerce_adjust_non_base_location_prices', '__return_false' )
By using the filter you can achieve the following:
Example 1: Selling from GB (with their 20% tax rate) to Germany. The price of the product is 9.99 including tax. GB based sellers do not need to charge tax for physical goods in Germany.
Price = 9.99 (the same)
Tax = 0 (no tax is charged
The German would pay 9.99 for the product, the same as GB people.
Example 2: Let's take the same above example, but consider a digital good where tax would apply of the rate 19%.
Price = 9.99 (the same)
Tax = 9.99 / 1.19 = 8.39 (slightly less than GB)
The German would again pay 9.99
The Problem:
For a few weeks i put the filter in my functions.php and solved the isse, unfortunately after the last Woocommerce update the mentioned filter triggers the following post call - wich executes in a infinite loop - again and again (see firebug network tab).
https://testsite.com/online-shop/?wc-ajax=get_refreshed_fragments
My request
Any idea how to solve this Problem - or any other way to remain the prices constant? Im not interested in heavy or paid Plugin solution wich slow down my site. Thank you so much
EDIT:
After some research i came across with the following:
Refresh fragments infinite loop #10940 and Fix for #10940 - wc_cart_hash
It seems there is woocommerce bug wich is still not resolved entirely. I closed my other windows and the problem is gone. What a waste of time...

After some research i found the problem. It is a woocommerce core problem - look at Refresh fragments infinite loop #10940 and Fix for #10940 - wc_cart_hash
wc_cart_hash was used as a key for localStorage
for all WooCommerce sites. If you were to load your
cart for two different sites in the same browser,
the two WooCommerce pages would contend over this key
and loop on trying to set this key in the localStorage
This commit prepends the site's ajax URL onto the wc_cart_hash
key name in localStorage, providing a unique key for each
WooCommerce site. This ends contention over the keys.
It seems the woocommerce bug is not resolved entirely...
I closed my other windows and the problem is gone. Hope this helps others with the same problem.
UPDATE:
The problem also happens if you open a new Tab where you view a live preview (under Appearance - Themes) of another woocommerce theme in the backend... In my case i checked a few changes of a earlier theme.

Related

Woocommerce cart items keep reappearing

i made a video of the woocommerce cart issue a friend of mine has with his store https://streamable.com/augha
i cannot reproduce it here, on other pc's. Nor can i reproduce it on my mobile phone.
This was yesterday... But now today the problem seems to be expanding to the moment it seems that customers from belgium are also getting this problem. In the past we have never had problems with Belgium, and yesterday we also received a Belgian order with several articles without any problems.
But another order we have to make a payment link because he did not manage to get more than 4 items in the basket.
The remarkable thing I find that the Belgian where we made a payment link initially got 15 hoodies in his shopping basket, and the next day the basket was empty and he could add up to 4.
So it seems that in certain occasions the cart will go fubar... Anyone else experienced this ?
It looks like a caching issue. You may want to try disabling all other plugins to see if that helps.

Magento 1 wrong Shipping rates

we are using Webshopapps Product Matrix Rates pro version
after asking the developers of this extension they are saying that it's NOT the extension that is causing the issues as the logs say it's returning the correct values.
We have a shipping matrix setup for UK postcodes that requires a delivery charge for certain UK postcodes this is on a multi site setup which as 2 sites.
What should happen is per pallet added to the cart it should add £4.80 where a charge is required based on the postcode entered, so If I have 2 pallets the shipping cost to the postcode would be £9.60 and £4.80 for each extra pallet added there after, for the economical 2-3 day delivery.
On site one if I add 5 pallets the shipping cost is coming back at £28.80 where it should be £24
On site two If I add 5 Items the shipping cost is coming back at £9.60
I have no Idea why it is doing this as both sites are using the same code / theme apart from the logo and CSS for the colours of the site.
If anyone has any suggestions for a fix it would be much appreciated.
sorry I can't put code here or setting as I have no idea what I need to post for you to view.
Regards
Mal
Sorted, turns out after the developers going through the logs and a lengthy chat, which the boss remembered something very important they had done on the products on the other site I was trying to match, once I found this out it all made sense and got it working correctly, so there wasn't any bugs and it's working correctly all along ARGH!!!!
Basically any products on the first site where the weight was over 850KG was set to 850KG regardless.
on the new site the correct weights have been added, so anything over 850KG was adding the extra cost, then they didn't update the CSV to reflect this.

Magento - Display cart shipping cost in 'Cart View'

I've setup a german magento store and I'm struggling with displaying the total shipping cost.
This problem is really bugging me. I try to display the total shipping cost in the magento 'cart view' (Just one tiny step before the checkout).
I've setup table-based shipping and it's working fine in the checkout process at least...
I tried googling before asking this question but none of the answers helped me at all because most of them are over 3 years old.
My question in short:
Is it possible to get the shipping cost (based on the current items in cart) via PHP?
Is there a specific block or helper I can call to get the shipping cost?
I wan't to get the shipping cost at grandtotals.php in %my-theme%/template/tax/checkout/grandtotal.php
I've tried the following solutions:
<?php $k = Mage::getSingleton('checkout/cart')->getQuote()->getTotals();
echo $k['shipping']->getData('value'); ?>
or:
Mage::getSingleton('checkout/cart')->getQuote()->getGroupedAllShippingRates();
and several other solutions. Maybe these don't work for magento 1.8?
Could you guys give me a clue or possibly a super short tutorial how to set up these Magento Event Observer?

Custom Shipping Rate

I'm trying to customize my onepage checkout in magento. The process is to place orders to the company. Apparently I have set a custom table rate in magento where in I have 2 choices. First choice is Victoria (Australia), where in depending on item size there is a fixed rate for that, while the rest of Australia has the same rate.
Apparently when I use my onepage checkout, I encounter 2 errors:
1st error is that when I am in guest mode, when I fill up the billing information, after I go to the shipping method, it says that my shipping method is unavailable, even if I had already inputted the correct address.
My second error is that when I am using a customer account, everything works fine for the 1st time, then if I try to place another order, it shows the error.
I'm thinking of two ways right now to solve it:
Since I need to fix the problem right away, could I remove the shipping method altogether and just create my own computation at the review tab and save the shipping fee in the end?
Or I try to fix the problem on how the shipping method works?
I found matrix-rate free plugin for magento online. A great alternative instead of manipulating it in the backend. I tried it and it immediately worked, though you need to check if you have the data you need in your database. Use the same steps as you were in modifying table rates, as there will be a new tab for the matrix-rate plugin in the configuration->shipping methods tab.

Payment Options not appearing in Magento

a bit of a funny one for you this afternoon.
This is in Magento 1.5.1.0...
Essentially, my website sells products that are free (£0.00) however the customer has to pay for delivery. The problem that I’m having, is that at checkout, the Payment Methods simply doesn’t load whenever the basket sub total is 0. Even when the Grand Total with Shipping is an amount.
I’m running One Step Checkout, however it doesn’t work on the default One Page Checkout either.
I’ve tried everything, and I’m certain that it’s not got anything to do with the Payment Gateways that I’m using.
I tried the same thing on another site of mine, that’s running 1.4 and it works fine on there?
You can see a screenshot of the page with the problem here...
Any help would be really appreciated.
Check that you have: "Zero Subtotal Checkout" enabled under: System -> Configuration -> Payment Methods.
Subtotal is pre shipping, tax and discounts, this payment option exists specifically for your circumstance.

Categories