- Posts: 178
- Thank you received: 5
Delivery cost depending on categories
How can i arrange for each category to have its own delivery cost and amount of minimal order?
For example:
| Category | Delivery cost | Minimal order |
| AUTOMOBILE | 15$ | 300$ |
| COMPUTING | 25$ | 150$ |
| FASHION | 7$ | 100$ |
For example, the minimal amount of your order in AUTOMOBILE category is 300 USD, while the minimal order for FASHION category is 100 USD. Delivery price for AUTOMOBILE is 15 USD and for FASHION is 7 USD. The total for delivery is 22 USD.
That is, if you select, at least, one item from a category, the delivery price will increase by the amount of delivery price for that category. The order will not be placed until you purchase the number of items for the minimum amount of order for that category.
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
1. Regarding the delivery cost per category, the best solution would be to :
- Create 3 shipping methods (one shipping method per category)
- Use the "Use the prices per product" option of your manual shipping method.
- Set a price for each and a minimum quantity products through the "Shipping prices" tab of each product's page regarding their category.
2. Regarding the maximum order price, I think that you'll just have to set a minimum price in your manual shipping methods and the users won't be able to finish the checkout under that price.
Hope this will help you a little.
Please Log in or Create an account to join the conversation.
Mohamed Thelji wrote: Hi,
1. Regarding the delivery cost per category, the best solution would be to :
- Create 3 shipping methods (one shipping method per category)
- Use the "Use the prices per product" option of your manual shipping method.
- Set a price for each and a minimum quantity products through the "Shipping prices" tab of each product's page regarding their category.
2. Regarding the maximum order price, I think that you'll just have to set a minimum price in your manual shipping methods and the users won't be able to finish the checkout under that price.
Hope this will help you a little.
If I set a price for each products and then add two products from one category, total delivery cost will count twice. But should count once despite how many products I added from this category, one or all.
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
You could set a volume/weight for the products in that category and use volume/weight restrictions in order to choose what shipping method you'll display regarding products categories. Moreover I think that the best solution was to use the prices per product option.
Please Log in or Create an account to join the conversation.
Then edit components/com_hikashop/views/checkout/tmpl/cart.php
Add there:
And
Now it count delivery for every category separately.
Please Log in or Create an account to join the conversation.
How can I insert it in hikashop_order.order_shipping_price field for the order? In which file calculating delivery cost?
Please Log in or Create an account to join the conversation.
Because with the way you're modifying the code, your payment methods won't get the shipping price. The emails neither, the invoice neither and the backend edition neither etc.
Please Log in or Create an account to join the conversation.
nicolas wrote: It would be better to modify the plugins/hikashopshipping/manual/manual.php file to handle custom shipping fee calculation in the onShippingDisplay function rather than trying to edit all the code of HikaShop which will use the shipping price.
Because with the way you're modifying the code, your payment methods won't get the shipping price. The emails neither, the invoice neither and the backend edition neither etc.
Thanks. After
add
Please Log in or Create an account to join the conversation.
nicolas wrote: It would be better to modify the plugins/hikashopshipping/manual/manual.php file to handle custom shipping fee calculation in the onShippingDisplay function rather than trying to edit all the code of HikaShop which will use the shipping price.
Because with the way you're modifying the code, your payment methods won't get the shipping price. The emails neither, the invoice neither and the backend edition neither etc.
What file I should edit in Hikashop 2.2.3 version? There is no onShippingDisplay function now.
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
The file that you'll ave to edit will be the "administrator\components\com_hikashop\helpers\helper.php" file, but note that the "onShippingDisplay" is generic and used for each shipping method, so a solution can be to copy the onShippingDisplay of the file helper.php through your manual.php and edit it as you want.
Please Log in or Create an account to join the conversation.
Can you help me please?Mohamed Thelji wrote: Hi,
The file that you'll ave to edit will be the "administrator\components\com_hikashop\helpers\helper.php" file, but note that the "onShippingDisplay" is generic and used for each shipping method, so a solution can be to copy the onShippingDisplay of the file helper.php through your manual.php and edit it as you want.
I copy my code from manual.php to helper.php, but it don't work anymore.
Please Log in or Create an account to join the conversation.
Delivery price output was echo $this->currencyHelper->format(@$this->shipping->shipping_price,$this->shipping->shipping_currency_id);. Now I look it's $shipping_price += $shipping->shipping_price;
Maybe in 2.2.3 I should change something else?
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Can you show me how did you set your "onShippingDisplay" function, so that I will maybe be able to understand the issue that you are having ?
Please Log in or Create an account to join the conversation.
I did as I did in previous version. Edit helper.php instead manual.php.Mohamed Thelji wrote: Hello,
Can you show me how did you set your "onShippingDisplay" function, so that I will maybe be able to understand the issue that you are having ?
Inseart my query at the beginning.
And
Please Log in or Create an account to join the conversation.
$rates[] = $rate;
$rates[0]->shipping_price=$col2_sum;
you should rather do:
$rate->shipping_price=$col2_sum;
$rates[] = $rate;
For the rest, it looks ok to me.
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
I think that you should replace this line :
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Mohamed Thelji wrote: Hi,
I think that you should replace this line :By :Code:$rate->shipping_price=$col2_sum;Code:$rate->shipping_price+=$col2_sum;
Nothing has changed.
Please Log in or Create an account to join the conversation.
But I have one shipping method in options.
Please Log in or Create an account to join the conversation.