How to create a condition to disable the "Add to cart" button ?

I created a module for Drupal 8.6 and Commerce 2.11

It is used to disable and change the text of the "Add to cart" button :

If the owner of the current store does not have the role of merchant_premium.

In this case, visitors cannot order products in this store.

MY PROBLEM

With the module below it works, but if an owner of a store does not have the role `marchand_premium`, buttons "Add to cart" of all the products of all stores is disabled.

So there is a condition missing in my code.

How to limit the list of stores to my own stores ?

I have a site with Drupal 8.6 and Commerce 2.11

I have a marketplace with several stores and shop owners.

When a store owner creates a product or a payment gateway, I want the list of stores to be limited to their own stores?

I found a code on drupal.org :

https://www.drupal.org/project/commerce/issues/2499645 (comment #16)

I tried to use it in a custom module, but it does not work.

In a commerce_marketplace_view_own_stores folder, I created the following files.

Unlimited grouped Multi-value fields

We're looking for a way to add grouped, multi-value fields to a content type.

The situation is that an event would have a number of sponsors. On the event content type, I'd like to add a field for sponsor which would include an image, url and the sponsor name, and perhaps some brief text. You'd need multiple sponsors on each event.

I thought there was a module to do this easily in Drupal 7, but I'm not finding anything in D8.

Entity reference fields within overall view results

Drupal 8... I have a content type, "webinar". Within it is an entity reference field, "speaker(s)". This second entity contains 3 fields: Name, title, company. 

I've created a view to pull all webinars. Within each, I want to list the attached speakers. Like so: 

     Webinar 1... Speaker(s): 
     Name1, title1, company1
     Name2, title2, company2

     Webinar 2... Speaker(s):
     Name2, title2, company2
     Name3, title3, company3

Instead, I get something like this:

Guzzle: it's possible register and authenticate users from Drupal 8 to a remote API?

Hi, i have this doubt: it's possible register and authenticate users from Drupal 8 to a remote API without build an custom module?

Just using Guzzle + HTTP Client Manager ?

I want that a user when he create an account on the website, automatically this account is created on the server of the remote API.

Goodbye Drupal 8, I'd like to say it was fun!

Well...

I'm really sad and dissapointed to say that I've given up on Drupal 8.  I've installed and played with D8 since it was in beta and all I can say is that for me, a micro business who produces websites for micro and small businesses is that it's a total waste of time.

I first tried a beta and it was so slow I gave up.

I waited for a production ready version and wanted an ecommerce site but composer was needed...  spent a few days grappling with it and gave up.

Repeated the above a couple of times since then and gave up.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x