Re: V158 Japanese language pack
Final update:
All solved - I am officially a dummy.
First, I installed the Sagawa module in unencapsulated form (slight mods to _Sagawa.php class and sagawa.php shipping module files), and this installed perfectly. After which I discovered I was missing a couple of custom functions needed only in the shipping modules.
After adding these in functions_addresses.php, I uninstalled the unencapsulated version and retried the now proven encapsulated version. Running uninstall correctly removed all configuration keys.
This is when I finally realized that installing the plugin does not create configuration keys - only the tarif table (which part I had already solved previously).
Installing the actual payment and shipping modules provided by the plugin then correctly inserted the configuration keys.
I hope this helps someone else when trouble-shooting in future.
Re: V158 Japanese language pack
Hello @pilou2
All issues with the modules resolved.
I did find that the _Yubin.php class had
PHP Code:
function GetSizeClass() {
$a_classes = [
[0, 60, 30], // 区分,3辺計,重量
[1, 80, 30],
[2, 100, 30],
[3, 120, 30],
[4, 140, 30],
[5, 160, 30],
[5, 170, 30],
];
where the last line should change 5 -> 6.
I've written my own boxing logic for my specific store requirements (boxing of wines), and noticed that in the original modules the $bgirth variable might benfit from being modulated to display as the available box size for the corresponding module. So instead of displaying "90 cm", it could possibly be more beneficial to state "100 size" as that would be the corresponding box size.
Re: V158 Japanese language pack
@gernot
Thank you very much for this correction. It has been updated on GitHub.
For the box girth, effectively, if you send products of regular size and use standard boxes, it might be a good idea to display the box category size. In my shop I had to send very variable size products, especially some long and thin ones which need custom cut boxes. In this case seing the real box girth estimation helps to avoid making boxes larger than charged on invoice. For example if estimated girth is 98, I really take care to make a box that is not over 100. In the contrary, if girth is 85 then I know I can use a box that fit approximatively without risk of oversize.
1 Attachment(s)
Re: V158 Japanese language pack
Hello @pilou2
Thank you for the explanation, that makes sense. I had been using Yupack Chilled (cloned from the Yupack module) and added it to the encapsulated plugin you provided. I attach the created and modified files here. The module uses the same tarif table as Yupack, but adds a surcharge. There are differences in the permitted sizes and delivery times. The icon is roughly created. In case you wish to add it to your plugin (maybe some cleanup to adjust to the plugin standards).
Attachment 20981
Note: Oops, I forgot to revert to using the original prefecture codes, but original code is in both the class and module file, merely commented out.
Re: V158 Japanese language pack
Hello @pilou2
A further minor issue with the shipping modules is that in the GetQuote() function in the _Yamato.php, _Sagawa.php and _Yupack.php classes, $this->quote['cost'] is undefined in the case of an error, such as when the parcel is oversize. This causes warnings in the logs.
I tested a simple workaround, by defining this->quote['cost'] = 'Error' (i.e., not a number, which might be accidentally used), and this appears to avoid warnings being generated.
Example for the _Yamato.php class:
PHP Code:
if ($n_sizeclass < 0) {
$this->quote['error'] = ($n_sizeclass == -1) ? MODULE_SHIPPING_YAMATO_TEXT_OVERSIZE : MODULE_SHIPPING_YAMATO_TEXT_DIMENSION_MISSING;
// debugging - cost not available if error
$this->quote['cost'] = 'Error';
} else {
$this->quote['cost'] = $a_pricerank[$s_rank][$n_sizeclass];
}
Probably it will be better to simply initialize cost and let it be overwritten with correct value later, since there may be several conditions being tested in different places for error.
Re: V158 Japanese language pack
Quote:
Originally Posted by
gernot
Hello @pilou2
Thank you for the explanation, that makes sense. I had been using Yupack Chilled (cloned from the Yupack module) and added it to the encapsulated plugin you provided. I attach the created and modified files here. The module uses the same tarif table as Yupack, but adds a surcharge. There are differences in the permitted sizes and delivery times. The icon is roughly created. In case you wish to add it to your plugin (maybe some cleanup to adjust to the plugin standards).
Attachment 20981
Note: Oops, I forgot to revert to using the original prefecture codes, but original code is in both the class and module file, merely commented out.
Thanks for the file. I had a look at it and I will add it as a new shipping module when I have time.
By the way, for the standard Yupack shipping module, I saw that the charge for 'weighted Yupack' is now 560 JPY for all destination instead of 510 and 520 before...
Re: V158 Japanese language pack
Quote:
Originally Posted by
gernot
Hello @pilou2
A further minor issue with the shipping modules is that in the
GetQuote() function in the
_Yamato.php,
_Sagawa.php and
_Yupack.php classes,
$this->quote['cost'] is undefined in the case of an error, such as when the parcel is oversize. This causes warnings in the logs.
I tested a simple workaround, by defining
this->quote['cost'] = 'Error' (i.e., not a number, which might be accidentally used), and this appears to avoid warnings being generated.
Example for the
_Yamato.php class:
PHP Code:
if ($n_sizeclass < 0) {
$this->quote['error'] = ($n_sizeclass == -1) ? MODULE_SHIPPING_YAMATO_TEXT_OVERSIZE : MODULE_SHIPPING_YAMATO_TEXT_DIMENSION_MISSING;
// debugging - cost not available if error
$this->quote['cost'] = 'Error';
} else {
$this->quote['cost'] = $a_pricerank[$s_rank][$n_sizeclass];
}
Probably it will be better to simply initialize cost and let it be overwritten with correct value later, since there may be several conditions being tested in different places for error.
I actually corrected this last week (on GitHub) by intializing $this->quote['cost'] to Null, The oversized was already taken care of elswhere.
Thanks for your detailed screening and reports! It will hepl improve code.
Re: V158 Japanese language pack
Many thanks @pilou2,
I wil update the modules accordingly.
Re: V158 Japanese language pack
New Shipping module 'Refrigerated Yu-Pack' added to GitHub in development version 1.02.
@Gernot, I removed your specificities, the option over 25 Kg that does not exists for Chilled Yu-Pack and did some cleaning. The name 'Refrigerated Yu-Pack' was used rather than 'Yupack Chilled' because this is the name on Japan Post site. I resized the icon too.
There was a file missing in what you sent, catalog/includes/classes/observers/auto.yupackchilled.php. It is an observer used to activate/de-activate the module for some categories or products. Please check you have it in your custom version or these functions will not work.
Re: V158 Japanese language pack
Thank you @pilou2 for the corrections. I do have the catalog/includes/classes/observers/auto.yupackchilled.php file, but it seems I forgot to include it in the bundle I attached.