Drupal Commerce

User login

Why Drupal Commerce?

Drupal Commerce is a collection of modules that lets you expand into the world of selling online. It uses the strength of other modules such as Views and Rules, and it provides a flexible framework which can be used to build complicated business solutions.

Drupal Commerce provides a truly flexible, solid foundation for building even very complex business applications. Some of the reasons it stands out as an excellent and secure solution are the following:

Drupal Commerce

Drupal Commerce provides a truly flexible, solid foundation for building even very complex business applications. Some of the reasons it stands out as an excellent and secure solution are the following:

Drupal 7: Addressfield - Change the order of the inner fields

A request that often comes up is to change the order of the Addressfield fields.
In this example, we are creating a custom module in order to position the Country field at the bottom.
It is a very simple function, and the other elements can be positioned in a similar fashion.

Drupal Commerce - Translate Order total, Shipping Information, Billing information

If you do not want to use i18n_string and i18n_field in order to translate the Order total, Shipping & Billing Information texts, that show up in the cart and on the checkout pages when using Drupal Commerce, the following hacky approach should do the trick.

First, the following funcion can be used in your template.php file:

Drupal Commerce - "Select a product" element: How to change the select list to radio buttons

Here is the code that changes the default select list of "Select a product" element of Drupal Commerce to radio buttons, for a standalone product list.

The following goes in a custom module (tested in Drupal 7).

<?php
function MYMODULE_form_alter(&$form, $form_state, $form_id) {
  if (
strpos($form_id, 'commerce_cart_add_to_cart_form_') === 0 && isset($form['product_id'])) {
   
$form['product_id']['#type'] = "radios";   
  }
}
?>

Subscribe to Drupal Commerce