Jump to content

Recommended Posts

Posted (edited)

For globally shipping products the customs need a HS (Harmonised System) code.
I still have no idea why this is not a default feature of Prestashop, so i created a module for this.

insertion.thumb.png.1c186260386f435df5d309f1a75f8609.png

After installing the module you can find a HS code field in the back office for each product. (as show in the image above)
Afterwards you can easily add the HS code on your delivery slips and/or invoices.

delivery-slip.png.612f7144e58efea3afd62720f02d6347.png

 

Installation
You can install this module on any Prestashop 1.7 shop.


After installing the module you would have to manually edit the invoice/delivery slip template.
(because Prestashop does not allow this with the module installation)
In the module there is a folder called 'pdf' if you place this folder in your /themes/YOUR-THEME/ folder you are done.

 

hscodes.zip
 

Edited by Inform-All (see edit history)
  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites
  • 4 weeks later...

I'm going to give this module a try. We were just discussing if we should use "features" feature instead.
To my understanding we also need to supply Country of Origin

Share this post


Link to post
Share on other sites
2 hours ago, odinp123 said:

I'm going to give this module a try. We were just discussing if we should use "features" feature instead.
To my understanding we also need to supply Country of Origin

Hi
Let me know what you think of this module!
In my customers use case the carrier notes the country of origin, but let me know if you have any other ideas or extensions to this module.

Share this post


Link to post
Share on other sites

I've given it a spin on PrestaShop 1.7.5.2

Here I unfortunately experience a problem when saving.

While the HS field data is saved to database, it seems like the save action on product pages hangs (screenshot attached).

 

I've just tested it on 1.7.7.4 here it seems like the same bahaviour

Screenshot 2021-05-07 at 09.53.17.png

Share this post


Link to post
Share on other sites
Posted (edited)
On 5/5/2021 at 1:36 PM, Inform-All said:

Hi
Let me know what you think of this module!
In my customers use case the carrier notes the country of origin, but let me know if you have any other ideas or extensions to this module.

Just to clear up any confusion. The Country of Origin should be applied to each item line on the invoice. It is not where the parcel originates from, but rather where the item originates from. So for instance a pacel originating from Germany, this has to be on the invoice, ie.

T-shirt HS: 1234567890 CO: PT

Skirt HS: 2134567890 CO: PL

and so on.

Edited by odinp123 (see edit history)

Share this post


Link to post
Share on other sites
2 hours ago, odinp123 said:

I've given it a spin on PrestaShop 1.7.5.2

Here I unfortunately experience a problem when saving.

While the HS field data is saved to database, it seems like the save action on product pages hangs (screenshot attached).

 

I've just tested it on 1.7.7.4 here it seems like the same bahaviour

Screenshot 2021-05-07 at 09.53.17.png

Could you enable debug mode, and also share what errors your console gives?

Share this post


Link to post
Share on other sites
Posted (edited)

Unfortunately there is no stacktrace from debug mode.

 

Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
    error https://redacted/admin/themes/default/js/bundle/product/form.js?1.7.7.4:700
    https://redacted/admin/themes/new-theme/public/main.bundle.js:277

 

This is all i get in the console
   

Edited by odinp123 (see edit history)

Share this post


Link to post
Share on other sites

Could it be that

actionProductUpdate

Should be changed to

 actionProductSave

 

actionProductSave

This hook is called while saving products

Located in: /classes/Product.php

 

actionProductUpdate

This hook is displayed after a product has been updated

Located in:

 

My thought is that, when you save the product, after its saved actionProductUpdate is called, and IT calls save(); aka actionProductSave, that calls actionProductUpdate ... and so on. Creating an infinite loop

Share this post


Link to post
Share on other sites
Posted (edited)
35 minutes ago, odinp123 said:

Could it be that



actionProductUpdate

Should be changed to



 actionProductSave

 

actionProductSave

This hook is called while saving products

Located in: /classes/Product.php

 

actionProductUpdate

This hook is displayed after a product has been updated

Located in:

 

My thought is that, when you save the product, after its saved actionProductUpdate is called, and IT calls save(); aka actionProductSave, that calls actionProductUpdate ... and so on. Creating an infinite loop

Nope.
It looks like a different problem, please send me a private message with some login credentials so i can have a look.

Edited by Inform-All (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More