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

Fetch Customer Profile from Line Items

In a webshop I’ve build I want to send individual e-mails to owners of a prodruct in the shop after a product is sold. To do this I got this as a solution: Send mail to product owner with Rules But ...
Joost's user avatar
  • 1,318
1 vote
1 answer
3k views

Limit items in shopping cart [closed]

Is there a way to limit users on my site to buy only 2 items from a list of products? Am using Drupal 7 with Commerce module and Rules. I added a new rule to when adding or removing and item from the ...
saadlulu's user avatar
  • 1,760
1 vote
1 answer
351 views

How to mark product if it has already been purchased by current user?

I have Drupal Commerce shop, that sells products that by their nature are most of the time not useful to buy twice. Exceptions do exist. So what I want is to show a field or add a class on products ...
Nenotek's user avatar
  • 47
1 vote
2 answers
4k views

Discount based on a field in product display node in Drupal Commerce?

I want to create a pricing rule based on discount entered in a field in the product display node? Is it possible? I have been trying to do it but i can't see the discount field in the dataselector. I ...
Azmat's user avatar
  • 11
1 vote
2 answers
192 views

Correct way for Attributes in Commerce

I am building a small web site which offers photography services. So, basically, I offer some services and these services do have some additional options (attributes). For example, service: Single ...
user126902's user avatar
1 vote
1 answer
824 views

How Can I change the machine name of product type

How can I change the machine name of product type (in drupal commerce ) after it created and has several content , as example I has tv porduct type I want to change it to LCDTV , How can I change it?
Yuseferi's user avatar
  • 22k
0 votes
2 answers
3k views

How can I change the Add to Cart button text on specific product forms?

What is the easiest way to change the Add to cart form button text to something custom? I want to change the text only on certain product types. How should I approach this?
Patoshi パトシ's user avatar
0 votes
3 answers
2k views

Commerce - how to set no payment for free orders when 100% coupon applied

I'm working with a one-page checkout process, where cart contents, account info, billing, payment, and coupon information are all under Checkout. Coupons are handled by commerce_coupon. This has ...
Dave Bruns's user avatar
  • 1,609
0 votes
2 answers
75 views

Users have access to add Commerce Products into the Store and publish it. How to display to user only allowed firms in the product addition form?

My webshop has lot of users with role Seller. They can add SKU and publish goods. Product display content type has field "Firm" that is taxonomy term reference. Now every Seller can see all the firms ...
tlito's user avatar
  • 519
-1 votes
1 answer
88 views

Different vat rate per commerce shipping service

I have a complex shipping price grid, with : Different modes : tracked or not Different zones : France, EU, World Different prices per weight steps (<250g, <400g, etc.) I started to implement ...
grubshka's user avatar
-1 votes
1 answer
165 views

Taxonomy Term Field of a Reference Field in a Product not available in Data Selector for CheckOut Rules

I installed Drupal Commerce Kickstart 2 with drupal version 7.54 and drupal commerce Version: 7.x-1.14. My problem is I want to send email to the store owner every time an order is completed. So in ...
alyssaeliyah's user avatar
19 votes
2 answers
3k views

Drupal Commerce. Trigger shipping rules based on product field value

I'm really losing the will to live and hope somebody can help me. I want to trigger a 'free shipping' rule based on a product field value, but for the life of me can not expose the free shipping ...
MrPaulDriver's user avatar
  • 1,027
12 votes
3 answers
18k views

Commerce get product id's from order

My question is simple: How do I get the product id's from a commerce order with Drupal code? I have something like this at the moment: $orders = commerce_order_load_multiple(array(), array('status' ...
user5706's user avatar
  • 155
12 votes
3 answers
9k views

How to get the shipping address programmatically in drupal commerce - what wrapper should i use?

I need to get the shipping address (shipping country to be precise) programmatically in drupal commerce. I have the $order object. How can i get the shipping address? EDIT - Ok i did this $...
Nicola Peluchetti's user avatar
11 votes
1 answer
2k views

Different payment methods for different product types

Is there a way to have different payment methods available for different product types? This is my scenario and what I've figured out so far: I have two product types on my Drupal Commerce site, for ...
ipwa's user avatar
  • 3,774
9 votes
4 answers
3k views

What is the recommend process for migrating a Drupal 6 Ubercart site to Drupal 7 / Drupal Commerce?

I'd like to migrate a client's site from Drupal 6 and Ubercart to Drupal 7 and Drupal Commerce. Is there an easy (i.e.: no manually munging data in the database) migration path? Do I need to go to ...
Nicholas Trandem's user avatar
9 votes
2 answers
14k views

How does Views contextual filters work?

I'm trying to wrap my head around contextual filters again! I used it a while back but I just got totally stumped again. Here's what I'm trying to do: Generate a cloned content node page with ...
Patoshi パトシ's user avatar
8 votes
1 answer
3k views

Drupal Commerce: How to get payment module settings?

How to programmatically retrieve configuration of the specific payment module? I tried $settings = rules_config_load('commerce_payment_MODULE_NAME'); It returns very basic info (name, ID etc) and ...
volocuga's user avatar
  • 730
8 votes
2 answers
1k views

How do "Order Types" and "Order Item Types" work?

I'm using the Commerce framework. I'm trying to understand exactly how "Order Types" and "Order Item Types" work. (I've consulted the docs; they don't really address this question.)...
Travis Miller's user avatar
7 votes
1 answer
11k views

How do I add custom order fields for users to fill out at checkout

Drupal 7 - Commerce I have 2 fields related to the order. one is radio button where user selects Pickup, Delivery. the other one I won't mention as it might confuse some people. I want the user to ...
iStryker's user avatar
  • 4,503
7 votes
4 answers
3k views

How to force account creation before commerce checkout is complete?

I currently have a one-page checkout that works great for anonymous users. After payment is complete, an account is created with the 'Create a new account for an anonymous order' checkout rule. Now I ...
Dave Bruns's user avatar
  • 1,609
7 votes
3 answers
8k views

Add product to cart programmatically

I want to add a product to the cart programmatically on form submit My code below works only for root, but in my site an anonymous user can access the cart and checkout, but when submitting form with ...
Yuseferi's user avatar
  • 22k
6 votes
2 answers
3k views

How can I dynamically refresh the price on product page when changing quantity based on price table

I'm currently building a web store with Drupal commerce and would like to get to price shown on a product page to asynchronously refresh when the user increases the amount in the quantity field, such ...
Jean-Daniel's user avatar
6 votes
2 answers
2k views

Commerce partial payment : pay deposit at checkout and full settlement later

In a Travel Booking website, how can I configure checkout so that customers pay only a n% deposit of the order total at checkout (off-site payment ATOS solution) ? If the order is created : less ...
Kojo's user avatar
  • 3,523
5 votes
2 answers
10k views

How to alter commerce checkout form in a custom module?

I'm using commerce and want to alter the checkout form in a custom module to prepopulate certain fields and hide them. However, I'm not able to do this using hook_form_alter() as well as ...
Aram Boyajyan's user avatar
5 votes
2 answers
5k views

How do I get information about the payment method from the order object programmatically?

I'm trying to do some different processing after an order is placed depending on which payment method a customer uses. In my EventSubscriber, I have the following code: public static function ...
Patrick Kenny's user avatar
5 votes
4 answers
3k views

How can I retrieve the current currency symbol?

I know there must be an API that returns the current currency symbol, but when I searched for it, I didn't find anything. How can I retrieve the current currency symbol?
5 votes
3 answers
8k views

How do I get the default billing/shipping customer profile in code?

Is there a way to get the default billing/shipping customer profile from a user? I'm getting all customer profiles with: $profiles = commerce_customer_profile_load_multiple(array(), array('uid' =>...
freakimkaefig's user avatar
5 votes
3 answers
7k views

How to customize order confirmation e-mail

I am experimenting with Commerce 2 and it is amazing, however one thing that I am unable to resolve customizing store e-mails? The default confirmation is not adequate and should be easy to customize ...
drupalstrap's user avatar
5 votes
2 answers
2k views

How to reset the id of the orders generated by Commerce module

I just finish a website which include a cart. I'm using the commerce module. In the development stage I've been making some test. Now I just deleted all these testing order, but now the id of the ...
chefnelone's user avatar
  • 6,237
5 votes
2 answers
3k views

How do I debug my Feeds import not importing a field

I have a Feeds import set up to import products into Drupal Commerce (from csv). My product type has a number of term reference fields that also need to be assigned a value by import. Most of these ...
Menno van den Heuvel's user avatar
5 votes
3 answers
3k views

How to handle refunds / returning goods with drupal commerce

i'm just trying to figure out whatcould be the bestway to handle "refunds" and the return of the shipped goods with Drupal Commerce. Is there some custom modules for that?How would you handle this ...
Nicola Peluchetti's user avatar
5 votes
3 answers
7k views

Commerce/Rules - Multiply the price by a custom field value

In my Drupal Commerce store, I have a field called Commission. The Commission is input as a percentage (i.e. its not a fixed global value). I need the final price to be updated so it incorporates ...
big_smile's user avatar
  • 2,828
5 votes
4 answers
6k views

Price field with Currency outside of commerce and ubercart

For a real-estate (realty) website I need to store and display the price, but the best D7 module for this is the price component of Commerce module. Is there a Price/Money field on D7? I have found ...
Duncanmoo's user avatar
  • 2,931
5 votes
2 answers
5k views

Commerce programatically Create Order with Customer Profile

I am using this method to create order successfully, how do I add a customer profile with all the country/address etc to this order? There does not seem to be any reference to customer profiles in ...
imp's user avatar
  • 728
4 votes
1 answer
3k views

programmatically add line item of commerce_discount type to order

I want to programmatically add line item of commerce_doscount type to my order, I test below code,it is correctly add a record to line items array but not show in order list even I refresh the order ...
Yuseferi's user avatar
  • 22k
4 votes
1 answer
2k views

What Causes DatabaseTransactionOutOfOrderException and how do I fix this? [closed]

I am working on plugin to Drupal Commerce, and I started getting this error: DatabaseTransactionOutOfOrderException: in DatabaseConnection->rollback() (line 1058 of /Library/WebServer/Documents/...
iewebguy's user avatar
  • 163
4 votes
2 answers
186 views

Services for Products

I have a requirement where my website serves both products and services. I am using Drupal e-Commerce module for the same. It works perfectly fine for Products where we can set price for each product ...
Raj Pawan Gumdal's user avatar
4 votes
2 answers
5k views

Anonymous checkout doesn't properly work

Anonymous users are supposed to have access to Commerce cart/checkout by default. In my current project cart remains empty for anonymous users, even if an order is created. When an anonymous user ...
Kojo's user avatar
  • 3,523
4 votes
4 answers
2k views

hook_form_alter() only firing after cache clear

I have a custom module that I'm using to add a Java applet to some of my admin forms. The applet is necessary to get details about the product being entered. I'm noticing that after 15 minutes (or ...
joedougherty's user avatar
4 votes
2 answers
6k views

How to list similar products using views in Commerce Kickstart?

I am trying to list other products in the same category using the Views module when browsing a product. For example, I am browsing drinks/drupal-commerce-wake-you; I want to list all other products ...
Ankit Chauhan's user avatar
4 votes
2 answers
3k views

LogicException: The database connection is not serializable - when I try to open any "gear" on checkout flow page?

So I'm on Commerce -> Configuration -> Orders -> Checkout flows. I'm editing a flow (it's the same with any of them), so i.e. I'm at page: /admin/commerce/config/checkout-flows/manage/...
MilanG's user avatar
  • 509
4 votes
2 answers
1k views

Only ask for a shipping address if a real product is ordered

I'm using the Drupal Commerce module with Shipping 7.x-1.0. I created a webshop with both real and virtual products. My problem is that the shipping address is required even if all the products are ...
DutchYoda's user avatar
4 votes
2 answers
2k views

Commerce limit the quantity of product to 1

I want to restrict quantity for certain products. Want to add a product only once in cart. How to achieve this? There are 3 products in my store and I want the users to add only 1 product in the ...
Harkamal's user avatar
  • 159
4 votes
3 answers
3k views

In Drupal Commerce how do you auto login an anonymous user that has completed checkout?

I have Drupal 7 Commerce core installed and configured manually. Not kickstart. Currently after completing a Commerce checkout (Paypal Express) with an anonymous user, I get redirected back to the "...
Patoshi パトシ's user avatar
4 votes
6 answers
5k views

Redirect to checkout after pressing the "Add to Cart" button

When a user presses the "add to cart" button on a product page, I want to automatically redirect the user to the checkout page. Drupal 7 has an issue for doing this programatically and an issue for ...
Patrick Kenny's user avatar
3 votes
1 answer
1k views

How to add Wishlist button field in views in drupal 7?

I am working on commerce site. In my site I have 3 views & each view have display 3 products. If user can first visit the product then user get the wishlist button but I want to show "add to cart" ...
Nishant's user avatar
  • 2,296
3 votes
1 answer
222 views

Can a VBO form be integrated with the Commerce Add-to-Cart form to allow adding optional add-on products with checkboxes?

With VBO and Rules I can display a list of Commerce products with checkboxes and a button to add the checked products to the cart (see how). Is there a way to integrate these checkboxes with the ...
unor's user avatar
  • 753
3 votes
3 answers
5k views

How do I count the number of products in cart programmatically?

I have created the custom block, here I want to count the number of products which is presented in the cart and tried with commerce_cart_order_load function to get the user selected products. Is ...
user avatar
3 votes
4 answers
4k views

How to print the product variation separately from the submit/pay button in a Commerce add to cart form?

I want to put the calculated product price between the "product variation" select widget and the "pay" button. In commerce-product.html.twig (my products display an add to cart form on the product ...
Patrick Kenny's user avatar