- Posts: 178
- Thank you received: 5
Delivery cost depending on categories
As you said, I edited "administrator\components\com_hikashop\helpers\helper.php" file.
My hack set own Delivery cost for each category. But if customer orders many items, Delivery cost is 0. I made video example .
Delivery cost is 500. And when total order > 4000 it should be 0. But checkout page don't check second time helper.php's function onShippingDisplay, until I change quantity.
Try for test write in helper.php:
How to update shipping_price after every page refresh?
Please Log in or Create an account to join the conversation.
Captured video example .
Why only quantity change can update delivery cost? Why it's not updated with page refresh?
Please Log in or Create an account to join the conversation.
HikaShop uses a cache for the shipping.
You can edit the file "administrator/components/com_hikashop/classes/shipping.php" and replace
For the next HikaShop release, we will improve that and let the shipping methods indicate if they want to use the shipping cache or not.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
In Production I use 2.3.0 version, not latest. It's the same hack there?
Please Log in or Create an account to join the conversation.
In order to disable the shipping cache : yes.
It is clearly not logical or regarding the code not possible.
If the shipping methods are not returned from cache, HikaShop will re-trigger the shipping plugins.
The other problem is that when you change a shipping method configuration, you change his modification date so it should invalidate the cache.
So I am more thinking about a browser/Joomla cache.
But if you want to test (and I am more than sure that it is working ; you can simply comment this code
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
What should I change now?
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Sorry for the late reply.
If you are still having your issue, can you download the last Hikashop version through our website, install it and then change that line :
Please Log in or Create an account to join the conversation.
Unfortunately I don't remember exactly what I did.
Edited \administrator\com_hikashop\helpers\helper.php
And then:
But don't work now. Something changed?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Jerome wrote: For the next HikaShop release, we will improve that and let the shipping methods indicate if they want to use the shipping cache or not.Regards,
You did this changes? Where I can disable shipping price cache in menu?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
You'll have to add that modification through the file "administrator/components/com_hikashop/classes/shipping.php"Unfortunately I don't remember exactly what I did.
Edited \administrator\com_hikashop\helpers\helper.php
Can you make sure that your "Auto submit shipping and payment methods selection" option is set to "Yes" via "Hikashop->System->Configuration->Checkout"How to change both by page refresh?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The shipping cache can be disabled by the shipping plugin itself when it requires that.For the next HikaShop release, we will improve that and let the shipping methods indicate if they want to use the shipping cache or not.Regards,
You did this changes? Where I can disable shipping price cache in menu?
So supposes that you're using the manual shipping plugin.
You would have to edit the file plugins/hikashopshipping/manual/manual.php file and add the line:
var $use_cache = false;
after the line:
class plgHikaShopshippingManual extends hikashopShippingPlugin {
so that the cache would be automatically disabled for all the payment methods of that plugin, without changing any code or setting.
Please Log in or Create an account to join the conversation.
nicolas wrote:
The shipping cache can be disabled by the shipping plugin itself when it requires that.For the next HikaShop release, we will improve that and let the shipping methods indicate if they want to use the shipping cache or not.Regards,
You did this changes? Where I can disable shipping price cache in menu?
So supposes that you're using the manual shipping plugin.
You would have to edit the file plugins/hikashopshipping/manual/manual.php file and add the line:
var $use_cache = false;
after the line:
class plgHikaShopshippingManual extends hikashopShippingPlugin {
so that the cache would be automatically disabled for all the payment methods of that plugin, without changing any code or setting.
Added but nothing changed. When change shipping method cost in backend, it doesn't change in checkout until change quantity.
Maybe you can check it. I can give test access.
Please Log in or Create an account to join the conversation.
I had a hard time trying to reproduce the problem as I don't see the shipping methods selection area, I can click on the button, I don't read your language, etc.
I don't understand why I get "Стоимость доставки зависит от выбранного заведения." instead of the shipping price. There is no system in HikaShop for that.
What the shipping methods caching system does is that when nothing changes in the cart, the shipping methods displayed in the shipping methods selection interface are not updated. When it is turned off, the shipping methods will be recalculated for that view of the checkout.
However, it doesn't act on the shipping method selected for the cart. When it is selected, its data is stored in the session so that it can be directly used on the cart view without having to calculate all the shipping methods.
So if you're talking about the shipping fee in the cart, adding the use_cache attribute in your shipping method won't change anything. It will only change for the shipping methods selection area where the price of each shipping methods available is displayed for the customer to select one among them.
Please Log in or Create an account to join the conversation.
In Shipping method delivery cost update OK when page refresh. But Total value calculated not with this value (920). Total use Shipping (900) under Subtotal. I thought this values (Shipping and Shipping Method) should be the same, but they are not.
Please Log in or Create an account to join the conversation.
As I said, in my previous message, that's normal that the rate in the cart doesn't change if the data in the session is not updated.
It's different from the cache system.
But I don't see why that is a problem.
What you're talking about will only happen when you change shipping fees in the backend, and it's not something you change much normally.
Please Log in or Create an account to join the conversation.