- Posts: 575
- Thank you received: 11
How to add the custom shipping method restrictions
- ler@singmuiheng.com
-
Topic Author
- Offline
Less
More
3 years 5 months ago #350469
by ler@singmuiheng.com
-- HikaShop version -- : 4.4.5
-- Joomla version -- : 3.9.21
-- PHP version -- : 7.2.34
-- Browser(s) name and version -- : Google Chrome
hi, we have create own shipping plugin but we found that the plugin not in the shipping method restrictions on the payment options, can know where should we add the value options on it? can see the attachment for the payment method restrictions
-- Joomla version -- : 3.9.21
-- PHP version -- : 7.2.34
-- Browser(s) name and version -- : Google Chrome
hi, we have create own shipping plugin but we found that the plugin not in the shipping method restrictions on the payment options, can know where should we add the value options on it? can see the attachment for the payment method restrictions
Please Log in or Create an account to join the conversation.
3 years 5 months ago #350470
by nicolas
Replied by nicolas on topic How to add the custom shipping method restrictions
Hi,
Once you install a shipping plugin on your Joomla website, you need to go in the menu System>Shipping methods of HikaShop, click on the "new" button, select your shipping plugin and configure a shipping method for it.
Once done, you'll see the shipping method you created selectable in this option.
Did you do all this first ?
Once you install a shipping plugin on your Joomla website, you need to go in the menu System>Shipping methods of HikaShop, click on the "new" button, select your shipping plugin and configure a shipping method for it.
Once done, you'll see the shipping method you created selectable in this option.
Did you do all this first ?
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
Less
More
- Posts: 575
- Thank you received: 11
3 years 5 months ago #350499
by ler@singmuiheng.com
Replied by ler@singmuiheng.com on topic How to add the custom shipping method restrictions
yes we did it but when do the restriction at payment method the shipping created is not showing
This message contains confidential information
Please Log in or Create an account to join the conversation.
3 years 5 months ago #350504
by nicolas
Replied by nicolas on topic How to add the custom shipping method restrictions
Hi,
For the "shipping methods" option in the payment methods and custom order fields, you need to implement the shippingMethods method in your shipping plugin class.
For example, in the Australia Post v2 plugin we have:
For the "shipping methods" option in the payment methods and custom order fields, you need to implement the shippingMethods method in your shipping plugin class.
For example, in the Australia Post v2 plugin we have:
Code:
function shippingMethods(&$main) {
$methods = array();
foreach($this->shipping_types as $value => $key){
if(!empty($main->shipping_params->$value))
$methods[$main->shipping_id.'-'.$key] = $this->shipping_names[$value];
}
return $methods;
}
Please Log in or Create an account to join the conversation.
- ler@singmuiheng.com
-
Topic Author
- Offline
Less
More
- Posts: 575
- Thank you received: 11
3 years 5 months ago #350523
by ler@singmuiheng.com
Replied by ler@singmuiheng.com on topic How to add the custom shipping method restrictions
Please Log in or Create an account to join the conversation.
3 years 5 months ago #350527
by nicolas
Replied by nicolas on topic How to add the custom shipping method restrictions
Hi,
Well, for the checkout, you need to implement the onShippingDisplay(&$order,&$dbrates,&$usable_rates,&$messages) method in your plugin and have it request the available shipping services / costs for the shipping address of the user and then duplicate the shipping method object of the shipping plugin from the $dbrates array to the $usable_rates array (one per service / cost you want to offer).
Well, for the checkout, you need to implement the onShippingDisplay(&$order,&$dbrates,&$usable_rates,&$messages) method in your plugin and have it request the available shipping services / costs for the shipping address of the user and then duplicate the shipping method object of the shipping plugin from the $dbrates array to the $usable_rates array (one per service / cost you want to offer).
Please Log in or Create an account to join the conversation.
Time to create page: 0.243 seconds