Hello, I have a marketplace with this module. I am starting to have merchants opening shops. However there is a huge problem, I created a form for the merchants to enter the shipping methods they want to add to their store. So I have to manually enter the shipping method to their place, because the permissions are not suitable for a marketplace.
This is a huge drag on my proget and probably other progets.
France has just entered containment again (COVID-19 requires). The service providers can no longer ensure the deliveries. I want my merchants to be able to add on-site pick-ups to their stores, as well as delivery by them in a defined area.
The Commerce Shipping module allows you to do this by defining a postal code or a city for example.
Problem:
1) The delivery configuration path goes through admin.
2) There is no permission to limit adding or configuring to own store.
I think that mod has a bright future ahead of it. provided it is a minimum usable.
I will be able to sponsor this module, if I can have a minimum stable version and generate a turnover.
It therefore lacks permissions for shipping methods, payment gateways and promotions.
I'm lost and I don't know if the marketplace mode should be a Commerce submodule or a separate module like Commerce Marketplace.
Commerce seems to have integrated some of the functionality of the marketplace. Unfortunately the marketplace, in full expansion, currently seems to be able to be initiated on Drupal.
I imagine that to have a good marketplace module, this one should look like the Group module:
- Manage permissions within the type of store.
- Create only certain type of product in the type of store.
- Manage shipping methods within the store type.
- Manage payment gateways within the type of store.
- Manage promotions within the type of store.
- Manage members (cashier, product sheet writer, stock management, ...), the POS module would be fully functional.
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | Capture d’écran du 2020-11-30 23-43-23.png | 372.48 KB | zenimagine |
| #32 | Capture d’écran du 2020-11-30 23-43-04.png | 442.3 KB | zenimagine |
| #23 | Capture d’écran du 2020-11-27 16-27-43.png | 199.65 KB | zenimagine |
| #23 | Capture d’écran du 2020-11-27 16-27-30.png | 216.73 KB | zenimagine |
| #22 | permission.png | 312 KB | drugan |
Comments
Comment #2
drugan commentedThank you for your initiative.
The pick-up shipping method question was also asked in the @drupal_beginner Telegram and #commerce Slack channels.
https://t.me/drupal_beginner/56139
https://drupal.slack.com/archives/C1TLCCF9B/p1602884716069700
I think it requires a standalone module to provide this functionality.
Over the weekend I will be free again and start exploring everything related to the issue. After that I will share my thoughts on how it can be fixed.
Comment #3
zenimagine commentedgood news
Comment #4
drugan commentedI've started work on the commerce_pickup module. The idea is to allow a store owner / admin attach multiple pickup addresses to a store which then will be displayed on the Shipping Information checkout pane's select list when a respective shipping_pickup shipping method is selected.
The additional features under the question:
The phone number field of the store's pickup address to display for a customer.
The phone number field for a customer to enter in the checkout pane instead of the shipping address (which is replaced by the store pickup address).
Validation of the phone numbers entered.
Option to enter a logo image url in the store pickup address' Company field. Could help a customer to find a pickup location counter, for example in a mall or grocery store.
Comment #5
zenimagine commented@drugan Great, is this this module ?
https://www.drupal.org/project/commerce_pickup
Store owners should be able to add a time slot for in-store pickup. Can also be an availability date.
https://www.drupal.org/project/office_hours
This will resolve on-site order retrieval issues with instructions. But basic permissions are missing and the path must not go through admin.
Are you going to improve the "Commerce Shipping" module more generally ?
- Permissions to modify and delete shipping methods in own stores.
- Modification of the path :
Replace
/admin/commerce/shipping-methodsby/store/ID_STORE/shipping-methodsReplace
/admin/commerce/shipping-methods/addby/store/ID_STORE/shipping-methods/addReplace
/admin/commerce/shipping-methods/manage/IDby/store/ID_STORE/shipping-methods/manage/ID_SHIPPINGReplace
/admin/commerce/shipping-methods/manage/ID/deleteby/store/ID_STORE/shipping-methods/manage/ID_SHIPPING/deleteComment #6
drugan commented@zenimagine
Yes, I am going to make the 8.x / 9.x port to the commerce_pickup module.
As for the commerce_shipping permissions those also require to make them dynamic and store specific.
The same with other commerce_marketplace permissions which should be revised and possibly improved.
Comment #7
zenimagine commented@drugan Great, thank you. Let me know if you want me to test.
Comment #8
zenimagine commentedComment #10
drugan commentedTo test the changes above run your_site.com/update.php script in case if the commerce_marketplace module is already installed.
Then visit /user/ID/stores page and select the Shipping methods action for store.
UPDATE: note that to administer a store shipping methods user must have update own STORE_TYPE commerce_store permission for the store.
Comment #11
drugan commentedAs for the commerce_pickup port it is basically ready and just requires to look someone at on a testing site.
Comment #12
zenimagine commented@drugan Great ;-) Thank you, the functionality works wonderfully. I will do another test tomorrow.
Would it be possible to rewrite the path? To not use "admin"? #5
Comment #13
zenimagine commentedIf I add a shipping method, after registration I am redirected to /admin/commerce/shipping-methods
The operation links are missing in the "Modify", "Delete" View.
I don't know if it's possible, but a lot of information is missing in the View. The price, the conditions.
Comment #14
zenimagine commentedThere is an error in the machine name of the view :
commerce_marketpplace_administer_shipping_methods
should be :
commerce_marketplace_administer_shipping_methods
Comment #16
drugan commentedPlease, install the /commerce_marketplace/config/install/views.view.commerce_marketplace_administer_shipping_methods.yml view and try again.
Comment #17
zenimagine commented@drugan Great, it's much better. What is missing is more than the path which is not coherent for the merchants.
If you applied the same principle for payment gateways, the module would be usable and you could perhaps publish a BETA version ;-)
Setting up a donation link would be a good idea for this project.
Last question, how to test the pickup module ?
Comment #18
drugan commented@zenimagine
Good to know that the store shipping methods addition works for you.
I need to make a couple of final touches on a testing site and let you know then.
Comment #19
zenimagine commented@drugan Is it possible to redirect the non-admin user to the View after saving the shipping method ?
Comment #20
drugan commented@zenimagine
Did you pulled the latest commit?
See MarketplaceShippingMethodForm.php
It actually should redirect a non-superadmin user to the /store/ID/shipping-methods page after saving a new and editing or deleting existing shipping method.
See the screenshot attached.
Comment #21
zenimagine commented@drugan I just updated the module and imported the new view, that's it. What else should I do ?
Comment #22
drugan commented@zenimagine
Note that admin permission for a store shipping method is the administer commerce_shipping_method permission.
So, if your non-superadmin user has that permission it will be redirected to the /admin/commerce/shipping-methods page after saving a method.
There is no need for a regular store owner to have this permission because we allow them to administer their store shipping methods based on the update own STORE_TYPE commerce_store permission.
Comment #23
zenimagine commented@drugan No I did not grant these permission, but I am even redirected to admin
Comment #24
zenimagine commented@drugan Ok, so when I modify or delete a shipping method, I am redirected to the correct page.
The problem, when I add a shipping method, I get redirected to admin.
Comment #25
drugan commented@zenimagine
That is quite weird because for me after pulling the latest commit and flushing caches everything works as expected.
If you have devel module installed on your site then you can try
dpm([$store, $admin]);in the commerce_marketplace/src/Form/MarketplaceShippingMethodForm.php file (on save a method action).Like this one:
Comment #27
drugan commented@zenimagine
I have improved logic when detecting how much stores are selected on a shipping method form (store owner has no multiple stores choice on the form).
I am not sure, may the issue is related to a
PHPor Drupal Commerce version so, now it is definitely should work in case if there is no another contrib module installed which overrides the native ShippingMethodForm.php class.Comment #28
zenimagine commented@drugan Thank you, I confirm, the redirect is working
Comment #30
drugan commented@zenimagine
Great!
I've made more improvements to the redirection logic because somehow I've missed that regular store owner can have multiple stores.
So, if multiple stores are selected by the owner then, after saving the form, we redirect them to the /user/ID/stores page instead of the /store/ID/shipping-methods form.
Okay, for today I am done so I will let you know later on how to test the commerce_pickup module.
Comment #31
zenimagine commented@drugan Perfect thank you. Is there a way to disable certain conditions and plugins ?
The merchant may be lost among all these parameters and some marketplaces do not need all these conditions and plugins.
If you have the time, can you apply the same logic to payment gateways and promotions. After that, the merchant would be completely autonomous.
Comment #32
zenimagine commentedA view for the site administrator is missing :
Comment #33
drugan commented@zenimagine
Seems that feature request is more suitable for the Commerce Shipping module:
#3081204: View shipping method information in views
In any case it requires a patch and update hook...
Comment #34
drugan commented