Product name restriction in manual shipping

  • Posts: 171
  • Thank you received: 9
8 years 6 months ago #239840

-- HikaShop version -- : 2.6.3

Hi!

I should need a plus field in manual shipping plugin in the restriction area. System should check wether all the items in the cart contains 'magazine' charset in name or in at least product code.

I thought on creating a clone manual shipping plugin by renaming the /plugins/hikashopshipping/manual folder and it's elements. But as I see all the restriction fields are loaded from another part of the Hikashop.
1.) How can I add there a new restriction field?
2.) If field is there, I think my problem could be checked by an SQL 'like' run, but I'm not sure about how to start it.

Any advices would be greatly appreciated!
Thanks in advance!

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 6 months ago #239843

Hi,

You need to base your plugin out of another shipping plugin like usps.
You need only two things from it:
- define an attribute $pluginConfig with the information for your option (you can see how extra fields can be added in the usps plugin code.
- implement the onShippingDisplay function, and in it, first call the parent function of the same name and then loop through the shipping methods and do your checks in $order->products based on what you have in your shipping methods extra options. You can look for example at how weight_approximation and dim_approximation are handled in that function of the usps plugin.

The following user(s) said Thank You: pepecortez

Please Log in or Create an account to join the conversation.

Time to create page: 0.066 seconds
Powered by Kunena Forum