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
1
vote
1answer
13 views

Select order type and store with hook_form_alter()

In drupal commerce, I have 3 stores and 3 orders type When placing a manual order, i am first asked to choose the store and the order type ( which are entities), with radio buttons. With a select ...
-1
votes
1answer
34 views

How to alter the POS order item table header and columns

Using Drupal 8/Commerce 2 and the Commerce Point of Sale (POS) module, the autocomplete form to search and add a product to an order shows this table header. As indicated by @JayPan below, here ...
0
votes
1answer
22 views

How to check if custom variation field is null in twig?

I would like to know how to check if a custom variation field has content in a twig template (commerce-product.html.twig with variations injected). I have tried with some filters and conditions but ...
0
votes
2answers
20 views

How can I accurately determine when a customer is on the “Review” step in Commerce?

I've created a custom checkout pane by extending Drupal\commerce_checkout\Plugin\Commerce\CheckoutPane\CheckoutPaneBase and added it to the "Order information" step in a checkout flow. This accepts ...
0
votes
0answers
21 views

How to add some buttons to add to cart form

I would like to add some buttons to my add to cart form to alter the quantity input. I want two buttons for +1 and -1, and two other buttons for +12 and -12. This is the code I use in my .module to ...
0
votes
1answer
28 views

Commerce hook attributes refresh alter

Commerce 1.x (D7) has a hook _commerce_cart_attributes_refresh_alter(&$commands, $form, $form_state) that allows modules to add arbitrary AJAX commands to the array returned from the Add to Cart ...
0
votes
0answers
14 views

Multiple Custom Line Items with single add to cart button

I am working on a system that pulls in available dates and booking references from a third party API - we then need to add these pieces of extra information to a line_item that is added to cart. I ...
0
votes
0answers
6 views

View 'checkout order summary' not shown in order information page

Something different is shown in the order summery block (on the order_information page) than in the view 'checkout order summary' that I had slightly modified. In the view itself the preview works ...
0
votes
1answer
35 views

Product structure

While building a demo webshop for wine, I am not sure about how the product structure should be. So, I have to map the next structure and I am not sure what is the right approach. For example, we ...
0
votes
0answers
24 views

What are the necessary fields to provide in a CSV so that the orders are created properly?

In the context of Drupal 8 and Commerce 2, I need to create about 1000 orders on behalf of my users. What are the necessary fields to provide in a CSV so that the orders are created properly? The ...
0
votes
0answers
45 views

How to add variable to customize mail which is send after completed order?

I have created a custom field "field_jour" (type = selection list) in Commerce Order Type, for Checkout process. I would like to customize Mail which is send when order is completed (file = modules/...
0
votes
0answers
25 views

Error message “This value should not be null” with required field

When field is not required, it is ok. But when field is required, I have error message "This value should not be null". CONFIGURATION : This field was created in COMMERCE / ORDER TYPE : Entity ...
0
votes
0answers
13 views

How do I ajax-ify the empty cart button?

I placed the Commerce Cart block in the side bar and I added the Empty Cart Button in the View footer of this block. It works as is. I wanted to make this "empty cart button" use Ajax instead of ...
0
votes
2answers
35 views

The item of an unregistered user's cart is shown a different unregistered user

Using Drupal Commerce 2 in Drupal 8.8, if an unregistered user puts something in the cart (and doesn't check it out) another unregistered user sees these items in Cart block (provided by view (order))....
0
votes
1answer
21 views

How do I recalculate the price based on a given address?

I have a basic commerce shop setup and I need to recalculate the price based on the delivery region within the country. The first approach I tried was to add a list field for the customer profile ...
0
votes
0answers
42 views

How to render in commerce-product.html.twig calculated price?

I can render calculated price via {{ product.variation_price }} Is it any chance to this price from product_entity variable in twig? I have used custom resolver class to update price.
0
votes
1answer
51 views

Commerce Fee not being added to order total sent to payment processor

I have followed the Commerce Fees module's instructions found at https://www.drupal.org/project/commerce_fees: DOCUMENTATION Go to admin/commerce/config/fees and add a new fee type Add a ...
0
votes
2answers
22 views

How do I fetch the user ID from the shipping profile?

I'm trying to get the User ID from Shipping Profile in Drupal Commerce using the following code, but eventually, $entity->getOwnerId() is returning me NULL in any case, if it's an authenticated user ...
1
vote
1answer
38 views

Constraint doesn't attach from BundleFieldDefinition, but does from entity_bundle_field_info_alter()

I'm adding a trait to Commerce Product Variations, which applies the following public function buildFieldDefinitions() { // Builds the field definitions. $fields = []; $fields['...
0
votes
0answers
14 views

Adjusting the shipping price for a product after the order was placed

I'm using Drupal 7 Commerce module and I need to be able to edit the shipping price of an order after the has been placed. This is a B2B site, so the prices are displayed without VAT. I'm using the ...
0
votes
0answers
28 views

How to configure SQL plugin in a View Filter Plugin

I'm trying to write a plugin to get Commerce Stock Level field working with views, so I can get it to work correctly with Entity Browser(the operator runs on the last transaction instead of the ...
0
votes
0answers
15 views

Single commerce 2 products access control

As this documentation indicates, I can control the access to products by role, but what about single products?. I would like to hide some products from the views based on some conditions but not all ...
0
votes
0answers
25 views

Shipping not working with payment gateways

I cannot make the module shipping work with conditions based on payment gateways: My Configuration: drupal 8.8.5 + module commerce 8.x-2.17 + module commerce_shipping 8.x-2.0-rc1 I added a ...
0
votes
1answer
22 views

Why is library not being attached to my email twig template?

I am overriding the commerce-order-receipt.html.twig by adding that file to mytheme/templates/commerce. I then add these lines to mytheme.libraries.yml email: css: base: assets/css/email....
0
votes
0answers
14 views

Multiple regions, same subscriptions: Should I use product variants or duplicate the products for each region?

We have a subscription-based app. Users signup via our website, a Drupal 8 site using the Drupal Commerce module. We have customers all over the world; we need different taxation for at least three ...
0
votes
0answers
18 views

Retrieve shipping address fields

I am trying to retrieve the shipping address from the Shipping module in a view, and I could get it, but I want to export the address to a CSV file and I need the address as name, address line 1, ...
0
votes
2answers
47 views

Customize Order Items table on admin order screen

On the order edit admin screen at /admin/commerce/orders/270/edit, how do you customize the Order Items table? I've been looking all day and can't figure it out. There's a view that controls this same ...
0
votes
0answers
18 views

How do I alter the Order Information form?

Due to a bug in Commerce where I am unable to have admin make payments with a method which is not accessible to the order's user (https://www.drupal.org/project/commerce/issues/2912996); I thought it ...
0
votes
1answer
35 views

Email Notification to Store Owner When Order Complete

During early development I had it working so the store owner would get an email when an order was completed. I just realized this isn't working anymore. Where are the settings related to this? Is it ...
0
votes
0answers
30 views

Rename order state labels

The order state labels in /admin/commerce/orders are Fulfillment / Completed etc as defined in commerce/modules/order/commerce_order.workflows.yml. order_fulfillment: id: order_fulfillment ...
2
votes
0answers
21 views

Disable subscription auto-renew by users

I'm working on a website with commerce 2.x subscriptions auto-renewal with Drupal 8. The problem is that after an user will pay for membership, they can not cancel anymore the auto-renewal. I can't ...
0
votes
1answer
42 views

Can we use one product for multiple display nodes in Commerce D8?

I used to work with Drupal 7 Commerce and now I need help to work on D8 Commerce. I have nodes on my D8 website and I need to sell them through Drupal Commerce. Each node can be sold in the same ...
1
vote
2answers
21 views

How do I give access to only specific roles to buy at my store?

I have a platform with roles for moderators, editors, teachers and students. Only student roles should be able to buy courses and the other roles should not be able to buy courses or see any of the ...
0
votes
1answer
28 views

How to change the view for a rendered product?

I'm learning Drupal Commerce with a Commerce Kickstart installation. I understood in part the way products are displayed, with variation types and content types. Have made some changes like visible/...
0
votes
0answers
8 views

Render context is empty after IPN payment

I've developed an offsite payement gateway (Paybox card payment) using the IPN onNotify method. It was working fine on Commerce 2.13. Since I upgraded to Commerce 2.17, when the IPN request is ...
0
votes
0answers
6 views

Show product title when creating orders manually

I want to create a couple of orders manually. Therefore, I need to select the correct products. I have a bunch of products with multiple variations. The variations are titled like 'paperback' (it's ...
0
votes
1answer
40 views

How do I programmatically “place” an order?

When making a payment through the Commerce admin interface; the Orders do not get completed. I can see a Place Order button when viewing a cart Order; which seems to do the trick. I need to do this in ...
0
votes
0answers
41 views

How to sort product attribute values in “Add to cart” form

Given a commerce product with variations, how can I order the values within a variation attribute in the "Add to cart" form on the product page? Steps so far: In /admin/commerce/config/product-types/...
0
votes
1answer
32 views

What Commcerce event is fired when a payment is made?

There seem to be a few bugs in Commerce (8.x-2.17) related to admins making payments against a Cart. I am trying to fix some of these in my own custom module (rather than wait for people to agree ...
0
votes
0answers
33 views

In product displayed the default variation type, but product type referenced to custom variation type

I created several product types with their own variation type for each. But always used default variations. For example Product type Matrress Variation type Feild list is empty for this variation ...
0
votes
1answer
19 views

Why do all product display nodes with same referenced product (SKU) appear in 1 order view

Each time an order is added to cart, the admin/commerce/orders/11/view, for example, shows all product display nodes ever created on the site for that SKU. I suspect that this is not the normal ...
0
votes
0answers
22 views

Pathauto generating odd results

I attempted to create a pattern using Drupal Commerce 2 categories and product title. [commerce_product:field_categories:1]/products/[commerce_product:title] When I generate the url alias I get ...
0
votes
1answer
22 views

Using variation values in a template file

I am building a site that uses Drupal Commerce 2 and I am attempting to build out the product details template. Our product has a variation (field_accessories) which is an entity reference to another ...
0
votes
0answers
6 views

Display only the variations of a specific product when I create a new content

I'm working on a videogame website. I use Drupal Commerce with Druapl 8 to manage games. For example : (Sonic the Hedgehog) is the Product, and (Mega Drive - EUR) and (Mega Drive - JPN) are the ...
0
votes
1answer
19 views

how to create custom template for a product type in drupal 8 commerce

I want to have separate twig templates for each product type in drupal 8 commerce to customize them. is there any way to do that?
1
vote
0answers
48 views

Configuring a paid membership with subscriptions website with commerce module

I'm struggling in finding out a solution to provide membership access on my website with subscriptions renewed automatically depending which product/license they bought: 1-month membership, 3-month ...
0
votes
1answer
31 views

Currency resolver - Cache problem on platform.sh

I'm using currency resolver (commerce) based on cookie to switch currencies in block (have a custom field for usd price in price variant). Locally everything's work fine (apache) but on platform.sh ...
0
votes
0answers
11 views

How to get same cart data from anonymous to authenticated in drupal 8 commerce?

I'm using drupal 8 commerce as decoupled way and I got stuck to get same cart data from anonymous to authenticated. When user add items to cart when not logged in then after login i'm unable to get ...
0
votes
0answers
43 views

How to force price resolver when programmatically adding a new item to an existing cart?

I have built in my drupal 8 custom module a custom Commerce addtocart form, which allows me to have multiple instances of the form on one page, using the cartManager->addEntity() method described in ...
0
votes
1answer
26 views

Default customer profiles re-added on order edit, even without address field present

My site uses 2 custom profile types for a particular set of customers. For these, I have the default billing and shipping profile panes completely removed on the order edit screen via Customer Profile ...

1
2 3 4 5
74