This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

How to recover the ID of a store for the shopping cart ?

I have a Drupal 8.6 site with a marketplace (several stores).

I want to display in the "review" step of the "Checkout Pane" a checkbox with the sales terms.

Currently if I order in 2 stores, this will create 2 shopping cart (1 per store).

The terms of sales are accessible for each store at the url :

    /store/ID/terms

The code below works, but I must replace "I have read and accept the general terms and conditions of business" by the url of the terms of sale of the store where the shopping cart is.

How to do this ?

***EXAMPLE :***

Where is in Drupal 8 the user registration and authentication system?

I want to edit the registration and authentication system of the users.

So, in which module it is located?

How to replace the class of a button with php ?

Here is the html code of the button I want to edit :

    <div data-drupal-selector="edit-actions" class="form-actions form-group js-form-wrapper form-wrapper" id="edit-actions"><button class="button--add-to-cart button button--primary js-form-submit form-submit is-disabled btn-primary btn" data-drupal-selector="edit-submit" disabled="disabled" type="submit" id="edit-submit" name="op" value="Pas de vente en ligne">Pas de vente en ligne</button></div>

I am looking to replace the class btn-primary with btn-warning

Twig Tweak: field collections

Hello,

I'm using the stacks module to build custom pages. Now I have a field collection called "field_cv". When I use the devel module, it shows me that "field_cv" is an array containing IDs and some numbers. My guess is, the numbers are entities. How can I access the content of my fields? I tried using the Twig Tweak module, but I can't figure out what field I have to use.

Regards

Puffin

How to replace the "Add to Cart" button on the product page?

On this page of demo drupal commerce 2, there is a button "Add to cart" :

https://demo.commercekickstart.com/product/drupal-commerce-hoodie

How to replace the button "Add to cart" by a button "No sale online", without removing the variations ?

Here is my code, but it removes the variations. I only want to replace the button "Add to cart" :

How to remove the “Add to cart” button and quantity, if the store owner has the role “Premium Merchant” ?

I have Drupal 8 and Commerce 2. I created the roles "Merchant" and "Premium Merchant". By default, users who create a store have the role "Merchant".

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions