Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [drupal-commerce]

One of the modules that implements an eCommerce framework and ecosystem is the Drupal Commerce module.

0
votes
0answers
44 views

How to insert the store ID in a plugin?

I have a Drupal 8 site with a marketplace (several stores). I want to display in the "review" step of the "Checkout Pane" a checkbox with the sales terms. The terms of sales are accessible for each ...
1
vote
1answer
76 views

How to add a role to specific product type customer?

I'm trying to add a user role (darshan) to customer buying product from a specific product type (darshan_session), using an EventSubscriber in a custom module. For now, I'm stuck with the following ...
1
vote
0answers
32 views

check whether a user downloaded a file from private system file? [closed]

What I wanted to do is to show a tick icon (just next to download link), after a member downloaded a private file, which implemented by Protected File Module (files are saved on private file system). ...
0
votes
0answers
39 views

How do I create a view of all user accounts who have zero orders?

I would like to create a view of all users and their total Commerce orders particularly including all those who have no orders so that they can be filtered for. I found a related question that solves ...
-1
votes
2answers
395 views

How to display a button with “markup”?

I created a custom module and in the code below the button is not rendered, there is only the text : $form = ['#markup' => '<button type="button" class="btn btn-success" disabled="disabled">...
-2
votes
1answer
211 views

How to enable or disable the “Add to Cart” button for products based on the role of the store owner?

I have Drupal 8 and Commerce 2. I created a "Merchant" and "Premium Merchant" role. By default, users who create a store have the "Merchant" role. What I am trying to do is the following. If the ...
0
votes
1answer
78 views

Migrate from Ubercart 3 to Commerce

I have been trying to understand how to accomplish this for quite some time. And I'm not getting anywhere. The info I'm finding seems a bit dated. Can anyone tell me where to start to get this ...
0
votes
1answer
27 views

Add an extra to the price of the product

Guests can add a meal plan to their cart. They can compose their own formula. Type of sandwich, drink and dessert. For example the list of drinks is a list of 'taxonomy' terms. However some drinks ...
0
votes
2answers
335 views

Remove commerce item from cart

I can add an order item from the cart by doing this : \Drupal::service('commerce_cart.cart_manager')->getStorage('commerce_order_item')->create(array()) Is there a similar way to delete a ...
1
vote
2answers
283 views

Commerce limit the quantity of product to 1

I want to restrict quantity for certain products. Want to add a product only once in cart. How to achieve this? There are 3 products in my store and I want the users to add only 1 product in the ...
0
votes
1answer
282 views

How to show price range

I got Drupal 8 / Commerce 2 installation, and trying to create product category pages, showing product image, title and price range (min & max price) I've created product category page with Views....
0
votes
1answer
63 views

Do not want store credit card details [closed]

I am using Drupal 8 Commerce 2 Onsite payment gateway with USAepay payment gateway. I do not want to store credit card details in the database, even it should not save last 4 digit last of card number....
1
vote
1answer
245 views

How to set up a recurring payment

I need to set up a recurring payment on Drupal 8. I discovered these two possiblity : https://stripe.com/us/billing https://www.drupal.org/project/commerce_recurring What is the difference between ...
0
votes
1answer
29 views

Assign programmatically created order to anonymous user

I want to create a pre-made order in Drupal Commerce for an anonymous user, and redirect the user to the checkout. My use-case is that I have two sites: One big Drupal Commerce site (up and running ...
0
votes
2answers
105 views

Sale price not showing in cart page

I have added a product in commerce. Each products have a price and sale price. In product listing page the price is cutout and sale price is displayed. When a product is added to the cart, sale price ...
0
votes
1answer
47 views

Why does the shopping cart display the login form?

When I'm not logged in and click on the cart logo, the following page appears with the login form: /cart 1) I want the contents of the shopping cart to be displayed. 2) When I click on the "...
1
vote
1answer
112 views

In Commerce 2, is it possible to have the product variation automatically created during product creation?

We have a Commerce 2 store whose products will always only have one variation. The current workflow to create a new product and its variation is a bit complicated for the user's who will be entering ...
0
votes
1answer
38 views

How to customize the shopping cart?

This is a real puzzle, if I disable the image field of the display mode of variations, it is still displayed in the shopping cart. Can someone explain to me how to customize the shopping cart ? I do ...
0
votes
1answer
15 views

Year-end Commerce receipts

I've just stepped in to help work on a half-built Drupal 7 Commerce site for a non-profit who needs to provide year-end receipts to their donors. Ironically, I can't locate a module which summaries a ...
0
votes
1answer
98 views

How to change the variation title in the add to cart block in Drupal Commerce 1?

I'm building a store in D7 and Commerce 1. My product variations have a Size attribute - these are displayed in the Add to Cart block as a list of radio options. I would like the option labels to ...
1
vote
2answers
179 views

How to display the variation of a custom display in Twig

In my type of product variation, I have 4 different display : Default Panier (Cart) Teaser Teaser relation I have created a template for product type and want to display the "Photo" field of the "...
0
votes
1answer
40 views

I can't remove comma after currency in commerce price

In my project I had to change currency code from USD to IRR (Iranian Rial) but in Persian language after currency, there is always a "," character in rendered price (in price component or formatted ...
0
votes
1answer
44 views

Error message in checkout step

I'm getting the following error on the return page of my off-site payment: #1 ... /httpdocs/core/modules/editor/editor.module(554): _drupal_error_handler(4096, 'Argument 1 pass...', '... /httpdocs/ .....
0
votes
0answers
25 views

Copy value from user field to custom field in commerce customer profile

I try using this rule to copy a value from a field in the user account and paste it into a field in a customer profile in drupal commerce: { "rules_kopiera_fran_anvandarkonto" : { "LABEL" : "...
0
votes
1answer
40 views

Filter product displays by parent taxonomy term

I'm running a music store and have a taxonomy term field on products that that is used for the product's format. We tag the products from the following vocabulary. Vinyl 140g vinyl 180g vinyl CD ...
0
votes
0answers
18 views

How alter province (administrative_area) in address field

In my project, I need to alter address field. I want to change type of province (administrative_area) from textfield field to select list with specific options. I tried to do it via hook_form_alter ...
2
votes
0answers
201 views

Why do I get an error about the extension.list.module service non existing?

I installed Drupal 8.5.6 and Drupal Commerce with Composer. They installed fine, but after I cleared the cache, I got this exception in a WSOD. Uncaught PHP Exception Symfony\Component\...
0
votes
1answer
20 views

Order receipt e-mail language for guest checkout

Is there a way to have the order receipt e-mail be in the language of the site version that was used for placing the order? The order receipt e-mail that gets sent out (content of commerce-order-...
0
votes
1answer
51 views

Creating products with Rules and calculating price in Drupal Commerce

I am creating products on the fly with Rules, using Drupal Commerce. After user clicks on checkbox near product (additional service to product), I need to "add the service" to cart. Service is always ...
0
votes
1answer
71 views

How to create a message when a new store is created?

I installed the Message module on my site : https://www.drupal.org/project/message And I created a custom module from the Message Example sub-module. Here is the content of the ...
-2
votes
1answer
72 views

Commerce 2: Can a product buyer set the price they want to pay for a product during checkout?

I want to create a product where users can enter the price they'd like to pay for it. How can I do it? Edit: Just changed the question to be a little more clear. I will be trying the solution posted ...
0
votes
0answers
144 views

Updating throws an error which effects the site theme

I tried to update Drupal Commerce, before updating core to 8.6.0, with composer update drupal/commerce --with-dependencies. Now I get the following error for each page. Fatal error: Declaration ...
0
votes
1answer
78 views

How can I get the invoicing and shipping profiles for a user?

How can I get two separate profiles, one for shipping and one for invoicing? I can get the default profile for a user, but there does not appear to a type associated with it. In Drupal 7 I could use ...
-2
votes
1answer
42 views

Recovering a failed Commerce installation [closed]

Scenario: existing site 1G PHP memory install commerce modules locally do some dev and configuring cex my config and deploy upstream deployment fails with "php out of memory" try deployment again (4 ...
1
vote
0answers
23 views

Adding a custom button to products-variation-list in article-display backend (see screenshot)

I added the functionality to duplicate product-variations, using the module commerce_product_clone and some custom functions to link the clone to the article-display after saving. For convenient use, ...
0
votes
1answer
61 views

Error on update from 2.3 to 2.8 and 2.7?

I'm using drupal commerce 2.3 and want to update to commerce 2.8. I just copied the files to the new folder and get the error: PHP Fatal error: Uncaught Error: Class 'CommerceGuys\Addressing\...
0
votes
1answer
132 views

How to disable obligated address fields in Drupal Commerce in checkout?

In D8 drupal commerce there is a step after the customer selects checkout. Left in the screen is de payment information which contains a form with: Country Company First name, Last name Street ...
0
votes
0answers
24 views

Cannot find a value from the local configuration manager?

In D8 in the configuration manager I have a value: CURRENT VALUE FOR COMMERCE_PAYMENT.COMMERCE_PAYMENT_GATEWAY.COINPAYMENTS with YAML file uuid: xxxx langcode: en status: true dependencies: ...
0
votes
0answers
27 views

Which token is available in drupal commmerce in order to show the price?

In D8 i'm using drupal commerce. I would like to display a product entity. For this I used a views which displays a block. In this view the entity mode of a product is displayed. In here there is ...
0
votes
0answers
56 views

Add custom select list values on node creation/edit?

So far you can only create a listing field list (text) and fill it with values that are available to select from only when creating a node with that field. Is there a way to add custom values for a ...
1
vote
1answer
373 views

How do I create a field template or template override for a specific display mode?

Because in the Drupal 7 Commerce module, the fields, 'sku,' 'title,' and 'status' aren't editable by Display Suite field wrappers, I'm unable to edit the field wrapper via the Drupal front end, I need ...
0
votes
1answer
11 views

How to add a view of product fields to a product display so that it changes when add-to-cart form is updated via ajax?

In Drupal 7/Commerce, I would like to display a view of product fields attached to a product so that when the add-to-cart selection is updated and product fields are updated via ajax, the view is also ...
0
votes
1answer
236 views

Commerce Product listing View with category contextual filter, How to show items of (selected term and its child terms)

I have a the view 'Browse Products by Category' with the path: /taxonomy/term/% and a contextual filter: Product: Category (field_category) and let's say I have these categories: Sensors --- ...
1
vote
3answers
1k views

How do I programmatically load an order by its properties?

I know how to load an order by its ID using \Drupal\commerce_order\Entity\Order::load($order_id). I added a custom field (Token ID) to the orders. How can I load the orders knowing the value of that ...
0
votes
0answers
18 views

Add JavaScript on order completition

I'm trying to integrate the facebook pixel into my codebase. I need to be able to tell the Javascript the order total when an order is complete. So far I have subscribed to the commerce_order.place....
0
votes
1answer
280 views

How does a PaymentGateway signal a completed order

I'm trying to implement the Commerce Ingenico payment gateway for a Drupal 8 Commerce site. As this module is still in unfinished for Drupal 8, I'm fixing it up as I go. Most of the implementation is ...
0
votes
1answer
22 views

Price display on node-product .tpl

I have one product with 5 variations book: paperback, hard cover; audio; ebook(epub, mobi) How do i display the individual prices per item on node
0
votes
1answer
190 views

How to update payment status inside an order?

I am trying to update order status and payment status depending upon the value we get in a variable called $payment_status. I am able to update order status but I am unable to update payment status ...
1
vote
0answers
369 views

Using as shipping address the value entered as billing address

In Drupal Commerce 2 how can we allow a customer to select as shipping address the same address entered as billing address?
-2
votes
1answer
35 views

Editing text above downloadable products

I am trying to change the intro text above a form for downloadable products in Drupal Commerce, it needs a privacy policy link. I didn't create the website and I can't find where the text is generated....