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

#   Update Shipment Prices

##

- **[mike](/forum/user/8167-mike "View mike's Profile")**
- [![mike's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/8167-mike "View mike's Profile") Topic Author
- [ Offline](/forum/user/8167-mike)

Less More

- Posts: 110
- Thank you received: 4
-
-

13 years 11 months ago [\#74276](#74276) by [mike](/forum/user/8167-mike "View mike's Profile")  *[Update Shipment Prices](/forum/2-general-talk-about-hikashop/74276-update-shipment-prices#74276 "Hello there  I started to explore the Manual Shippment Plugin of HikaShop to learn how the things work, so that I can write my own module, fitting the need of my business / Swiss Post System.  I have the need, that I can send things with a special additional server called &quot;Eingeschrieben&quot;. It means, that the Swiss Post guarantes the delivery or send the letter/packet back to the sender.  Therefore I added an additional field on the product (since this is something that the kind of the product demands in my case). I added the field product&#95;delivery&#95;options to product table and the possible value can be: &quot;registered&quot; or &quot;registered-personally&quot;.  I have added the following code to manual.php of the manual shipping plugin to the function &quot;onShippingDisplay(...)&quot;. It's just to try out a little bit the mechanics of the plugins: (Ignore the maximum&#95;height stuff for the moment... this is another requirement):  My problem is, that the rates are not updated. I can't see the updated amount in the Checkout-Process and also in the NetBeans IDE, there seems to be no change for shipping&#95;price. What am I doing wrong? Why can't I change the shipping price? Maybe it's a PHP-Related thing and has nothing todo with HikaShop, but I stuck and therefore I'm asking if there is a trick or something I miss.  Thanks for your help and best regards Mike")* was created by *[mike](/forum/user/8167-mike "View mike's Profile")*

Hello there

I started to explore the Manual Shippment Plugin of HikaShop to learn how the things work, so that I can write my own module, fitting the need of my business / Swiss Post System.

I have the need, that I can send things with a special additional server called "Eingeschrieben". It means, that the Swiss Post guarantes the delivery or send the letter/packet back to the sender.

Therefore I added an additional field on the product (since this is something that the kind of the product demands in my case). I added the field product_delivery_options to product table and the possible value can be: "registered" or "registered-personally".

I have added the following code to manual.php of the manual shipping plugin to the function "onShippingDisplay(...)". It's just to try out a little bit the mechanics of the plugins:
(Ignore the maximum_height stuff for the moment... this is another requirement):
Code:

$overall_maximum_height = 0; $overall_has_signature = false; $overall_has_signature_personal = false; foreach($order-&gt;products as $k =&gt; $row) { if($row-&gt;product_height &gt; $overall_maximum_height) { $overall_maximum_height = $row-&gt;product_height; } if(strcasecmp($row-&gt;product_delivery_options, "registered") == 0){ $overall_has_signature = true; } if(strcasecmp($row-&gt;product_delivery_options, "registered-personally") == 0){ $overall_has_signature_personal = true; } } foreach($rates as $k =&gt; $rate){ if($overall_has_signature) { $rates[$k]-&gt;shipping_params-&gt;shipping_price_orig = $rates[$k]-&gt;shipping_params-&gt;shipping_price; $tempShippingPrice = (float)$rates[$k]-&gt;shipping_params-&gt;shipping_price; $rates[$k]-&gt;shipping_params-&gt;shipping_price = $tempShippingPrice + 5.0; } if($overall_has_signature_personal) { if($rates[$k]-&gt;shipping_params-&gt;shipping_price_orig != 0) { $rates[$k]-&gt;shipping_params-&gt;shipping_price_orig = $rates[$k]-&gt;shipping_params-&gt;shipping_price; } $tempShippingPrice = (float)$rates[$k]-&gt;shipping_params-&gt;shipping_price; $rates[$k]-&gt;shipping_params-&gt;shipping_price = $tempShippingPrice + 1.0; } }

My problem is, that the rates are not updated. I can't see the updated amount in the Checkout-Process and also in the NetBeans IDE, there seems to be no change for shipping_price. What am I doing wrong? Why can't I change the shipping price? Maybe it's a PHP-Related thing and has nothing todo with HikaShop, but I stuck and therefore I'm asking if there is a trick or something I miss.

Thanks for your help and best regards
Mike

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc0Mjc2LXVwZGF0ZS1zaGlwbWVudC1wcmljZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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: 86322
- Thank you received: 14280
-
-

13 years 11 months ago [\#74385](#74385) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Update Shipment Prices](/forum/2-general-talk-about-hikashop/74276-update-shipment-prices#74385 "Hello there  I started to explore the Manual Shippment Plugin of HikaShop to learn how the things work, so that I can write my own module, fitting the need of my business / Swiss Post System.  I have the need, that I can send things with a special additional server called &quot;Eingeschrieben&quot;. It means, that the Swiss Post guarantes the delivery or send the letter/packet back to the sender.  Therefore I added an additional field on the product (since this is something that the kind of the product demands in my case). I added the field product&#95;delivery&#95;options to product table and the possible value can be: &quot;registered&quot; or &quot;registered-personally&quot;.  I have added the following code to manual.php of the manual shipping plugin to the function &quot;onShippingDisplay(...)&quot;. It's just to try out a little bit the mechanics of the plugins: (Ignore the maximum&#95;height stuff for the moment... this is another requirement):  My problem is, that the rates are not updated. I can't see the updated amount in the Checkout-Process and also in the NetBeans IDE, there seems to be no change for shipping&#95;price. What am I doing wrong? Why can't I change the shipping price? Maybe it's a PHP-Related thing and has nothing todo with HikaShop, but I stuck and therefore I'm asking if there is a trick or something I miss.  Thanks for your help and best regards Mike")*

Hi,

As far as I can see that code looks right.
However, note that once selected, a shipping method information is stored in the user session. So unless you change the product quantity or the address or logout/login, you won't see the new prices.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc0Mjc2LXVwZGF0ZS1zaGlwbWVudC1wcmljZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[mike](/forum/user/8167-mike "View mike's Profile")**
- [![mike's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/8167-mike "View mike's Profile") Topic Author
- [ Offline](/forum/user/8167-mike)

Less More

- Posts: 110
- Thank you received: 4
-
-

13 years 11 months ago [\#74441](#74441) by [mike](/forum/user/8167-mike "View mike's Profile")  Replied by *[mike](/forum/user/8167-mike "View mike's Profile")* on topic *[Re: Update Shipment Prices](/forum/2-general-talk-about-hikashop/74276-update-shipment-prices#74441 "Hello there  I started to explore the Manual Shippment Plugin of HikaShop to learn how the things work, so that I can write my own module, fitting the need of my business / Swiss Post System.  I have the need, that I can send things with a special additional server called &quot;Eingeschrieben&quot;. It means, that the Swiss Post guarantes the delivery or send the letter/packet back to the sender.  Therefore I added an additional field on the product (since this is something that the kind of the product demands in my case). I added the field product&#95;delivery&#95;options to product table and the possible value can be: &quot;registered&quot; or &quot;registered-personally&quot;.  I have added the following code to manual.php of the manual shipping plugin to the function &quot;onShippingDisplay(...)&quot;. It's just to try out a little bit the mechanics of the plugins: (Ignore the maximum&#95;height stuff for the moment... this is another requirement):  My problem is, that the rates are not updated. I can't see the updated amount in the Checkout-Process and also in the NetBeans IDE, there seems to be no change for shipping&#95;price. What am I doing wrong? Why can't I change the shipping price? Maybe it's a PHP-Related thing and has nothing todo with HikaShop, but I stuck and therefore I'm asking if there is a trick or something I miss.  Thanks for your help and best regards Mike")*

> nicolas wrote: However, note that once selected, a shipping method information is stored in the user session. So unless you change the product quantity or the address or logout/login, you won't see the new prices.

Hmm, okay... I'm not sure what this means. I have deactivated an automatic selection of the shipping method. I can see that the function "onShippingDisplay()" will be triggered 2 times (in case when the customer is not logged in), or it will be triggered 1 time when the customer is logged in.

Do I have to delete the browser cache or something between my debug sessions maybe?

I'll keep trying...

Another thing is: What do I have todo to store the settings? I now created a new module. In fact, I copied the existing "manual" plugin and changed all the XML "Manual" Names, including the filenames and the classname (plgHikashopshippingManual -&gt; plgHikashopshippingSwissPostManual).

I changed 2 things in the "swisspostmanual_configuration.php" where I have no idea if it's correct:

From: Code:

&lt;a href="&lt;?php echo hikashop_completeLink('plugins&amp;plugin_type=shipping&amp;task=edit&amp;name='.$this-&gt;data['manual'].'&amp;subtask=shipping_edit&amp;shipping_id='.$rate-&gt;shipping_id);?&gt;"&gt;&lt;?php echo $rate-&gt;shipping_name;?&gt;&lt;/a&gt; &lt;span class="spanloading"&gt;&lt;?php echo $this-&gt;data['toggleClass']-&gt;delete($id,"manual-".$rate-&gt;shipping_id,'shipping',true); ?&gt;&lt;/span&gt; &lt;input type="hidden" name="name" value="manual" /&gt;

To: Code:

&lt;a href="&lt;?php echo hikashop_completeLink('plugins&amp;plugin_type=shipping&amp;task=edit&amp;name='.$this-&gt;data['swisspostmanual'].'&amp;subtask=shipping_edit&amp;shipping_id='.$rate-&gt;shipping_id);?&gt;"&gt;&lt;?php echo $rate-&gt;shipping_name;?&gt;&lt;/a&gt; &lt;span class="spanloading"&gt;&lt;?php echo $this-&gt;data['toggleClass']-&gt;delete($id,"swisspostmanual-".$rate-&gt;shipping_id,'shipping',true); ?&gt;&lt;/span&gt; &lt;input type="hidden" name="name" value="swisspostmanual" /&gt;

I can open/edit a configuration (in fact click "New"), but when I store it, the table with all configurations is empty. How does the storing mechanisms work or what do I have todo to store the settings? I couldn't figure that out till now ![:unsure:](/media/kunena/emoticons/18.png ":unsure:")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc0Mjc2LXVwZGF0ZS1zaGlwbWVudC1wcmljZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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: 86322
- Thank you received: 14280
-
-

13 years 11 months ago [\#74894](#74894) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Update Shipment Prices](/forum/2-general-talk-about-hikashop/74276-update-shipment-prices#74894 "Hello there  I started to explore the Manual Shippment Plugin of HikaShop to learn how the things work, so that I can write my own module, fitting the need of my business / Swiss Post System.  I have the need, that I can send things with a special additional server called &quot;Eingeschrieben&quot;. It means, that the Swiss Post guarantes the delivery or send the letter/packet back to the sender.  Therefore I added an additional field on the product (since this is something that the kind of the product demands in my case). I added the field product&#95;delivery&#95;options to product table and the possible value can be: &quot;registered&quot; or &quot;registered-personally&quot;.  I have added the following code to manual.php of the manual shipping plugin to the function &quot;onShippingDisplay(...)&quot;. It's just to try out a little bit the mechanics of the plugins: (Ignore the maximum&#95;height stuff for the moment... this is another requirement):  My problem is, that the rates are not updated. I can't see the updated amount in the Checkout-Process and also in the NetBeans IDE, there seems to be no change for shipping&#95;price. What am I doing wrong? Why can't I change the shipping price? Maybe it's a PHP-Related thing and has nothing todo with HikaShop, but I stuck and therefore I'm asking if there is a trick or something I miss.  Thanks for your help and best regards Mike")*

Hi,

Delete the browser's cache no, but logout/login in order to reset the user session, yes.

You need to change also all the "manual" in the manual.php

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc0Mjc2LXVwZGF0ZS1zaGlwbWVudC1wcmljZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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.061 seconds

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

[](#top)
