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
1answer
14 views

Add extra item during the checkout in Commerce 2

Is there a way to add a checkbox during the checkout to have a special feature and then modify the total price of the order if checked? For example, imagine you want to have the products of the order ...
0
votes
0answers
11 views

How can I show tax per line item at checkout?

In D7, there was a module named 'Commerce price by components' which allowed us to display a price inclusive or exclusive of tax. I would like to show a detailed tax breakdown at checkout as most of ...
0
votes
0answers
21 views

Run php code on text field in variation possible?

Is it possible - anyone know how - to run php code on a commerce 2 variations created field to check the data in that field maybe using Ajax to make the field typingsensitive in the checkout?? I ...
0
votes
0answers
12 views

How to get user custom field in order email twig

I am trying to add user custom field in order receipt pdf using below file commerce_purchase_order under template. commerce-order-receipt--purchase-order-gateway.html.twig I tried below code {% ...
0
votes
0answers
13 views

How can I give access to shipping information to authenticated users?

As administrator when I visualize the page for the order of a user (user/[user-id]/orders/[order-id]) I can see the shipping and billing address. But setting the same type of information for ...
0
votes
1answer
28 views

Programmatically getting variation type fields in order

I am trying to get variation type field values from the order entity but I can't find any documentation on this. I am using an event subscriber to run the following code when an order is paid. The ...
0
votes
0answers
8 views

Order item - title missing product attributtes

i'm placing a manual order, and when I search for a product, I have only the sku and the title, but with that I don't know the size for example or the color, as they are attributes, how can I do to ...
0
votes
0answers
15 views

Drupal 9 Commerce change the Pay button text

I have created Drupal 9 website. On the website we accept donations using Commerce with Commerce Stripe as the payment processor. By default, the payment button says "Pay and complete purchase&...
1
vote
0answers
18 views

Adding Current Product page Variant ID/SKU to webform submission Drupal 8

I have product type event, this event have registration fees if price value not zero. Product page built with views and I embed related webform inside it. am using module called commerce webform order:...
1
vote
0answers
7 views

How to generate order pdf in drupal commerce and attach in hook_mail_alter [duplicate]

How to generate order pdf in drupal commerce and attach in hook_mail_alter using custom code. I trying another of method but seems not worked for me
-2
votes
0answers
13 views

how to get commerce invoice pdf path in the mail_alter hook [duplicate]

I was trying to get the pdf file path the generated using commerce invoice in mail_alter hook. But Below I tried $invoice_storage =\Drupal::entityTypeManager()->getStorage('commerce_invoice'); $...
0
votes
0answers
24 views

Attach PDF file to Drupal Commerce Order Notification generated with invoice commerce

How do I attach a pdf file to the commerce email? I have invoice commerce. Invoice commerce show view pdf option on every order and I want to send that pdf in email I am stumped on how to get the pdf ...
0
votes
1answer
13 views

Hide pane based on cart state

Can anyone point me to a right direction. I have created a custom Checkout flow and it has payment pane in it. I'm trying to skip payment pane if the Cart state changed (default cart state is draft) I ...
1
vote
1answer
33 views

How do I install a working demo?

I have been struggling with this for quite some time. I am trying to install a demo of the Commerce module as provided by Centarro, but every time the install finishes, I only get an empty site with ...
1
vote
1answer
24 views

How do I render a commerce promotion coupon code on the order details?

I want to show a coupon code used on an order details page, but cannot seem to render it on a templates. Here are some things I have tried so far... {% for coupon in order_entity.coupons %} {{ ...
0
votes
0answers
18 views

How do I know what properties and methods are available to an entity_metadata_wrapper object?

It may be easiest to start with an example. The entity_metadata_wrapper() function seems to do a lot of complex magic behind the scenes in order to return an object with all data related to the entity ...
0
votes
0answers
14 views

Add to Cart button shows in Product/Views But not anywhere else

Add to Cart button shows up only in Product/Views/blocks, But not anywhere else. It doesn't show anywhere else either logged in or not. There are variations, skus, price in most products, but no ...
0
votes
0answers
16 views

Redirect directly to the payment provider page

I'm building a store with Drupal Commerce and creating my own off-site payment gateway. On the review page, after selecting payment method, the user can click the button to pay and finish the order. ...
-2
votes
1answer
84 views

Change workflow state with particular payment method

Right now i have a payment method called "Transferência Bancária" and I need it to change to the workflow state "Awaiting Transferencia" automatically when that payment method is ...
0
votes
1answer
16 views

Syncing of order and shipping states

In Drupal 9, I have defined the following order workflow for Drupal Commerce: miss_pomela_fulfillment_processing: id: miss_pomela_fulfillment_processing group: commerce_order label: 'Miss Pomela ...
2
votes
1answer
30 views

Migrate order billing profile

I'm trying to migrate order data from an existing site using CSV files and I can't get the billing profile to relate. In trying to troubleshoot this, I have it set just to insert a default value of a ...
0
votes
1answer
22 views

Access product field from variation field

There are a bunch of product images that are named same as SKU, so I'm just using field--commerce-product-variation--sku.html.twig to show them. All is fine. I'd like to use the parent product image ...
0
votes
0answers
16 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
36 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 ...
1
vote
1answer
41 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
26 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
18 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
13 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
25 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
70 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
12 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 ...
0
votes
1answer
53 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:...
1
vote
0answers
59 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
51 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
10 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
19 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->...
2
votes
1answer
23 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 ...
0
votes
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 ...
0
votes
1answer
47 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
61 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 ...
0
votes
1answer
58 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
60 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 ...
-1
votes
1answer
36 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
44 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 ...
0
votes
0answers
22 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
69 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
0answers
21 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
29 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 ...

1
2 3 4 5
76