An ordinary store owner having create (view, update, delete) STORE_TYPE commerce_store permission should have UI for administering their stores and products.
Optionally this addition also might be appended with the following changes, just to work properly:
#2903974: Redirect to the canonical instead of collection URL after creating/updating a store
#2900472: Views refuse to display the product type label
#2904355: Only admin should be allowed to choose/change a store owner
#2904653: Do not show the product add form for a user who is not owner of a store
#2904657: Allow a user to create only those store types which they have permission to
#2848232: Only show stores with permission on product creation page
Comment | File | Size | Author |
---|---|---|---|
#16 | add_store_edit_products_userstores_tabs-2880510-16.patch | 55.21 KB | drugan |
#14 | views.view_.drugan_administration_boutique_produit.yml | 32.82 KB | drugan |
#12 | picture5.png | 35.68 KB | zenimagine |
#12 | picture4.png | 8.98 KB | zenimagine |
#12 | picture3.png | 38.33 KB | zenimagine |
Comments
Comment #2
zenimagine CreditAttribution: zenimagine commentedComment #3
ToxaViking CreditAttribution: ToxaViking as a volunteer and at Lemberg Solutions, Drupal Ukraine Community commentedHello zenimagine!
Try to check tabs block at the block layout page, maybe it is disabled
Best regards,
Anton
Comment #4
mglamanThis is definitely a support request and more of a Views issue than anything.
When you add the route you must also specify the menu as being a tab.
This may be better asked on the Drupal StackExchange as it's a general Views question.
Comment #5
zenimagine CreditAttribution: zenimagine commented@mglaman I have selected "Menu Tab" and it does not work. How do you explain that there is no "Edit" tab on the shop page?
Comment #6
mglamanTo be honest, I'm not sure. As I said this is a general Views question and would have a wider audience/support at https://drupal.stackexchange.com/.
That said, I know I have had to rebuild caches after making a View a menu tab for it to show up, previously.
Comment #7
zenimagine CreditAttribution: zenimagine commented@mglaman The tabs works with groups the product pages, and other modules. With the exception of the shops.
Can you give me a simple example of a view you created to add a tab to a store ?
And do you have on your store a "edit" tab? Which should be present automatically on all pages of the site.
Thank you
Comment #8
zenimagine CreditAttribution: zenimagine commentedWho can confirm this problem ?
I've been trying to find a solution for months but nothing works.
Only the stores refuse to display the menu tabs in its main navigation bar.
Why is not there a tab edit on the shop page ?
Can you show me the screenshot of a shop page with tabs that you added ?
Thank you
Comment #9
zenimagine CreditAttribution: zenimagine commentedComment #10
zenimagine CreditAttribution: zenimagine commentedSee here for more details :
https://drupal.stackexchange.com/questions/242251/the-menu-tabs-show-an-...
Comment #11
zenimagine CreditAttribution: zenimagine commentedI tried using %store in the path but it does not work.
Comment #12
zenimagine CreditAttribution: zenimagine commentedComment #13
zenimagine CreditAttribution: zenimagine commentedI updated my question
Comment #14
drugan CreditAttribution: drugan as a volunteer commented@zenimagine
Note that to list products individually for each shop you should manually create a tab for this purpose. Views can't do it for you automatically. So, I've edited your view in the example to demonstrate how it could done. I've created three stores with the following IDs:
If your stores' IDs differ then edit the view tab's appropriate Stores: store filter.
Import the view:
If you still want to have url for your shop tab like my-store/1/produits it also feasible but might appear a bit trickier. So I've skipped it in the example. The same with default my-store/ tab when you have products of all shops displayed under the All Products tab (before the children tabs).
See more in the relative drupal.stackexchange.com answer.
Comment #15
zenimagine CreditAttribution: zenimagine commentedComment #16
drugan CreditAttribution: drugan as a volunteer commentedIt is recommended to apply the patch before installing drupalcommerce site. So, all required changes will be made for you by the install script.
If you've applied the patch on existing site then do this:
1. Go to admin/config/development/configuration/single/export and choose:
Configuration type => Views
Configuration name => Stores (commerce_stores)
2. Remember the first line of the configuration which look like this:
uuid: 07d2da3c-2173-408a-9cac-5bd39dfe0733
3. Go to commerce/modules/store/config/install folder and copy the content of views.view.commerce_stores.yml file.
4. Go to admin/config/development/configuration/single/import and choose Configuration type => View.
5. As the first line paste in the uuid: .... and then the content of the file. Import the view.
6. Go to admin/commerce/config/stores and user pages just to check if everything works as expected.
For reverting changes to initial state do this:
1. Apply the patch with the
-R
option.2. Repeat 1-6 steps from the above.
Comment #17
drugan CreditAttribution: drugan as a volunteer commentedThe patch should be applied with the latest dev version.
If you want to apply the patch for rc-1 version then do this:
1. Copy the content of this file.
2. Go to commerce/modules/store/config/install folder and paste the copied content into views.view.commerce_stores.yml file.
3. Apply the patch as usual.
Comment #18
bojanz CreditAttribution: bojanz at Centarro for Adapt commentedDrugan, please direct your code to https://github.com/mglaman/commerce_marketplace
We need this in a contrib, we can't commit it to Commerce directly because it's specific to the marketplace use case.