shipping plugin

  • Posts: 48
  • Thank you received: 0
5 years 5 months ago #307613

-- HikaShop version -- : 4.1.0
-- HikaMarket version -- : 3.0.2
-- Joomla version -- : 3.9.8
-- PHP version -- : 7.1

Hello, i have a custom shipping plugin that was created for my store and uses a webservice that connects to my distributor. I just purchased Hikamarket and going through the config now. The shipping plugin that i use for my store is showing under the vendor shipping plugin options also. how do i hide my shipping plugins from my vendors but still use it in my store only. thanks

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
5 years 5 months ago #307618

Hello,

One embedded solution would be to use the trigger "onBeforeHikaPluginConfigurationListing($type, &$filters, &$order, &$searchMap, &$extrafilters, &$view)"
You can then add an extra filter (in $filters) when you're in the frontend and the $type is "shipping", so you will exclude your plugin from the listing.
Otherwise you can use a view override but I would not recommend it to you since you have your own and custom plugin.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 48
  • Thank you received: 0
5 years 5 months ago #307650

Jerome, i would add the code "onBeforeHikaPluginConfigurationListing($type, &$filters, &$order, &$searchMap, &$extrafilters, &$view)" to my shipping plugin and then create the filter?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
5 years 5 months ago #307663

Hello,

I think it would be the best for your case if you want to hide your plugin from the HikaMarket front-end.
I suppose that you want your vendors to be able to create shipping methods. Because there is no built-in filters in HikaMarket regarding payment and shipping plugins (but it's in the todo list ; trying to find a good idea for the implementation and interfaces)

The idea is to add such kind of code :

$filters['exclude_XXX_plugin'] = 'plugin.shipping_type != ' . $db->Quote('XXX');
(when it's the front-end and the $type parameter is 'shipping')

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 48
  • Thank you received: 0
5 years 5 months ago #307666

Thanks Jerome, this is a custom webservice plugin and I do not have the expertise to add the code to the plugin. Can you recomend someone or can you handle this for a fee? Thanks

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
5 years 5 months ago #307670

Hello,

Oh okay. I though that you had the possibility to edit your custom plugin.
So, the faster solution would be to use a view override for the "pluginmarket / listing" view.
replacing

foreach($this->plugins as $plugin) {
By
foreach($this->plugins as $plugin) {
  if($this->type == 'shipping' && isset($plugin->shipping_type) && $plugin->shipping_type == 'XXXX')
    continue;
With your shipping plugin type instead of the XXXX

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 48
  • Thank you received: 0
5 years 5 months ago #307708

Hello, i tried inserting the code in the HikaMarket - pluginmarket / listing.php as suggested. I tried the shipping plugin type and name with no luck. Still showing in the shipping options. This is what it looked like here:

foreach($this->plugins as $plugin) {
if($this->type == 'shipping' && isset($plugin->shipping_type) && ($plugin->shipping_type == 'Hikashop Anchor Shipping Plugin')
continue;

Is there anything else i need to do after this? thanks

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
5 years 5 months ago #307713

Hello,

You entered the shipping name instead of the shipping type.
The shipping type cannot have spaces or special characters, it's the name of the folder in "plugins/hikashopshipping/"

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 48
  • Thank you received: 0
5 years 5 months ago #307729

I looked inside file manager and got the name of the folder, its called anchor. Did not work..

foreach($this->plugins as $plugin) {
if($this->type == 'shipping' && isset($plugin->shipping_type) && $plugin->shipping_type == 'anchor')
continue;
$id = 'market_plugin_' . $this->type.'_' . $plugin->$p_id;
$published_id = $this->type.'_published-' . $plugin->$p_id;

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
5 years 5 months ago #307764

Hello,

Logically, the folder name is also the name of the shipping type, but it is possible to put another value.
You can otherwise get the shipping type value in the plugin source code (in the few first line of the main file, the variable $shipping_type must be defined), it is also possible to have that information from the database (in the HikaShop shipping table)..
Unfortunately, like that it would be difficult for me to give you a precise answer for your specific case and plugin.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
5 years 5 months ago #307811

Hello,

After looking at your plugin, I realize that the patch I gave you was for the wrong view.
You can of course keep the patch in the "listing" view so you will hide that plugin from the listing BUT you're want to hide it from the plugin creation !
So you need to override the "pluginmarket / add" view and use that code :

  if($this->plugin_type == 'shipping' && isset($row->element) && $row->element == 'XXXX')
    continue;
Just after the line :
foreach($this->plugins as $i => &$row) {

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 48
  • Thank you received: 0
5 years 5 months ago #307883

Hi Jerome, the anchor shipping plugin is now gone from the add view but when i put a vendor product in the cart and check out the shipping options for anchor still comes up in the checkout process.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
5 years 5 months ago #307910

Hello,

You need to configure the plugin in the backend if you don't want the shipping instance to be available for other vendors.
Just need to assign the instance to your main vendor.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 48
  • Thank you received: 0
5 years 5 months ago #307935

I have tried everything you have told me. I can hide the plugin from showing up in the Vendor Control Panel when selecting New but I cant make it not show up in the shopping cart at check out. I have tried to configure in the back end as you mentioned but it still shows up. If i disable the anchor plugins then the vendor side works like expected. So I am at a loss here.

HikaMarket - pluginmarket / listing.php

foreach($this->plugins as $plugin) {
if($this->type == 'shipping' && isset($plugin->shipping_type) && $plugin->shipping_type == 'anchor')
continue;
$id = 'market_plugin_' . $this->type.'_' . $plugin->$p_id;
$published_id = $this->type.'_published-' . $plugin->$p_id;


HikaMarket - pluginmarket / add.php

foreach($this->plugins as $i => &$row) {
if($this->plugin_type == 'shipping' && isset($row->element) && $row->element == 'anchor')
continue;


i have listed the two areas and what i have there. Please advise.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
5 years 4 months ago #307937

Hello,

I'm sorry but I don't understand your request.
Please clarify

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 48
  • Thank you received: 0
5 years 4 months ago #307951

You posted the following

"You need to configure the plugin in the backend if you don't want the shipping instance to be available for other vendors.
Just need to assign the instance to your main vendor."



In the main info area under vendor i listed the vendor, is this correct?


this is from the page where the shipping is suppose to be a manual shipping for a flat rate of 5 dollars.

In the vendor control panel where I add the vendors shipping i add the manual shipping but when i put a product in the cart and check out the anchor shipping method always shows up. see attachments.

Here is a video link: www.screencast.com/t/1eWZexQQ


Can you logon to my site and see for yourself that this process is not working?

Attachments:
Last edit: 5 years 4 months ago by ChristianLocal.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
5 years 4 months ago #307984

Hello,

You have configured your shipping instance to be available just for the vendor "Rico Plate" who have the ID 6.
Your main vendor have the ID "1" and if you set the shipping instance to that vendor, the method won't be used when other vendor products are in the cart.

Because you associated the shipping instance with the vendor, you see that name in the front-end while you're connected with your admin.
Afterwards, the second screenshot is too tiny to be read.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
5 years 4 months ago #308044

Hello,

After a look at your custom shipping plugin ; the way that is generate its "sub methods" is not the right one.
Official HikaShop shipping plugins which web-services to generate multiple shipping entries are using a define algorithm which consist of copying the "current entry" so it will keep the settings of the shipping method.
Your custom plugin is copying the first available method in the shipping list ; which in your case is your manual shipping method.
So the configuration you set-up for your shipping method is not kept for the duplicated one and it generates unwanted side effect such as the lost of the vendor assignation.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Moderators: Obsidev
Time to create page: 0.098 seconds
Powered by Kunena Forum