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
-4
votes
0answers
18 views

Preprocess hook commerce order? [closed]

I've made this function on commerce_order to get just the name of the person: function getBillingName() { return $this->get('billing_profile')->entity->get('address')[0]->given_name; } so ...
-3
votes
0answers
25 views

best practice for Multiple subscription content access [closed]

A common need is to sell multiple content under one product name; For example, selling a course in Drupal that contains several lessons; This scenario has many applications. In my case, a site that ...
-2
votes
1answer
23 views

Looking for an example of an Off-site (iFrame) integration of payment gateway [closed]

I'm trying to to integrate the Paycomet BankStore integration JET-IFRAME: https://docs.paycomet.com/en/tarjetas/jetiframe in Drupal 9 for Drupal Commerce. I've been following the documentation in ...
-3
votes
0answers
19 views

Create Custom Workflow YML [closed]

Following this guide: https://docs.drupalcommerce.org/commerce2/developer-guide/orders/workflows/create-custom-workflow And it keeps giving me: Drupal\Component\Serialization\Exception\...
0
votes
0answers
12 views

How do I remove additional forms from the checkout page after I select my custom payment gateway? [closed]

When I pick PayPal there is no any additional forms under the radio-button list, but when I pick my gateway, duplicated forms appear. How do I remove them? What files/classes should I check?
0
votes
0answers
7 views

Mix shipping and not shipping products

I have at Commerce site with physical and digital product. I made a shipping method for both product types. Everything works when I only buy one of the product types. How do I hide the digital ...
0
votes
0answers
15 views

With Rules, how do I use variables with Calculate and Set a value actions?

Let's say I have an Entity with a custom integer field added. Let's call the field Global Total (field_global_total) On some event, I want to get the existing value of that field and store it in a ...
0
votes
0answers
28 views

Buy two, or more exact same products and get a better price discount

I want to create a promotion like "2 for 27,90$, 3 for 39,90$". I have installed the discount_extra module and rules too, so I can solve with the "Order discount -> Per-quantity ...
-3
votes
0answers
24 views

Change product price label back [fixxed} [closed]

I've changed the price label a while back to "Preço S/Iva" ... now i can't find where to change it back facepalm in "admin/commerce/config/product-variation-types/produto/edit/fields&...
1
vote
1answer
31 views

How do I programmatically create an order without deleting a profile?

I followed Orders to write the following code. $order = \Drupal\commerce_order\Entity\Order::create([ 'type' => 'custom_order_type', 'state' => 'draft', 'mail' => 'user@example.com', '...
0
votes
0answers
17 views

Update another line items quantity when line item updated

Drupal 9, Drupal Commerce 2.26 I have an event subscriber, listening to CartEvents .. specifically CartEvents::CART_ORDER_ITEM_UPDATE I have products of one type that reference products of another ...
0
votes
1answer
16 views

How to add conditions to display product variations in Drupal commerce?

In the products page, I want to limit product variations based on user roles. For example, I only want admin to be able to see some of the product variation. I tried to achieve this by adding an extra ...
1
vote
1answer
8 views

Product Attributes that do not require product variations

I am trying to figure out if it is possible to have product attributes that do not require individual SKUs and do not have to be entered as product variations. My use case is this: We are selling ...
1
vote
1answer
19 views

How to get product variation media file url using jsonapi?

I'm using the following jsonapi GET request to retrieve product variations for a product: /jsonapi/commerce_product/default/0ea927c7-b62d-45c9-8bec-dc3d16215276/variations?include=field_images ...
1
vote
1answer
66 views

Why custom condition is not containing parent entity?

I'm using: Drupal 9.1.7 Commerce 2.24 I'm trying to create my custom condition (based on https://docs.drupalcommerce.org/commerce2/developer-guide/core/conditions). However parent entity is always ...
0
votes
0answers
7 views

How to implement conditional shipping costs?

I am running Drupal 8 with Commerce 2. I have a flat-rate shipping option set up for multiple regions and I now need to increase the shipping costs under certain circumstances, eg.: Order contains a ...
1
vote
0answers
32 views

drupalcommerce/project-base prohibits upgrade to Drupal 9.2.4

I'm running into composer errors while trying to update a Drupal Commerce site to Drupal 9.2.4. I'm not sure how to interpret this output when I try composer prohibits drupal/core 9.2.4 results: https:...
0
votes
0answers
30 views

Should I remove "Commerce Base" from site before an upgrade?

The "Upgrade Status" module reports that "Commerce Base" exists in site file structure, but is not installed and suggests removing it. I expect that the Commerce project references ...
0
votes
0answers
40 views

More than one payment option for each plugin

I'm trying to build a custom gateway module for a payment provider that provides 3 methods of payment. I was following the documentation and building 1 gateway plugin for each method of payment ...
0
votes
0answers
8 views

Custom checkout pane visibility according to destination address

Following this documentation, I have create a custom pane checkout for a check field. This check should be visible according to destination address. It works good because isVisible() is fired when you ...
0
votes
0answers
17 views

Mocking the response of XmlResponse::getResultCode not working

Following is the code that I'm using to mock the response of XmlResponse::getResultCode as Ok, but it isn't working, I'm not sure what exactly is going wrong here: $response = $this->...
0
votes
0answers
17 views

"Back" link with registration enabled

In my Drupal 8 Commerce setup I have a checkout flow where users can log in or register before paying (the "Login or continue as guest") pane. The problem is the Back link. As far as I can ...
0
votes
0answers
20 views

Creating/updating orders via Rest/GraphQL API?

I am using Postman and Google Chrome to get order information via a REST API, but I can't get it to create or update any of the order information. Is it possible to create/update commerce orders via ...
2
votes
1answer
20 views

How do I get rate and configuration values?

I'm stumped. How do you get values off of the shipment method config? For example I have a the Flat Rate shipping method "Express". I want to get the raw config form values stored on that ...
0
votes
0answers
20 views

Drupal Commerce Canada Post can't get quote

I'm using drupal commerce Canada Post on drupal 9, the problem is when I selected shipping method an select Canada Post, there's no return the shipping quote or shipping rate option, I check the log ...
1
vote
0answers
17 views

The "Add to cart" button allows me to add more items to the cart than there are in the inventory

I am trying to work on a Drupal 8 commerce site which was built by someone else. I have not used the Commerce Core module in the past. Product variation has stock field where I enter total inventory I ...
1
vote
1answer
46 views

How do I fix this error about a missing class?

I'm using the Commerce Canada Post module. The code in the src/Plugin/Commerce/ShippingMethod/CanadaPost.php file uses a CanadaPost\Rating class which isn't defined that namespace and it causes an ...
-2
votes
2answers
56 views

Is the module fully compatible with Drupal 9?

If I create a new project and install The Commerce Core module using Composer following the instructions given from the drupalcommerce.org documentation, it would install Drupal 8 by default, not ...
1
vote
1answer
47 views

How to get access to a $form in hook_entity_view_display_alter?

In Drupal 9, I added a views_add_to_cart_form view mode to be able to render a product entity with only the Variations field formatted as add to cart form being displayed. That all works as expected, ...
0
votes
1answer
59 views

Display Block to retrieve information from Order Item's Product Variant and display rating & review inside product page

I am working on an e-commerce website development. I have the conventional Products -> Product Variants which goes through Order and payment gateway workflow. However, there is something different ...
0
votes
1answer
33 views

Why does my shopping cart item not have a label?

I'm working on D8 site with Drupal Commerce. I have to create a dynamic product variation and add it to cart for the user checkout. The problem I have, is when you land on the cart page, the line item ...
0
votes
1answer
35 views

Get list of applicable shipping methods

I would like to get the list of applicable shipping methods for the current cart but dependent on the selected shipping profile. I'm programming a custom controller that should returns the list of ...
1
vote
0answers
20 views

Checkout pane doesn't display custom panes

I'm using the documentation example. For some reason, I cannot get the custom pane to display in the checkout. What am I missing? I'm using the latest version of Drupal Commerce and Drupal 9.2. ...
0
votes
0answers
63 views

Why does installing this module fails?

I used composer create-project drupalcommerce/project-base commerce --stability dev, as suggested from Installation|Drupal Commerce Installation starts normally, but after I am asked for the database ...
0
votes
1answer
29 views

Can't edit or add addresses in customer's profile “Address book” page

With Drupal 9 and Commerce core 2.25 The problem only occur when "Allow multiple profiles" is checked in the "customer" profile, it is supposed to give the possibility to add ...
0
votes
0answers
20 views

Quantity on cart can be only set to 1

I can add to the cart as many items as like, for example 4. When I visit the cart page, I can see 4 items in the cart. However, I cannot proceed to the checkout as I see a message which says the value ...
1
vote
1answer
23 views

How can I create a simple dropdown to allow users the select an attribute (like ring size) from a Commerce 2 product page?

This seems like it should be simple but despite reading docs and watching videos I cannot figure this out. I have a Commerce 2 product variation type that I need to add a dropdown on to allow users to ...
0
votes
0answers
22 views

Error page after Paybox offsite validated payment

Working on Drupal 7.81 and Commerce Paybox 7.x-1.3 Everything is going well except for the redirection from Paybox to my e-commerce site, I constantly have an error page after redirection. Paybox ...
0
votes
0answers
19 views

How to translate "REMOVE", "CHECKOUT", "PREVIEW", Category in Breadcrumbs, Contact in menu, About Us in footer [closed]

I use drupalcommerce/commerce I was able to add a new language and translate many untranslated sentences in Home>Administration>Configuration>Regional and language, everything was okay until ...
1
vote
1answer
82 views

Somehow subscribe/react to addMessage

I'm trying to find an event that I can subscribe to for the method addMessage. I need to trigger some code everytime a status message is added. On reacting to this event, I need to send a variable ...
0
votes
0answers
18 views

Extend Commerce api shipping methods response with custom fields

With commerce api module, you can fetch all available shipping methods of an order with a GET request on {{host}}/jsonapi/checkout/{{cart_uuid}}/shipping-methods. Result is something like this: { ...
0
votes
1answer
18 views

Access a user entity reference in a commerce-product template file

I have a field_intervenantfield which contains a user entity reference. In the commerce-product template file, I want to access the description field of each intervenant. How can I achieve it? I tried ...
0
votes
0answers
21 views

How to get a product variant field (not attribute) value?

I have created a product variant with 1 attribute (say "Subscription Plan" or attribute_sub_plan) and 1 field (say "Number of Issues" or field_num_issues). The attribute was for ...
1
vote
1answer
58 views

How do I organize the display of product variation fields?

I have a new site with Drupal 9 and Commerce 2. I am trying to display my products with: Title Photo Price Delay Options Add to cart button Description I tested all the possible settings in manage ...
1
vote
1answer
64 views

Options for storing API keys in config files?

I'm working on a project that's using Drupal Commerce and wondering about the possible options to secure the API keys exported as configuration YAML files. We have the config directory outside of the ...
1
vote
0answers
15 views

How to delete a product type that no longer has a product variation type

I deleted "product variation type" before "product type" and now unable to delete the product type. I run into the follow error in dlog Drupal\Core\Entity\EntityStorageException: ...
1
vote
1answer
41 views

How many product types do I need?

I am in the process of creating an e-commerce site with drupal commerce 2. This site is dedicated to selling clothes for men, women and children. I created a type of clothing product I called Clothes. ...
0
votes
1answer
16 views

How to configure shipping rates based on product attributes

I am implementing Drupal Commerce 2 My use case Product such as an album release is offered as a product in different format such as LP, 7inch, CD. Each format has a different shipping cost. In other ...
0
votes
1answer
20 views

The view doesn't display products

I've edited the default product type and added a taxonomy term reference field and added some products that reference my product categories. The default taxonomy view isn't display my products, I ...
1
vote
1answer
56 views

How do I enable product revisions?

I am using Drupal commerce 2 with Drupal 9. I added few products and I need to access their revisions, but there is no revision option for products in Drupal commerce. How can I enable revisions for a ...

1
2 3 4 5
76