Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [drupal-commerce]

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

-1
votes
0answers
25 views

How to limit the product customization of a store type?

I have several types of store on my site and I want to modify the button "Add to cart" of all products associated with a type of store: I want to replace the text of the button "Add to cart" by "...
-1
votes
0answers
15 views

Get order by Billing profile id [on hold]

Im workin with Drupal commerce 2.4 and i am trying to query orders by using Billing_profle id. I have this in return each time : Drupal\Core\Entity\Query\QueryException : 'billing_profile' not ...
0
votes
0answers
32 views

Block not displayed when form has token [on hold]

I created a custom block that appears in the home page. and in the block I have many products . But if i add add_to_cart form for products the block does not appear And I only have the code <...
0
votes
0answers
12 views

How to bulk update (delete) Product Variations

I want to bulk select product variations for deletion, just like we can do with content and products in admin. I tried to duplicate the products admin view, and also creating my own, both throw ...
0
votes
1answer
14 views

How to manage catalog display of images for Commerce 2 product variation

I have created a custom product type and its variations are created with attribute 'Size'. If I create a new product with its multiple images, then the catalog view shows these multiple images instead ...
0
votes
0answers
11 views

How do I use the wallet balance with some other payment method?

I have used the Wallet module and I customized it a bit. When users order something, the wallet is available as payment method on checkout. If the wallet balance is lower than the order total, the ...
0
votes
0answers
7 views

How to create a chart based on role count?

I need to create a pie chart on commerce orders according to user roles (for example, how many orders for people with a specific role). I have tried with Views and Charts but the aggregation on user:...
0
votes
1answer
19 views

Drupal commerce (Coupon & Discounts) - Alter rule condition

I have a drupal commerce website on which I have add the discout module to make discounts and coupons. I have in my backoffice a list of all the orders and I can modify them if I want. The problem is ...
0
votes
1answer
14 views

How do I remove product duplicates in a view?

In my view I have duplicate entities for my product list, this is different from Drupal 7 as you could use the distinct module. How can I remove the duplicates from my commerce product views in ...
1
vote
1answer
18 views

Sometimes the v=<version number> parameter is added to the product URL

I have a new Drupal 8 site running commerce. When I view a product, most of the time the clean URL is perfect. Other times, it has a version parameter attached to it. I can access the page and no ...
-1
votes
0answers
13 views

Stripe payment testing [closed]

In my company we are developing new project based on Drupal 8 and Stripe payment. How can i do testing on stripe payments ?
0
votes
0answers
14 views

How to load output an existing Commerce Line Item Type field in a custom form?

I need to output an existing Commerce Line Item Type field in a custom form and I can do this with a field from a standard Node but can't get it to work with Commerce Line Item types. The code ...
0
votes
0answers
15 views

How do I add stock per location?

I have problems finding a way to add stock for a site with two stores, two stock locations and same SKU per product. field_available_stock_locations and field_stock_allocation_location are added to ...
0
votes
0answers
22 views

How to know the type of store?

Drupal 8 and Drupal Commerce 2.10 I have several types of store on my site and I want to modify the button Add to cart of all the products associated with the store type online (online is the machine ...
-2
votes
0answers
61 views

How do I add cities to counties?

which contains an event subscriber (the GreatBritainEventSubscriber class) that can be used to add additional information to countries, like counties or cities. I was able to add counties for a ...
-1
votes
0answers
13 views

Only add to cart if user has enough credits

I've a site where transactions are based purely on credits. No actual money is exchanged. In such a case, I want to restrict users from adding products to cart if they do not have credits to do so. ...
0
votes
0answers
9 views

How can I changed the commerce tax display label?

Is there any way or method to change the displayed label for Tax in the cart in Drupal 8 Commerce 2? The carts ends up looking like this because I have city, county, and state sales tax. But I need ...
0
votes
0answers
23 views

How to specify a condition if the store is not store_pro?

I created a custom module. If the owner of the current store does not have the marchand_premium role, the add to cart button is overwritten. I want to add another condition : If the store is not ...
0
votes
0answers
15 views

Cant add to cart cant set store

I am trying to allow users to add the product to the cart using drupal commerce. I have a template file page__product.html.twig I wanted to pragmatically add the cart button. $order_item_storage = \...
0
votes
0answers
13 views

Want to display newly added field collection item on top

I have a field collection item named 'fields_projects' I have a view which display all the resumes in the database Now, when you click on edit link it takes you to the edit resume page. There is a ...
0
votes
1answer
16 views

Change Product type's referenced Variation type

Once a Product type is created, I cannot change Variation type in Product type. Is this a feature, or is there a way to change it? Is it safe if I change it in the database? This is useful because I ...
0
votes
1answer
14 views

Different attribute selection widget in a view

I have a product display that lists multiple products with various pack sizes. I added a taxonomy field to a Product for the attribute e.g. T shirt 1 pack T shirt 3 pack I have set the product ...
0
votes
0answers
10 views

Swap out Product_type images with Product_variation images

I want to be able to add images to both the Product type display node, and the individual variations. If there are no variations images, then show the product_type images, else show the ...
0
votes
1answer
19 views

How to cancel an order transition if failure is detected in Commerce 2 / State Machine

I'm trying to plug into order transitions in order to send my order to a custom fulfillment system. I have a transition called "send_to_fulfillment", and order states "reviewing" and "...
0
votes
0answers
18 views

Should a subscription entity be created when a user purchases a license?

I am using Drupal 8, Commerce, Commerce License, and Commerce Recurring in an attempt to create a recurring paid membership for a yearly subscription. I have installed the required patch and I have ...
-2
votes
0answers
19 views

How to add direct buy now or checkout button in product information page

I am using commerce 2.x. I want to add the checkout button on product information page. How can I add the bye now or checkout button on product single page??
0
votes
1answer
12 views

Add property to ProductVariationType via hook_entity_type_build()

Hy guys, I'm trying to implement a simple stock management in my e-commerce. The ProductVariation will have a stock_quantity field used to track product availability. I would like that ...
1
vote
1answer
52 views

How to customize the subject of a Commerce order confirmation e-mail?

Here you can learn how to customize the content of the order confirmation mail, but what about customize the subject of the mail?
-1
votes
1answer
18 views

Can I connect via REST services with a mobile app I will develop?

I'm thinking of developing an e-commerce with Drupal 8 and Drupal Commerce, but I need to know if I can connect via REST services with a mobile app that I would develop too. The app would need to be ...
1
vote
0answers
18 views

How can I display the subtotal in cart page without tax?

In my current cart page subtotal display including tax, I want to show the subtotal without tax. How do I apply the tax on shipping rate?
0
votes
0answers
20 views

Commerce ajax add to cart doesn't fire facebook pixel AddToCart event

I am trying to add facebook pixel AddToCart event when clicking "add to cart" button on my drupal 7 commerce site. The first problem i see is that the button is not a button element but an input ...
0
votes
0answers
14 views

How can I add delivery charges to the line item?

I want to add delivery charges to the line item coming from variations field if users select for delivery to add into line item and the order total so that charges can be collected from the user ...
0
votes
1answer
20 views

How do I add a color hex code field to a product attribute using drupal commerce 2?

How to add a color hex code field to a product attribute using drupal commerce 2 I can add the form field but do not know how to create the field type: color or the corresponding hex code. Thanks
0
votes
0answers
15 views

no data is stored in cache_form table (Ajax 200 error)

I am using Drupal 7.59 and Drupal Commerce 7.x-1.14. After we updated our PHP version from 5 to 7 and migrated our database to AWS RDS. We started getting a lot of Ajax 200 error(Invalid form POST ...
0
votes
1answer
9 views

Drush hangs out on dl commerce_kickstart

in recent days new version of Commerce Kickstart 2 was introduced (v2.55). I tried upgrading my current installation (v2.54) using drush: drush --debug dl commerce_kickstart unfortunately after this ...
0
votes
1answer
32 views

How to create a teaser of a product

I want to create a product catalog in drupal 8 commerce 2. I have some products created, I also created a database index and in the view (Home>Administration>Structure>Views) I want to show 'rendered ...
0
votes
0answers
6 views

Can not “add to cart” from front page

I am using Drupal Commerce for Drupal 7, when I try to add the product into a cart from front page it sometimes works and sometimes it just redirects to /node? (nothing after ?). Views and website ...
1
vote
1answer
45 views

How to display the path without alias?

With Drupal 8 and Commerce 2.10 I created a php code to display the link of my store. When I go to the link, it displays: https://www.domaine.com/shop/name I want to display without alias: https:/...
0
votes
0answers
37 views

How to insert the store ID in a plugin?

I have a Drupal 8 site with a marketplace (several stores). I want to display in the "review" step of the "Checkout Pane" a checkbox with the sales terms. The terms of sales are accessible for each ...
0
votes
1answer
37 views

How to add a role to specific product type customer?

I'm trying to add a user role (darshan) to customer buying product from a specific product type (darshan_session), using an EventSubscriber in a custom module. For now, I'm stuck with the following ...
0
votes
0answers
11 views

problem with commerce shipping and commerce flat rate

I've build quite a few drupal commerce shops, and never had a problem with shipping rates. But this time I do. Normally, when building a flat rate, in the action, I put 'Add a rate for a shipping ...
0
votes
1answer
42 views

Add to cart button changes theme when selecting products

Maybe I'm missing something simple here, but I am seeing my add to cart button change from my current theme to a default grey button, when selecting products in drop down select boxes at the product ...
0
votes
0answers
35 views

Product selection gets progressively slower resulting in AJAX HTTP Error

I am getting the below error when using drop-down select boxes to adjust pricing. I was initially getting it using product variants on about the 7th selection. I have sense ditched the product ...
1
vote
0answers
28 views

check whether a user downloaded a file from private system file? [closed]

What I wanted to do is to show a tick icon (just next to download link), after a member downloaded a private file, which implemented by Protected File Module (files are saved on private file system). ...
0
votes
0answers
24 views

How do I create a view of all user accounts who have zero orders?

I would like to create a view of all users and their total Commerce orders particularly including all those who have no orders so that they can be filtered for. I found a related question that solves ...
-1
votes
2answers
96 views

How to display a button with “markup”?

I created a custom module and in the code below the button is not rendered, there is only the text : $form = ['#markup' => '<button type="button" class="btn btn-success" disabled="disabled">...
-2
votes
1answer
80 views

How to enable or disable the “Add to Cart” button for products based on the role of the store owner?

I have Drupal 8 and Commerce 2. I created a "Merchant" and "Premium Merchant" role. By default, users who create a store have the "Merchant" role. What I am trying to do is the following. If the ...
0
votes
1answer
28 views

Migrate from Ubercart 3 to Commerce

I have been trying to understand how to accomplish this for quite some time. And I'm not getting anywhere. The info I'm finding seems a bit dated. Can anyone tell me where to start to get this ...
0
votes
1answer
15 views

Add an extra to the price of the product

Guests can add a meal plan to their cart. They can compose their own formula. Type of sandwich, drink and dessert. For example the list of drinks is a list of 'taxonomy' terms. However some drinks ...
0
votes
0answers
40 views

Set custom field in order item

I create a new order item with the follow code but I need to set multiple custom fields as well, but it doesn't seems to work : $order_item = $this->entity_manager->getStorage('...