Questions tagged [commerce]
One of the modules that implements an eCommerce framework and ecosystem is the Drupal Commerce module.
3,924
questions
20
votes
4
answers
15k
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 ...
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 ...
18
votes
5
answers
9k
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 ...
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 ...
16
votes
4
answers
28k
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 ...
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?
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, ...
15
votes
3
answers
17k
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) {...
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 ...
12
votes
3
answers
19k
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' ...
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 ...
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
$...
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 ...
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 ...
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 ...
9
votes
3
answers
19k
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 ...
9
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.)...
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 ...
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 (...
9
votes
1
answer
3k
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 ...
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 ...
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
8
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 ...
8
votes
3
answers
865
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. ...
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 ...
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 ...
8
votes
1
answer
503
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 ...
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 ...
7
votes
1
answer
12k
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 ...
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 ...
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;
$...
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 ...
7
votes
2
answers
789
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 ...
7
votes
6
answers
14k
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 ...
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 ...
7
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 ...
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 ...
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 ...
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 ...
6
votes
4
answers
5k
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 ...
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 ...
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 ...
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 ...
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 ...
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"...
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 ...
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 (...
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 ...
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 (...
6
votes
1
answer
926
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 ...