Questions tagged [commerce]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

Shipping configuration for x items or more

Using Drupal9 and Commerce2 I'm trying to configure shipping for a specific variation type : tires. If you order one or 2 tires, you must pick them up on site. if you order 4 or more, they can be ...
1 vote
0 answers
22 views

Can I use Price Resolvers for dynamic product pricing?

All cart items are adding programmatically. I am trying to set a product cost based on various factors that change for each instance of an item added to the cart. I discovered Price Resolvers and it ...
  • 1,007
0 votes
0 answers
18 views

Exposed Filters Manipulation and product attributes

I am using Better exposed filters in my view and the filtering criteria are Product Attributes of the Product Variations i have setup. It is working but the attributes are showing as Titles and i ...
0 votes
0 answers
19 views

Commerce Event Subcriber

I have created a custom event subscriber for Commerce, but when the event is triggered, somehow the Order number is increased by +1 and I get suddenly confirmation emails for 2 orders. I'm not doing ...
  • 733
0 votes
0 answers
78 views

How to display a shipment method as an order item row in csv or table view

I am creating a csv order view with a relationship to pull in referenced order items, and it gives a row for each order item as expected : Order 1, item 1 title, item price, Order 1, item 2 title, ...
0 votes
0 answers
19 views

Commerce migrate and upgrade

I'm going through the process of migrating from commerce 1 -> 2 and everything works from the product / order /payment perspective but I can't figure out how to re-map other content types that ...
2 votes
0 answers
70 views

How do I cancel an order?

I am looking for a way to change the status of some orders. I need to be able to cancel orders even if the payment has been validated. In fact, I'm currently using the Commerce Payplug module which ...
0 votes
2 answers
43 views

How to programmatically capture a payment?

Payment is in Authorized state. How do I programmatically capture it? I am using Authorize.net payment gateway.
  • 1,007
0 votes
2 answers
39 views

How to distinguish between order.paid event when authorization/capture and just capture?

I asked this question back in 2020: How do I programmatically "place" an order? and provided my own answer there: Provide an event subscriber: public static function getSubscribedEvents() {...
  • 1,007
0 votes
1 answer
19 views

Commerce Migrate module not listed in migrations

I installed the Commerce Migrate module, and its submodules, commerce_migrate_commerce and csv_example. When I run drush migrate:status, I see the migrations for the csv_example listed but none of the ...
  • 1,781
1 vote
1 answer
35 views

How to obtain a node id and product type from the product variation id?

I have a view in Drupal that has a field called Index product variation search: Item ID. Its description is "the item's internal (search API specific) ID". Here is an example of what this ...
  • 13
1 vote
0 answers
24 views

Canadian Tax Free

I am trying to add Gift Cards to a Canadian site, and those cards are to be the only tax free item on the site - We're online so the customer could be in any province. No matter what I try, I cannot ...
  • 41
0 votes
1 answer
52 views

Why can’t I install the module after uploading it?

I uploaded the Commerce Core module (8.x-2.32) from the /admin/modules/install tab. After uploading it, the modules list shows the module as disabled. I cannot select the checkbox shown for this ...
0 votes
0 answers
24 views

Pre-flag facets when searching products

I created a site with Drupal Commerce and I use search api (fulltext) and facets to search for products. The search works very well and also facets, but I would like to know if there is a way to have ...
  • 11
0 votes
1 answer
43 views

How to get fields of a product type using a database dynamic query

So I currently have multiple different product types that have varying fields. I was able to fetch all products using EntityTypeManager the following way: $productStorage = \Drupal::entityTypeManager()...
0 votes
0 answers
96 views

Order receipt mail -> shipping_information variable

How can I output the individual information of the variable shipping_information in a template file? For the billing_information variable, I followed How can I get the customer name in an order ...
  • 11
1 vote
1 answer
59 views

How to render the correct variation price in catalogs?

I have a product catalog built using search api, facets, and views like this: https://docs.drupalcommerce.org/commerce2/developer-guide/products/marketing-products/product-catalog-facets. My add to ...
0 votes
1 answer
51 views

Unable to enter credit card payment information

I just noticed that I'm unable to enter credit card payment information (card number, expiration date, CVV) when going through the Drupal Commerce checkout processing using the Square Connect payment ...
0 votes
0 answers
18 views

How to set default value of ’Choose Variation” in add to cart forms?

I'm trying to get variation dropdowns in add to cart forms to have a default value of ’Choose size” or similar that also disables the add to cart button in a way similar to 'out of stock' but with ...
0 votes
1 answer
24 views

Theming User Address Book Page

We are using drupal commerce2 on drupal 9, and I am trying to theming the address book tab (add some classes to layout and fields), /user/*/address-book. Unfortunately there isn't any twig template in ...
1 vote
1 answer
72 views

Programmatically update products

I am building a site with Drupal 9 and Drupal Commerce 2 (Drupal Commerce Kickstart). The site is complete and I have already entered all the products via Feed (there are over a million). Now I'm ...
  • 11
-2 votes
1 answer
46 views

Cannot apply patch #3160146

Cannot apply patch #3160146 Add a Normalizer and Denormalizer to support Layout Builder (patches/default_content/3160146-la yout-builder.patch)! Trying to install kickstart with composer. Fails with ...
  • 1
0 votes
1 answer
33 views

How To Resolve Commerce Button Returning Error?

I'm using the latest stable version of Drupal Commerce (on Drupal 9), with every module up to date Problem: When the add to cart button is clicked the site returns message "The website ...
0 votes
0 answers
23 views

Cart update event triggering for every field

In Commerce's cart form, I've noticed that the cart update event is fired more than once. (Potentially, it's fired once per field in the form.) Events have the stopPropagation() function, but it doesn'...
1 vote
1 answer
73 views

Cookie authentication when reguistering users through REST API

I am running Drupal 9 commerce 2.0 as headless CMS, and I am trying to integrate the user registration/user login part of my frontend application. I was able to use the user/register REST API to ...
0 votes
0 answers
22 views

How do I show a dropdown with items on hover in a cart?

Currently, I am migrating a Drupal 7 site to Drupal 9. I want to show the added items when hovering the cart icon. Inspecting it, I noticed the c-layout-cart-menu-shown class is added to the c-cart-...
0 votes
1 answer
27 views

I can't get rid of duplicates in products view

I tried everything. I reduced the number of fields. I set the Query settings to distinct. Product: Variations (variations:delta) is also set to 0. When I search by SKU I get duplicates. SKU Search is ...
0 votes
0 answers
29 views

Order item entity/field definitions

On my Status Report (Drupal 9.4.8), I see the following error. Mismatched entity and/or field definitions The following changes were detected in the entity type and field definitions. Order item The ...
-3 votes
1 answer
48 views

What is the template code for order date and telephone number [closed]

In our invoice that is printed, the date of the order and the telephone of the customer is missing. How can I print those into the template?
0 votes
1 answer
41 views

How can I have my own custom invoice number pattern?

Hi Im trying to make different pattern for the invoice in Drupal 9. I have products with two kind of price one is for particular and the other one is for profesional. i would like to have two pattern ...
  • 1
1 vote
1 answer
35 views

show "My billing information is the same as my shipping information." option when creating order from admin

I am using Drupal version 9.3.14. Option "My billing information is the same as my shipping information." gets available on checkout page automatically. But when creating order from Admin ...
1 vote
2 answers
45 views

How to automate the creation of product types?

I'm using Drupal 9 with Commerce 2. I have a large number of product types that need to be created. I have for each product type which fields need to be added. Let's say this information is stored in ...
0 votes
0 answers
62 views

Bulk update product variations weight

I've created a module for a custom VBO action. The action can be selected in the view, and the function is executed, but $request is empty and the selected product variation IDs are not available. ...
0 votes
0 answers
24 views

How to create an Order fee which only applies to certain line items (like an OrderItem fee)?

I need to create a fee which is only applied to certain items (OrderItem fee) but also has a minimum and maximum that must/can be applied of this fee type to each order (Order fee). Commerce has base ...
  • 1,007
0 votes
0 answers
22 views

Views filter "NOT IN" showing all results

I have a drupal commerce website. On my product, i've added a field "stock" which tell if is product is available (custom workflow) which is like the "visibility" field (list of ...
  • 79
0 votes
0 answers
21 views

Custom taxes and fees

My client is looking for custom fees/taxes plugins that do the following: The fees/taxes are state dependent (US only) and have "complex" rules that differ from state to state: are taxes on ...
  • 1,007
0 votes
1 answer
70 views

Combining line items in cart

I am trying to "hide" individual line item values on my shopping cart. Is there a way to combine line items (possibly based on a term applied to each) such that they show as 1 item with the ...
  • 1,007
0 votes
0 answers
152 views

How to use striptags twig function in a commerce product template?

For a client I need a wysiwyg field on my nodes and commerce products so they can add <em> and <span>&nbsp;</span> tags in their titles. I display this title_nbsp field value in ...
  • 722
1 vote
1 answer
39 views

How do I recreate Ubercart's product attributes?

While rebuilding an old D7 site with Ubercart into a new D9/Commerce installation, among other problems, I stumbled upon this one. In Ubercart I can add as many product attributes as I want and make ...
  • 11
-1 votes
2 answers
72 views

Creating a category page when using the Search API module

I’m trying to build a Drupal Commerce store which is going to be my first timer with Drupal 8+. However, the approach described in the Drupal Commerce documentation regarding the creation of a ...
  • 424
0 votes
1 answer
48 views

Ajax validation of file upload in Commerce Product with product attributes

I am building a shop with Drupal Commerce right now. I have a product that uses an Order item type, which supports a file upload. The same product also has some product attributes that load the ...
0 votes
0 answers
23 views

Pickup address doesn't show extra options

I'm using the Commerce Pickup module. I've added 2 pickup profiles (just like Drupal Commerce Pickup module 8.x / 9.x shows), but when I try to add it to my shipping method as Customer > Pickup ...
  • 23
1 vote
2 answers
68 views

Can't uninstall default search module because the Commerce Base module is required

I want to use Search API + Solr on my Drupal (& Drupal commerce) site. The tutorials recommend to uninstall the core Search module. However, I can't: the UI at page /admin/modules has Search ...
  • 26
2 votes
1 answer
95 views

Commerce pick up vs shipping

I've read the documentation, but it doesn't seem to be complete just yet. I'm using Drupal 9.4 and Commerce Core 8.x-2.31 with a few extra Commerce modules. I've got a basic question (I think?). How ...
  • 23
0 votes
1 answer
35 views

managed_file not initialised after form ajax

I'm having issues with a managed_form field not beeing initialised after it is introduced via a ajaxcallback in a custom checkout Pane: /** * Provides a custom message pane. * * @...
  • 298
0 votes
0 answers
14 views

Call a service at the end purchasing process in shipping method

I'm doing a logistics module. This module has a service that sends the order data to the delivery company. I'm trying to create a shipping method, but I can't find a way to call this service when the ...
  • 1
1 vote
0 answers
42 views

What causes commerce order numbers to skip a number?

On a Drupal 9 / Commerce 2 site, order numbers (not ID's) are incremental for completed orders. I've got a site though where - very rarely - an order number is skipped: 55, 56, 57, 59, 60, 61, ... Is ...
0 votes
1 answer
90 views

How do I divide two numbers?

I seem to be doing something wrong. I am trying to divide the price by 1.2 in commerce-invoice.html.twig. With {{ invoice_item.getTotalPrice|commerce_price_format / 1.2}}, when invoice_item....
1 vote
0 answers
40 views

Create a link to a cart to be used in emails

I would like to be able to create a link to an anonymous users cart, and send this to the user in an email. When the user clicks this link, he should be taken to his cart. (As part of an "...
0 votes
4 answers
56 views

Remove "Payment method" tab in user profile

Commerce don't give me any customize options for the user profile of the user, I don't want the "Payment method" tab to appear in the user profile, how can I cleanly remove/disable this? Can ...

1
2 3 4 5
78