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
20 votes
4 answers
14k views

Programmatically creating an order in Drupal Commerce for anonymous users redirecting to payment page

Ryan has some great code that you can programmatically create an order <?php global $user; $product_id = 1; // Create the new order in checkout; you might also check first to // see if your user ...
user avatar
  • 558
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 ...
user avatar
  • 1,017
18 votes
5 answers
8k views

How to Filter view by comparing 2 fields. If field-a < field-b

I have a product content type that has 2 price fields. I want to create a view that shows all products where price-A is less than price-B. I was hoping I could just add a filter and select price-A ...
user avatar
  • 181
17 votes
3 answers
3k views

Manage displays of Product:image field directly in Product Display?

I have a "Product Display" node showing a "Product" (powered by the Drupal Commerce module). I have installed the Display Suite module, and created a new view mode for the "Product Display" content ...
user avatar
  • 6,137
16 votes
4 answers
27k views

How do I display my products?

I have managed to create a product type and import my product data, so I now have a list of products. How do now go about getting the products to display? Do I have to build a content type from ...
user avatar
16 votes
7 answers
13k views

How do I theme checkout pages?

how do I theme the cart and checkout pages in Drupal commerce? I have set content, account, billing, and payment parts. Is there any --.tpl.php file to create?
user avatar
  • 831
16 votes
1 answer
2k views

View commerce product image and price fields

In Drupal 7 commerce I ran into a problem. I want to display the latest 3 items placed in the show_product content type, with attributes from the store. There are several entities in the store, ...
user avatar
  • 2,165
15 votes
3 answers
16k views

How do I add an additional submit handler in commerce checkout form?

How do I add an additional submit handler? I have tried this but it did not work. function c_coupon_form_alter(&$form, $form_state, $form_id) { drupal_set_message($form_id); switch($form_id) {...
user avatar
  • 2,697
15 votes
4 answers
2k views

How to show Total with taxes at admin/commerce/orders when order status is Review (using Commerce)?

I need to show Total with taxes at admin/commerce/orders using Commerce. Here the orders are shown without taxes, how can get to show the total including taxes? I didn't see anything like a Total ...
user avatar
  • 6,137
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' ...
user avatar
  • 155
12 votes
3 answers
8k views

Should I replace Magento with Drupal for my e-commerce solution? [closed]

I am working on an e-commerce project. Essentially, it's a 'expansive product catalog -> shop cart; users database' type of thing. Everything is still in development environment. I am trying out ...
user avatar
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 $...
user avatar
11 votes
2 answers
13k views

Where do I set anonymous checkout without users hit the login page?

After adding an item to the Drupal Commerce cart, I hit the cart review page. Then I click on checkout and I'm hit with the login page, is there a setting where users don't have to login and just ...
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 ...
user avatar
  • 3,764
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 ...
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 ...
user avatar
9 votes
2 answers
2k views

How to grant User Points equal to the price of a Commerce Product?

I would like to grant User Point to product owner in amount of product price after a product is sold. For this I defined a rule as below: Events: Completing the checkout process Actions: Loop (...
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 ...
user avatar
  • 730
8 votes
3 answers
18k views

How do I override a function from a module?

Firstly, sorry if this answer is covered elsewhere. I've done a lot of searching and can only find info on overring theme functions and hooks. I am using a module that builds a price table for Drupal ...
user avatar
8 votes
5 answers
5k views

empty drupal commerce cart with a url?

Is it possible to empty the cart with drupal commerce by visiting a url? /cart/empty Trying to create a test case for selenium
user avatar
  • 6,452
8 votes
3 answers
855 views

How to get "empty line items" in Commerce, similar to Ubercart?

In Ubercart, there is a little feature for adding "empty line items" to an admin created order. This allowed an admin to manually enter a custom title for the line item and a custom amount. ...
user avatar
  • 1,014
8 votes
2 answers
2k views

Is the Search API module able to do range facets on numeric values?

I'm using Drupal Commerce, Search API, and Facets API; I'd like to put the product prices as a facet. Configuring my search API index, I managed to get this facet, but the Search API module doesn't ...
user avatar
  • 179
8 votes
1 answer
2k views

How do I enable and use a view mode for a product type?

In default commerce2 (drupal 8) I want to add second product-type view mode, to show in views - like teaser version, including add-to-cart btn with variations. I have additional field in Product type ...
user avatar
  • 1,444
8 votes
1 answer
1k views

Drupal Services OAuth

I have been working on this issue for a couple weeks now, and I can't find a solution for the life of me. The fact that I have found no decent documentation (on Drupal's website, or anywhere else) is ...
user avatar
  • 81
8 votes
1 answer
489 views

Order list: Pay unpaid invoices

I have created some extra statuses: Paid and Unpaid. Now they got the functionality and react on the transaction balance perfectly fine. However, on the user site, it is kind of a dumb thing. Even ...
user avatar
8 votes
2 answers
2k views

How to setup event registration and paypal payment?

We have events and we take registrations for them. Entity Registration module is installed for that purpose and it's working great. Now, since those events are paid events, we want to implement PayPal ...
user avatar
  • 407
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 ...
user avatar
  • 4,513
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 ...
user avatar
  • 21k
7 votes
2 answers
6k views

Create product programmatically

I have a product with a custom field, according to this. I know I can create product with $cp = commerce_product_new('product'); $cp->is_new = TRUE; $cp->revision_id = NULL; $cp->uid = 1; $...
user avatar
  • 21k
7 votes
1 answer
2k views

Compute price based on order item fields

Is it possible to get the order items fields in a price resolver using Drupal 8 and Commerce 2.x? Indeed, the resolve method in a price resolver only allow to access the purchased entity, quantity ...
user avatar
7 votes
2 answers
4k views

Commerce checkout - Update cart pane after user select a shipping option (ajax)

I am working on a one page checkout and I'm trying to get the cart review pane updated with a shipping price while user selects a shipping option. I have attached #ajax information to the shipping ...
user avatar
7 votes
6 answers
13k views

How can I import and export Drupal Commerce Products?

I have a Drupal 7 site and installed the Drupal Commerce module. In which I have added Commerce Product with Category like: Software Products Hardware Products Electronics Others I would like to ...
user avatar
  • 406
7 votes
2 answers
784 views

Migrate CSV source serial

I am using migrate to import Commerce Products from a CSV file. The CSV file doesn't have its own serial so I am using csvrownum but that obviously won't work if there are already products -- I will ...
user avatar
7 votes
1 answer
2k views

How to display all product prices on the page at once with Drupal commerce?

I have several products related to a single product display node using Drupal Commerce. Currently this page only shows a single price (related to the product option currently selected in the ...
user avatar
  • 164k
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 ...
user avatar
  • 1,609
7 votes
2 answers
2k views

Is there any way to disabling caching for a single field for anonymous users?

I ran into an interesting, but probably a common, problem. With caching turned on, stock is not updated immediately for anonymous users (which makes sense as that's the point of caching). However this ...
user avatar
  • 1,014
6 votes
3 answers
4k views

How do I sell tickets? [closed]

I started a project that required me to create a site selling tickets to a nightclub for special events. People attending the event must be able to buy a ticket or multiple tickets, and add a ticket ...
user avatar
  • 2,363
6 votes
4 answers
4k views

How to create custom commerce order states?

I want to create custom order state's and in a view use a "button" or a "select list" to toggle those states. For example I have view that display's a table of all orders that are marked completed. I ...
user avatar
  • 311
6 votes
6 answers
9k views

Alter cart unit price and total amount

I need help on this code which is invoked on calculate sell price rules event on cart view. Line items and order are properly modified. But nothing is displayed, old unit price amount and old total ...
user avatar
6 votes
1 answer
5k views

How do I use the form hook alt to edit fields of inline entity form?

I am trying to use the hook_form_alter to modify the fields of an Inline entity form in a commerce product display node. I know how to edit a normal field but this does not work for an entity form ...
user avatar
6 votes
2 answers
1k views

Users don't have access to view as soon as relation is added, drupal commerce

I'm creating a new drupal commerce site and I wanted to create a view of all my products. I didn't want to use Format: content but Format: fields instead. Of course then I needed to add a ...
user avatar
  • 539
6 votes
1 answer
7k views

Relation Between Drupal Commerce Line items and Products

I am making a website in Drupal 7 and Drupal Commerce with some custom modules. Now, I have a set of Products. The Products are, - Product 1 - Product 2 - Product 3 I have two line items. Lets ...
user avatar
6 votes
3 answers
4k views

Product comparison with Drupal Commerce

How can I implement a product comparison with the Drupal Commerce module? For example, if there is a list of products, will the user be able to click on checkbox of 3 products, and click the "Compare"...
user avatar
  • 1,591
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 ...
user avatar
  • 3,472
6 votes
1 answer
2k views

Importing products into Drupal Commerce and handling Tax

Im working on an integration module where I'm trying to import products externally and into Drupal Commerce. I revceive the product object externally like this: 2692604 (Object) stdClass id (...
user avatar
6 votes
1 answer
1k views

commerce_cart_order_load not working for anonymous user in drupal commerce

I have created an order programmatically, the order is created and shown in backoffice order listing, but most of the time in the cart it shows empty.When I checked I found that ...
user avatar
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 ...
user avatar
6 votes
1 answer
2k views

Custom line item types without a product reference field

Let me start by saying I am aware of this module: https://www.drupal.org/project/commerce_custom_product This module works great for custom line item types that need to reference a product, however (...
user avatar
6 votes
1 answer
834 views

$promotion->apply($order) doesn't work

I have a redemption form that I want to enter a coupon code and then an order should be created automatically, then the coupon code applied to the order as well. The order gets created successfully ...
user avatar
6 votes
2 answers
715 views

Commerce : adding optional insurance block to shopping cart form : ajax callback

Customers will be purposed an optional insurance in the shopping cart, calculated as a percentage of Cart Total. I added this feature as an editable field in a footer view of the shopping cart, and I'...
user avatar
  • 3,472

1
2 3 4 5
77