[Skip to main content](#vessel-content)

#   Shipping Fee for Specific Zone (in addition to shipping rate)

##

- **[gpraceman](/forum/user/37240-gpraceman "View gpraceman's Profile")**
- [![gpraceman's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar37240.png)](/forum/user/37240-gpraceman "View gpraceman's Profile") Topic Author
- [ Offline](/forum/user/37240-gpraceman)

Less More

- Posts: 166
- Thank you received: 11
-
- [](http://grandprix-software-central.com)
-

3 years 9 months ago [\#348292](#348292) by [gpraceman](/forum/user/37240-gpraceman "View gpraceman's Profile")  *[Shipping Fee for Specific Zone (in addition to shipping rate)](/forum/40-taxes/905709-shipping-fee-for-specific-zone-in-addition-to-shipping-rate#348292 "-- HikaShop version -- : 4.7.0 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.3.33  Our state of Colorado has instituted a Retail Delivery Fee. The fee is a flat $0.27 USD and applies to any order we ship to customers within the state of Colorado and is on top of the shipping rate. We have virtual products in addition to physical products, so it will not apply to all of our Colorado customers. This fee must be listed separately, not added to the shipping charge. Is there a way to configure this in HikaShop?")* was created by *[gpraceman](/forum/user/37240-gpraceman "View gpraceman's Profile")*

-- HikaShop version -- : 4.7.0
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.3.33

Our state of Colorado has instituted a Retail Delivery Fee. The fee is a flat $0.27 USD and applies to any order we ship to customers within the state of Colorado and is on top of the shipping rate. We have virtual products in addition to physical products, so it will not apply to all of our Colorado customers. This fee must be listed separately, not added to the shipping charge. Is there a way to configure this in HikaShop?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzkwNTcwOS1zaGlwcGluZy1mZWUtZm9yLXNwZWNpZmljLXpvbmUtaW4tYWRkaXRpb24tdG8tc2hpcHBpbmctcmF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14299
-
-

3 years 9 months ago [\#348295](#348295) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Shipping Fee for Specific Zone (in addition to shipping rate)](/forum/40-taxes/905709-shipping-fee-for-specific-zone-in-addition-to-shipping-rate#348295 "-- HikaShop version -- : 4.7.0 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.3.33  Our state of Colorado has instituted a Retail Delivery Fee. The fee is a flat $0.27 USD and applies to any order we ship to customers within the state of Colorado and is on top of the shipping rate. We have virtual products in addition to physical products, so it will not apply to all of our Colorado customers. This fee must be listed separately, not added to the shipping charge. Is there a way to configure this in HikaShop?")*

Hi,

I'm afraid this will require some coding.
This plugin can add a flat fee to orders:
[ www.hikashop.com/marketplace/product/224-global-cart-fee.html](https://www.hikashop.com/marketplace/product/224-global-cart-fee.html)
However, it doesn't have options to restrict the fee based on the location of the user or the weight of the products (no weight means virtual product). So it would require modifying that plugin to add these restrictions in it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzkwNTcwOS1zaGlwcGluZy1mZWUtZm9yLXNwZWNpZmljLXpvbmUtaW4tYWRkaXRpb24tdG8tc2hpcHBpbmctcmF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[gpraceman](/forum/user/37240-gpraceman "View gpraceman's Profile")**
- [![gpraceman's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar37240.png)](/forum/user/37240-gpraceman "View gpraceman's Profile") Topic Author
- [ Offline](/forum/user/37240-gpraceman)

Less More

- Posts: 166
- Thank you received: 11
-
- [](http://grandprix-software-central.com)
-

3 years 9 months ago [\#348327](#348327) by [gpraceman](/forum/user/37240-gpraceman "View gpraceman's Profile")  Replied by *[gpraceman](/forum/user/37240-gpraceman "View gpraceman's Profile")* on topic *[Shipping Fee for Specific Zone (in addition to shipping rate)](/forum/40-taxes/905709-shipping-fee-for-specific-zone-in-addition-to-shipping-rate#348327 "-- HikaShop version -- : 4.7.0 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.3.33  Our state of Colorado has instituted a Retail Delivery Fee. The fee is a flat $0.27 USD and applies to any order we ship to customers within the state of Colorado and is on top of the shipping rate. We have virtual products in addition to physical products, so it will not apply to all of our Colorado customers. This fee must be listed separately, not added to the shipping charge. Is there a way to configure this in HikaShop?")*

> nicolas wrote: Hi,
>
> I'm afraid this will require some coding.
> This plugin can add a flat fee to orders:
> [ www.hikashop.com/marketplace/product/224-global-cart-fee.html](https://www.hikashop.com/marketplace/product/224-global-cart-fee.html)
> However, it doesn't have options to restrict the fee based on the location of the user or the weight of the products (no weight means virtual product). So it would require modifying that plugin to add these restrictions in it.

Well, that at least gives me a starting point. I'll have a go at modifying that plug-in. I assume that I can glean some code from the shipping plugins on restricting it to a specified zone and a minimum weight.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzkwNTcwOS1zaGlwcGluZy1mZWUtZm9yLXNwZWNpZmljLXpvbmUtaW4tYWRkaXRpb24tdG8tc2hpcHBpbmctcmF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86540
- Thank you received: 14299
-
-

3 years 9 months ago [\#348332](#348332) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Shipping Fee for Specific Zone (in addition to shipping rate)](/forum/40-taxes/905709-shipping-fee-for-specific-zone-in-addition-to-shipping-rate#348332 "-- HikaShop version -- : 4.7.0 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.3.33  Our state of Colorado has instituted a Retail Delivery Fee. The fee is a flat $0.27 USD and applies to any order we ship to customers within the state of Colorado and is on top of the shipping rate. We have virtual products in addition to physical products, so it will not apply to all of our Colorado customers. This fee must be listed separately, not added to the shipping charge. Is there a way to configure this in HikaShop?")*

Well, yes and no. The shipping plugins extend the hikashopShippingPlugin class.
The code which checks the weight comes from that class hikashopShippingPlugin so the code is not directly in the plugins.
This class is defined in the file administrator/components/com_hikashop/helpers/shippingplugin.php so that's where you want to look.
The code is in the function onShippingDisplay. You will be able to use it quite easily in the global cart fee plugin code.

For the zone, the simplest is to get the current zone id with the function hikashop_getZone(). Then, you can just check it against the id of the colorado state zone you can get from System&gt;Zones.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzkwNTcwOS1zaGlwcGluZy1mZWUtZm9yLXNwZWNpZmljLXpvbmUtaW4tYWRkaXRpb24tdG8tc2hpcHBpbmctcmF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[gpraceman](/forum/user/37240-gpraceman "View gpraceman's Profile")**
- [![gpraceman's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar37240.png)](/forum/user/37240-gpraceman "View gpraceman's Profile") Topic Author
- [ Offline](/forum/user/37240-gpraceman)

Less More

- Posts: 166
- Thank you received: 11
-
- [](http://grandprix-software-central.com)
-

3 years 9 months ago [\#348353](#348353) by [gpraceman](/forum/user/37240-gpraceman "View gpraceman's Profile")  Replied by *[gpraceman](/forum/user/37240-gpraceman "View gpraceman's Profile")* on topic *[Shipping Fee for Specific Zone (in addition to shipping rate)](/forum/40-taxes/905709-shipping-fee-for-specific-zone-in-addition-to-shipping-rate#348353 "-- HikaShop version -- : 4.7.0 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.3.33  Our state of Colorado has instituted a Retail Delivery Fee. The fee is a flat $0.27 USD and applies to any order we ship to customers within the state of Colorado and is on top of the shipping rate. We have virtual products in addition to physical products, so it will not apply to all of our Colorado customers. This fee must be listed separately, not added to the shipping charge. Is there a way to configure this in HikaShop?")*

> nicolas wrote: Well, yes and no. The shipping plugins extend the hikashopShippingPlugin class.
> The code which checks the weight comes from that class hikashopShippingPlugin so the code is not directly in the plugins.
> This class is defined in the file administrator/components/com\_hikashop/helpers/shippingplugin.php so that's where you want to look.
> The code is in the function onShippingDisplay. You will be able to use it quite easily in the global cart fee plugin code.
>
> For the zone, the simplest is to get the current zone id with the function hikashop\_getZone(). Then, you can just check it against the id of the colorado state zone you can get from System&gt;Zones.

I did just a quick down and dirty change, which looks to be working. I replaced the last line of code with the code below. As a feature request, it would be nice to provide a more flexible plugin by allowing the user to restrict by a selected zone and if only for orders with shipping.
Code:

$physicalProduct = false; foreach($cart-&gt;products as $product) { if (isset($product-&gt;product_weight) &amp;&amp; $product-&gt;product_weight &gt; 0) { $physicalProduct = true; break; } } if ($physicalProduct &amp;&amp; $cart-&gt;shipping_address-&gt;address_state[0] == 'state_Colorado_4266') { $cart-&gt;additional['global_cart_fee_'.$plugin] = $additional; }

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzkwNTcwOS1zaGlwcGluZy1mZWUtZm9yLXNwZWNpZmljLXpvbmUtaW4tYWRkaXRpb24tdG8tc2hpcHBpbmctcmF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.051 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
