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
-2
votes
0answers
12 views

How do I add a separate cost to the price? [closed]

I have the latest Kickstart 2. A product needs to have "extra options", each adding a separate cost to the price. I use this module: the https://www.drupal.org/project/commerce_pricing_attributes/ ...
1
vote
0answers
13 views

Customizing the checkout form

I need to fill Billing Info form with data that the user has filled in another page of my commerce site. I've made a hook_form_alter with the following weird code (with the help of kint): function ...
-2
votes
0answers
26 views

How to generate a number for Drupal Commerce SKU?

I have a site on Drupal 8 and Commerce 2.16 with a marketplace (several merchants with several stores). Each merchant can fill in the SKU field with their product variations. The problem is that the ...
0
votes
0answers
12 views

Theme suggestion for file link in on commerce product page

I'm listing some files for download on a commerce product page and I want to customize the output. I'm trying to get a theme suggestion for file-link.html.twig but I'm failing to get them to work. I'...
0
votes
0answers
8 views

social_auth_decoupled with oauth2token

I am using social_auth_decoupled to log in via social networks (google and facebook). The platform uses simple_auth, but social_auth_decoupled doesn't give me access_token and refresh_token, is there ...
0
votes
2answers
37 views

Is there a Grouped Product listing type in Drupal Commerce

I have a Magento site I would really like to migrate to Drupal Commerce. The one must-have feature is Grouped Product. A grouped product will have a base product from which the product listing will ...
0
votes
1answer
10 views

How to add as exposed filter a product attribute in Commerce's orders view?

I have a drupal 8 commerce website. The Orders page is a view that comes with commerce where all the orders are listed. Is it possible to add/create ( on the website or programatically ) an exposed ...
0
votes
1answer
18 views

How do I update customers cart prices and add discount and then let them checkout?

I'm using Drupal 7 Commerce and Commerce discount, amongst many others. So the use case is this. We often get enquiries for bulk orders containing many products. We want our customer to go to the ...
0
votes
0answers
11 views

Commerce product with multiple sub-attributes

I have a commerce product type called events that will be used to make reservations. For each event (let's say Congress xyz) I need to associate multiple items (let's say Session n) with a date and ...
0
votes
1answer
36 views

Commerce 2 Twig and Retail Price

I have a use case that I need to add the retail price on a receipt twig next to the discounted unit price. Ive tried every possible field syntax I could think to try, looked everywhere and stumped... ...
0
votes
1answer
14 views

How can we define twig template based on checkout flow in Commerce 2.x?

I am using Drupal Commerce 2.x. I try to build different twig templates based on the checkout flow. So, I use hook_theme_suggestions_HOOK_alter to register other theme suggestions. However, I can't ...
1
vote
1answer
31 views

Modify the store for hundreds of products [closed]

I have a drupal 8 commerce website with 2 stores (store1 and store2). Most of the products belong to both stores but there are a few that only belong to either one. Now, I need all the products (...
-4
votes
0answers
36 views

Product discount codes [closed]

Im currently making an e-commerce site the problem i have is i have a discount code for some products. e.g. product: Apple discount code: A means 10% discount Product: Banana discount code: B means 5% ...
0
votes
1answer
36 views

Shipping method and shipping service from a placed order

Im trying to get the shipping method and the shipping service values after i place an order on a Drupal 8 commerce website so i can use it inside an email im sending the website's owner (not the ...
-1
votes
0answers
20 views

How can create a twig template for input type number field [duplicate]

I have created my template for input type number in a form but it is not working. Please help me to find the solution. input--form-control--number.html.twig {% extends "input.html.twig" %} {# /** * ...
0
votes
0answers
31 views

Sometimes an item is not added to the cart, despite message “xxx was successfully added to the cart”

I have built a custom module for my D7 site that shows a dialogue when the user opens the cart. In the dialogue a few more items are suggested to the user. If the user chooses to tick the box in front ...
0
votes
0answers
22 views

How to know if a field_config_instance is safe to delete

What I did, and my findings: I installed commerce_product_bundles module for D7, and found that it leaves 5 orphaned field_config_instances in the database after uninstalling: commerce_unit_price, ...
0
votes
1answer
56 views

Automatically generate product variations

I'm creating a webshop with Drupal Commerce. I have a product variation called T-shirt. It has three product attributes, color, size and print. My problem Let's say I need a T-shirt with 5 ...
-1
votes
1answer
49 views

How to display the store url in a TWIG Message?

I have a Drupal 8 site with the Commerce and Message modules. In my TWIG Message I can display the title of the parent store of the product, but I cannot display the url of the parent store. How to ...
0
votes
0answers
11 views

Adding CSS in both custom theme and admin theme

How to modify some css to a tapir_table display being used in both places: in my custom theme and administration theme Specifically, i would like to make the qty and sku columns displayed on both ...
0
votes
0answers
24 views

How do you programmatically get the shipping information from a placed order?

So far I have a working piece of code that sends me an email ($to variable) when a new order has been placed on my drupal 8 commerce. This is not the email the person that places the order gets. As ...
2
votes
1answer
30 views

How do I programmatically empty a cart?

I want to empty the cart before a product in the code. I tried $this->cartProvider->emptyCart($cart); But this did not work and gave an error. I am doing this in Drupal 8. I am adding products ...
0
votes
0answers
35 views

how to check if content type is

I ve got 2 type of commerce product.1 is the product the other is another type of product commerce. I want to check if the product type is then you can do something if not do another thing. Notes: ...
0
votes
0answers
10 views

MY_MODULE_entity_bundle_field_info_alter not firing in multistep commerce checkout page

I am trying to add a custom validation constraint $fields['field_phone_number']->addConstraint('CommercePhoneNumber'); via MY_MODULE_entity_bundle_field_info_alter but am having trouble getting the ...
0
votes
0answers
23 views

Field is required, but server side validation is not catching it

I have a multistep checkout form in my commerce module. Inside Order Types i have added a field called Phone Number and set it to required. And then I have a custom module which has a ...
0
votes
1answer
11 views

Add payment to a commerce order using Rules

I am trying to create a component that can add payments to an existing order.(the payment is received offline). However, when I try to add an amount I receive the alert that the field is not writable (...
1
vote
1answer
73 views

It is correct to change unit_price of commerce_order_item programmatically under several conditions?

I am developing a module that allows you to select additional options for a product that is not a product or a purchase entity. It's like commerce_option but for D8. My inspirations come from Product ...
0
votes
0answers
10 views

Add property labels from address field properties in the view display

I use address field module and added this field to my customer profile (for Drupal Commerce integration). In the form you see decently the labels above the input fields (frontend). After filling in ...
0
votes
1answer
27 views

Latest update to 8.7 with Commerce caused Edit buttons to appear in place of shipping/billing information

After updating core to 8.7, the input fields for shipping and billing information are now hidden and Edit buttons are in their place. This has allowed users to checkout without entering shipping and ...
0
votes
0answers
20 views

Can't remove product attribute field from product

I've created first product type which allows products to have multiple variations. It has product variation and product attribute "flavor" and it works well. Then I've created second product by ...
0
votes
1answer
50 views

Could not find package with stability dev in a version installable using your PHP version

When I want to install Drupal Commerce using Composer via Git Bash terminal and using the following command: $ composer create-project drupalcommerce/project-base mystore --stability dev I get the ...
0
votes
1answer
23 views

Programmatically create new Schedule Updates Entity Reference on Node

I’m attempting to populate an entity referenced field created by the Scheduled Updates module within a content type, Event. Within Event I have two Scheduled Updates fields to check and uncheck the ...
0
votes
1answer
38 views

Double values (products) in Commerce cart form

I use Drupal Commerce version 8.x-2.15. I have a multilingual Drupal site with multiple languages based on domain. mystic.com -> EN language mystic.eu -> NL language etc I added relationships: (...
0
votes
1answer
27 views

Print title in commerce-product.html.twig

I try to create a custom product template commerce-product.html.twig. The changes work well except except the title. https://docs.drupalcommerce.org/commerce2/developer-guide/products/displaying-...
0
votes
1answer
28 views

How to update cart after deleting line items?

I have an Application (app) node that when it gets created (hook_node_insert) I add line items (based on info in the app) to my cart. This works great. Step 2 now is that when I add a new app, I ...
-1
votes
1answer
36 views

Multi-Vendor Marketplace functionality is not completed in Drupal 8 commerce

I was at the edge of launching a Multi-Vendor Marketplace with Opencart which is quiet as easy as installing an extension and I am ready to go ! However, I am better in Drupal Development and I like ...
2
votes
0answers
25 views

How to display billing information associated with with stored Auth.net payment information?

I am newish to Drupal and have been trying to print out the billing address data from the saved payment method information labels in drupal commerce checkout. The payment processor is Auth.net, using ...
0
votes
1answer
51 views

How do I per-variation add to cart button with no selection?

I have a table that displays rows of products with there attributes, the last item on each row has the variation add to cart form. The view's self sorts on the product id to display all the ...
1
vote
2answers
234 views

How can I make the coupon code field in commerce mandatory?

Using D7 commerce coupon/discount modules. I need to make the coupon field mandatory. Every order needs a coupon code entered. There is no standard "required" checkbox on the field and I tried using ...
1
vote
1answer
19 views

How to use % arguments in Easy Breadcrumbs “Paths to replace with custom breadcrumbs”

I am trying to give a more logical breadcrumb flow to the Drupal Commerce 2 checkout path, as Commerce doesn't support breadcrumbs in the checkout process. When not displaying the current page in ...
1
vote
0answers
49 views

Inline entity form field alter

I am using Drupal Commerce. For the Variations, I am using multiple add /remove via AJAX. I need to make field readonly. 0 -> <input type="number" name="variations[form][inline_entity_form][...
1
vote
0answers
29 views

Help me write a Rule condition and action to remove discount line item and to add payment

I am trying to write a rule for an existing order. Order has a zero total due to (Commerce) discount, e.g.: Widget $3.00 Discount -$3.00 For the condition, I'd like to check if a specific discount is ...
0
votes
0answers
34 views

Manually sort Commerce 2 products within the taxonomy term (category)

I have a view to display my products (categorized by taxonomy term) in the frontend. I have another view admin/commerce/products to add new products in the backend. How do I implement and configure ...
0
votes
0answers
7 views

Strong commerce order line items grouping

I need add to cart some Order Line Items grouped to don't allow the user to remove or change the amount of one of them without changing the other too. I can't do this with a unique Order Line Item ...
0
votes
0answers
17 views

Variation injection into product view

Problem Our requirement is a promotion slider on product canonicals that promotes similar products. We also have the stock module installed, and show a little banner that says "currently out of stock"...
0
votes
0answers
20 views

Access Denied when Sellers add new product

We created a store with Drupal 7 Commerce. Because we wanted to let specific users create new products on our store, a user role Seller was also created with the following permissions: Create, edit, ...
0
votes
0answers
21 views

Add helper text to payment method form

I would like to add helper texts to the different options in the payment methods form, in Drupal Commerce, like this: /Radio button/ Payment method 1 Helper text option 1... /Radio button/ Payment ...
0
votes
0answers
16 views

Order date from order_entity in commerce-order--pdf?

I need an invoice of an order, so I use the print pdf module, but the date is missing. I have tried the following code from commerce-order--admin but it doesnt get any data. <h3 class="entity-...
0
votes
0answers
25 views

Global attribute in Drupal Commerce 2

Got a question. How to create a global attribute in Drupal Commerce 2 that will use the added value to existing variations. Or as an option, the choice in the variation of 2 or more variants of the ...
0
votes
0answers
18 views

How do I implement a booking solution with “blacklist” dates?

I need to create a simple restaurant table booking system in an existing Drupal Commerce solution. I need to be able to book up to 10 seats (just one sitting per day to start with). I have got this ...