Plugin trigger method to change cart data on checkout

  • Posts: 634
  • Thank you received: 16
6 years 6 months ago #293029

-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.8
-- PHP version -- : 7.1

Hi,

I want to make a group of products that it's not going to be counted in the shipping calculation cost.

But I don't know which plugin trigger I have to use.

For example:



If I have 2 shipping methods:

Method A: Available from 0 € to 100 €

Method B: Available from 100€



In the cart I have 2 products:

Product A - Price: 50€

Product B - Price: 100€



In normal conditions, it only has to show the Method B.

But I want the price of Product B to not be count in the total calculation (only for shipping costs), so method A will be the one available to be selected.

I have searched in the Hikashop Documentation which method use and I didn't found anything that works exactly for this example.

What I have to do?

Thanks in advance.

--
Victor

Last edit: 6 years 6 months ago by PeterChain.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
6 years 6 months ago #293063

Hi,

You can move product B and product A in two different warehouses (that you can configure in the System>Warehouse menu.
Then, you configure you two shipping methods for the warehouse of the product A and you create a free shipping method for the warehouse of product B. That way, the products will be grouped based on their warehouse and each group will have its own shipping methods selection on the checkout.

More simply, you could just set a weight of 0 for that product B and a weight for product A and turn off the "include virtual product prices" setting in your shipping methods so that the price restrictions will ignore product B.

If you want to not do that and use a plugin instead, you could create a new shipping plugin based on the manual shipping plugin and add in it a trigger onShippingDisplay which would be based on the onShippingDisplay function in administrator/components/com_hikashop/helpers/helper.php where you would change the conditions on the prices.

The following user(s) said Thank You: PeterChain

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

Time to create page: 0.058 seconds
Powered by Kunena Forum