shipping cost appear to double

  • Posts: 59
  • Thank you received: 2
2 years 7 months ago #340716

-- HikaShop version -- : 4.5.0
-- Joomla version -- : 3.10.6
-- PHP version -- : 7.4.19
-- Browser(s) name and version -- : Firefox 99.0

Hi,
we need your help, we are configuring the shipping costs in the online store, we have already defined and made the necessary restrictions to work, however we are using the warehouses to define items in which the shipping costs are fixed.
And if we add to the cart a product with fixed shipping and another that does not have fixed shipping, they will be charged twice and we do not intend it to be that way, in this case the ideal for us would be to just charge the highest amount of shipping.
Is it possible to make some configuration to make it work this way?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 7 months ago #340719

Hi,

The goal of warehouses is precisely to be able to charge separate shipping costs for different groups of products.
So since you don't want that, it means you don't want to use warehouses.

An alternative is to have only one set of shipping methods, with their "shipping price per product" setting activated.
That way, in each product, you'll have a "shipping prices" section where you'll be able to add extra fees to the different shipping methods when the product is in the cart and also use the "block" checkbox to remove shipping methods when the product is in the cart.

Please Log in or Create an account to join the conversation.

  • Posts: 59
  • Thank you received: 2
2 years 5 months ago #342150

Hi Nicolas, thanks for the reply,

The intent of the client is to charge only the highest shipping cost once. for example

In one order there are 3 items.

  • Item 1 shipping cost 50 €
  • Item 2 shipping cost 10 €
  • Item 3 shipping cost 20€
in this case the shipping cost of the total order should be only 50 €. the other 2 are discarded.

is it possible? if so, how?

thank you.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 5 months ago #342161

Hi,

I think it's somewhat possible.
In that case, you need to configure one manual shipping method for each price point with the shipping cost entered in its "price" setting. And in each shipping method, you need to activate the "shipping price per product" setting.
Then, in each product edit form, you'll have an extra area "shipping prices".
In the Item 1, you want to block the 10€ and 20€ shipping methods.
In the Item 2, you don't want to do anything there.
In the Item 3, you want to block the 10€ shipping method.
That way, on the checkout, a shipping method will only appear if no products in the cart block it.

The problem with this is that if for example you have only Item 2 in the cart, all three shipping methods will be available.
One way to go about it to make sure that the shipping methods are ordered from the cheapest to the most costly and turn on the "real only" setting of the "shipping" view in the checkout workflow. That way, only the cheapest available shipping method will be selected and the others won't show up.
However, there is a catch:
- if you add Item 1, the shipping cost will be 50€ as that's the only one available
- if you then add Item 2, the shipping cost will still be 50€ as that's still the only one available
- if you remove Item 1, the shipping cost will still be 50€ as all three shipping methods are available and the 50€ was already selected before.
It would require the development of a small plugin to reset the shipping method selected each time a product is removed from the cart and then it should work like someone would expect.

Please Log in or Create an account to join the conversation.

  • Posts: 59
  • Thank you received: 2
2 years 5 months ago #342166

Hi nocolas,

thank you,

the development of that plugin is something that hikashop could do and sell ?

how mutch would it cost if so?.

thank you.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 5 months ago #342168

Hi,

Selling such a plugin seems disproportionate as it's just a few lines of code.

Technically, you should be able to do it with only one or two lines of code at the correct place in the code of a core file of HikaShop.
For example, you could try adding the line:
$cart->cart_shipping_ids = '';
after the line:
$this->app->triggerEvent('onAfterCartCouponLoad', array( &$cart ) );
in the file administrator/components/com_hikashop/classes/cart.php
That would reset the shipping method selected each time the cart is loaded, making sure it is always the first one which is selected.

Another would be to add:
if($this->db->getAffectedRows()>0) {
$element->cart_shipping_ids = '';
parent::save($element);
}
before the line:
foreach($updates as $cart_product_id => $update) {
in the same file.
That would reset the shipping method selected when a product is being deleted from the cart.

What might be more difficult is unforseen issues as I haven't tested either possibilities, but yes, it could definitely be made as plugin. That would be better than directly modifying a core file of HikaShop so that you don't have to worry about updates in the future.
If you want us to work on that plugin for you, we should be able to do it for 80€. But any PHP developer, even with basic skills should be able to develop such a plugin.
You can use our contact form if you want us to work on it for you:
www.hikashop.com/support/contact-us.html

Please Log in or Create an account to join the conversation.

  • Posts: 59
  • Thank you received: 2
2 years 5 months ago #342252

Hi nicolas, thanks for the reply,

it almost works, but notice one thing.

there is a free shipping cost if the item is picked up directly from the store.

and that one gets selected.
otherwise it looks like it'ts working.

any ideas how to still alow free pickup shipping?

thank you

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 5 months ago #342256

Hi,

In that case, all I wrote above is useless.
If you want the user to be able to select between shipping and free pickup, you need to allow the display of the shipping methods selection.
In that case, the only solution I can see is the development of a shipping plugin to properly handle the selection of the shipping method and remove the others so that only the pickup shipping method and the normal shipping method with the correct shipping cost are left. I think it would cost 200€ to develop such a plugin.
That's possible but a bit more costly to do.

Please Log in or Create an account to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum