Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zenimagine created an issue. See original summary.

zenimagine’s picture

Title: Where are the "View" and "Edit" tabs of the stores ? » Unable to add tabs to shop page
Category: Support request » Bug report
Issue summary: View changes
Priority: Normal » Major
FileSize
169.78 KB
205.92 KB
402.17 KB
92.83 KB
ToxaViking’s picture

Hello zenimagine!

Try to check tabs block at the block layout page, maybe it is disabled

Best regards,
Anton

mglaman’s picture

Category: Bug report » Support request
Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

This 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.

zenimagine’s picture

@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?

mglaman’s picture

To 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.

zenimagine’s picture

@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

zenimagine’s picture

Priority: Normal » Major

Who 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

zenimagine’s picture

Version: 8.x-2.0-beta7 » 8.x-2.0-rc1
zenimagine’s picture

zenimagine’s picture

I tried using %store in the path but it does not work.

zenimagine’s picture

Issue summary: View changes
FileSize
22.87 KB
8.74 KB
38.33 KB
8.98 KB
35.68 KB
zenimagine’s picture

I updated my question

drugan’s picture

@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:

$my_store_ids = [1, 2, 3];

If your stores' IDs differ then edit the view tab's appropriate Stores: store filter.

Import the view:

  1. Go to /admin/config/development/configuration/single/import page, select View in the Configuration type select list and copy->paste content of the file above into textarea. Click Import button.
  2. Go to my-store/store-1-produits to see your imported view with tabs.

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.

zenimagine’s picture

Status: Postponed (maintainer needs more info) » Needs work
drugan’s picture

It 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.

drugan’s picture

Version: 8.x-2.0-rc1 » 8.x-2.x-dev

The 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.

bojanz’s picture

Category: Feature request » Support request
Status: Needs review » Fixed

Drugan, 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.