Questions tagged [commerce]

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

1,418 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
181 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 ...
1
vote
0answers
289 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 ...
1
vote
0answers
52 views

Drupal Commerce 2 updating with composer

I am a retired civil servant -- NOT a developer by a long shot -- and while I have used Drupal for about 19 years, I am new to composer and drush and Drupal Commerce 2. I was able to successfully ...
1
vote
0answers
29 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 ...
1
vote
1answer
93 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 ...
1
vote
0answers
33 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 ...
1
vote
0answers
53 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 ...
1
vote
0answers
49 views

PHP Incomplete class Object Error on creating a custom Checkout flow Plugin in Drupal 8

I have created the custom checkout flow plugin in drupal 8. And added the required steps in it as per the the commerce2 documentation. See the code below. <?php namespace Drupal\commerce_custom\...
1
vote
1answer
34 views

Handling anonymous orders in custom commerce module

Drupal: 8.7.2 Commerce: 2.13 I have a custom module set up that adds the following functionality to Commerce: It prevents the user from adding more than one item to their cart. If they try to add a ...
1
vote
0answers
153 views

How can I round up price matrix percentage to two decimals?

I'm looking for a way to round the percentage from Drupal 8 Commerce Shipping Price Matrix module to cents in USD. Is this possible? I found this function in the commerce_shipping_price_matrix/src/ ...
1
vote
1answer
153 views

Alter add to cart message

How to alter the message shown - "xyz" added to your cart, when we add an item to cart in Drupal 8 Commerce 2x. I saw Drupal\commerce_cart\EventSubscriber where the function displayAddToCartMessage(...
1
vote
1answer
698 views

Order receipt email content

I have a Drupal 8.6.7 site with Commerce 8.x-2.11 installed. I would like to include slightly more information in the emails sent out when customers complete the checkout process. I would like to ...
1
vote
0answers
27 views

Adding a custom button to products-variation-list in article-display backend (see screenshot)

I added the functionality to duplicate product-variations, using the module commerce_product_clone and some custom functions to link the clone to the article-display after saving. For convenient use, ...
1
vote
0answers
36 views

Adding offline functionality to Commerce POS

I'm looking into using drupal commerce on drupal 8 to make a custom pos. I'm also using the commerce pos module. One of the features required is a limited offline functionality. As mobile terminals ...
1
vote
2answers
589 views

How can I refresh the adjustment tax after changing the line-item price?

I create orders programmatically, and I have a tax problem: the order, after changing the line item price, always has the tax cost with the old product price. How can I refresh the adjustment tax ...
1
vote
1answer
1k views

Setting exposed filter default value from query string

I have a view which show products and an exposed filter block (category, manufacturer, price). I want to set category default value from URL, like this: /browse-products/category-id though, I wrote ...
1
vote
0answers
257 views

How do I duplicate an order?

I need to create programmatically order from other content like a subscription node on cron task. This is my code to get data from the subscription node called 'abonnement' and then create an order. ...
1
vote
0answers
37 views

Override commerce product form

i'm trying to override some fields in commerce_products_ui form in my-module, i need to 'disable' or 'hide' some fields, this question is similar to this one, it does not have an accepted answer and ...
1
vote
0answers
22 views

List all products with all options

We need to output a list of all products with all options. Example: 5 models of bicycles -- The Product Each model comes in three different wheel sizes (and wheel size option might vary by model) -- ...
1
vote
2answers
862 views

How can I limit the allowed quantity in the cart to one item?

I am using Drupal 8/Commerce 2. How do I limit the quantity in the cart to one item so that users can't order more than one item per order.
1
vote
0answers
66 views

When selecting a product variation attribute, the add to cart button and attribute disappear

I have a strange issue. I have created product dislays with product variations, which have attributes (size, color etc) The attributes field show up fine on the product display, but when one of the ...
1
vote
1answer
69 views

Drupal Commerce variations missing when creating content

I have downloaded and installed the Commerce module. Note 1: I have a product which is made up of 2 changeable parameters e.g. say size and colour... depending upon the size and colour chosen the ...
1
vote
0answers
88 views

How to implement separate billing/shipping addresses and prevent use of PO Boxes?

Because our products already have shipping included in the prices (using Commerce 2), we have no need for a separate shipping module or calculation. However, we do need separate billing and shipping ...
1
vote
0answers
134 views

Can I have partial payments?

Can I have partial payments in Drupal Commerce 2.x? For example, the customers need to make a deposit of 10% up front; when they pick up the bought items, they need to pay the remaining amount. They ...
1
vote
2answers
571 views

Display price in add to cart form BEFORE add to cart button

the logical flow of choosing attributes is seeing price adjustments based on the attributes chosen before the buy button ... how can i display the price in the form itself so it appears BEFORE the add ...
1
vote
0answers
111 views

Commerce 2 - display price summary on product pages

the price is broken down in cart and checkout pages, but there is no formatter to display it this way anywhere else ... most specifically it is needed for the product detail page so customer can see ...
1
vote
0answers
129 views

How to add a PayPal Express Checkout button to cart or order_information pages

I don't see that it's possible to have a "PayPal Express Checkout" button in commerce 2.x using commerce_paypal (out-of-the-box at least). Even if using Express Checkout, the customer still needs to ...
1
vote
0answers
81 views

Apply a discount rule when calculating cart total?

I would like to apply a discount on cart items at check-out. The discount will be based on quantity of particular product type. What event can I use to calculate a discount during checkout? Here is ...
1
vote
0answers
61 views

Editing existing checkout panes

I want to add some more fields to some of the existing checkout panes, but have found little information on that topic. So far I've found plenty on how to create my own panes, but I don't want to ...
1
vote
1answer
68 views

Commerce - how to allow users to buy 2 free products

For a current site I am building, authenticated users should be able to order 2 free products (of a certain type), after which the prices are back up to full price. Is there any solution which allows ...
1
vote
1answer
113 views

Don't calculate shipping for specific item

I have to types of a same product (used a select list field): 1|Physical 2|Digital (key|label) Physical items needs shipping calculated. Digital doesn't. Problem appears when you add physical and ...
1
vote
0answers
193 views

How to use subtotal for calculating shipping

I am using Commerce 7.x-1.13 module on my website. I would like to calculate the shipping based on the order total. However, every time I refresh my checkout page, the shipping fee will be increased ...
1
vote
2answers
212 views

How to access all of the properties related to Commerce Line Item entity in a rule?

I wonder how I can access all of the line item properties in Rules? For example in a Rules event "Before saving a line item" I can show a debug message of the line item. It has different properties ...
1
vote
1answer
152 views

Discount and coupon 100% off of for only 1 item in shopping cart

I am using Drupal 7 with the 2.x version of the Coupon and Discount modules. I am attempting to issue a 100% discount (free item) to my users, but I want to apply it only to 1 item in the cart. This ...
1
vote
0answers
200 views

Adding a field using `BundleFieldDefinition`, within an Entity Trait

I've gotten to a point where I'm having trouble connecting the dots with D8. As a result, I'm not sure I'm even asking the right question. At this moment, I'm trying to figure out how to add a ...
1
vote
0answers
160 views

Add multiple products with diferent quantities to cart at once

I would like to show a list of products along with a quantity field for each product and a single add to cart button at the bottom. I found a module that would achieve exactly what I want in Drupal 7 ...
1
vote
0answers
668 views

The price of product variations is not updated in the views

I created a view page to display the catalog of my products. Some products or variations. When I change the variation in the view, the price does not change. What have I done wrong? You can test ...
1
vote
0answers
101 views

Token replace for commerce products in rules

I'm trying to create a rule for automatically generating a commerce products titles from all the values of products fields. After each values I need to add suffix like cm, W, kg, mm e.g. In order to ...
1
vote
2answers
322 views

Is it possible to turn off Ajax load for Commerce Coupon Module?

I am getting a bunch of issues with the Commerce Coupon module 7.x-2.0-rc3. Mainly there are inconsistencies with the forms updating and also intermittent timeouts. I'm assuming it's an Ajax load ...
1
vote
1answer
57 views

How to access List type from an option set in conditions of the Rules module?

Iam trying to access an option set(weight_options) within which we have a List type that holds weight , represented as below "entity" : [ "commerce-line-item:commerce-product" ], "field" : "...
1
vote
0answers
380 views

programmatically alter unit price for backend order

I'm looking for a way to programmatically alter the unit price for products when adding them to an order via the backend (via a hook). I've seen some examples that make use of the cart hooks, but ...
1
vote
1answer
266 views

Include custom Product Fields in an email

I have added a new "Courses" Product Type that has a field called "Course Link". The store admin can add a url to this field and we want to email the value to the customer after they purchase. I have ...
1
vote
0answers
17 views

field_view_value() with product reference field only display specific attributes

As previously being asked and suggested in field_view_value() with product reference field doesn't display attributes it shows all the attributes for the product [size, colour, etc] I want to only ...
1
vote
0answers
9 views

header cart issue on multilingual site

I have a problem with my header cart which is a block showing how many product have been added to the cart. In the default language the order proces works just fine. However when I test the proces in ...
1
vote
0answers
81 views

Display a view of users who purchased a product

Ok I have been smashing my head into a wall for the last week trying to figure this out. I have setup a content type called event. I setup two product types called Adult Ticket and Childs Ticket I ...
1
vote
0answers
164 views

Settings after AJAX call

I have a page that contains lots of products (node with commerce form) that is formed in custom theme function (template). I update them by ajax, but forms of updated products do not work. I googled, ...
1
vote
1answer
210 views

Shopping cart not cleared after checkout

I have had several customers who have been able to make changes to previously placed orders. Even though the order status is set to pending after checkout is complete and their payments are processed, ...
1
vote
0answers
34 views

How to create a pricing rule from custom line item referencing a taxonomy term in Commerce?

I'm using Commerce Kickstart and I am trying to create a pricing rule for a custom line item that references a taxonomy term that adds an amount to the product's base price. For the condition, I have ...
1
vote
1answer
40 views

How would a customer be able to get free shipping when there are no free shipping options?

We just launched our ecommerce store using Drupal Commerce Kickstart, which heavily uses Rules to manage shipping. We have had two orders from the same Virginia-based customer. Both orders were ...
1
vote
0answers
42 views

Is there a function in Drupal Commerce which could perform a buying of a product programmatically?

For example, I need to perform a purchase of some product by some user programmatically. That as, I call a function having passed papameters such as user_id, product_id and price. By the way, this ...

1 2 3
4
5
29