Skip to content

Category «Drupal»

56 best practices for Drupal performance

I can across this article which I thought was a very good collection of tips to improve drupal performance. If you are a beginner you would be doing some of these, but I am sure you will learn a lot from this. I. Basic Setup and Configuration (16 tips)Correctly configure Block Visibility settingsDisable ‘Rebuild theme …

how to recover grub in redhat linux?

Friends !If your windows boot-loader Get corrupted you can use the windows boot disk to boot your system in recovery console and can run the command# fixboot#fixmbrTo repair your windows boot loader. The same i am here going to tell you about linux. First Thing i am going to corrupt my linux grub. by typing …

Backup and restore Drupal sites with Drush

Backup and restore Drupal sites with Drush Submitted by abhishek on Thu, 11/08/2012 – 17:10 Drush is a really great tool! It provides two very useful commands to perform backup and restore operations on Drupal sites. Previously we had to create and restore sql dump and files tarball manually. With new Drush it’s really easy. Please check …

Create Order through Custom Code in Commerce [Drupal CMS]

function make_new_commerce_order($uid, $productID, $qty, $bc_order_id) { $cuser = user_load(array(‘uid’ => $uid)); $order = commerce_order_new($uid, ‘pending’); //Set order Number $order->order_number = $bc_order_id; $order->mail = $cuser->mail; // Save the order so its ID is assigned. commerce_order_save($order); // create an UC order for this user/product/qunatity $order_wrapper = entity_metadata_wrapper(‘commerce_order’, $order); //add products to order by ids array $product = …

Create Order through Custom Code in Commerce [Drupal CMS]

function make_new_commerce_order($uid, $productID, $qty, $bc_order_id) { $cuser = user_load(array(‘uid’ => $uid)); $order = commerce_order_new($uid, ‘pending’); //Set order Number $order->order_number = $bc_order_id; $order->mail = $cuser->mail; // Save the order so its ID is assigned. commerce_order_save($order); // create an UC order for this user/product/qunatity $order_wrapper = entity_metadata_wrapper(‘commerce_order’, $order); //add products to order by ids array $product = …

Change Allowed Value in list in Drupal 7

<?php /** * Implements hook_permission(). */ function dynallowed_permission() { return array( ‘administer dynallowed’ => array( ‘title’ => t(‘Alter Field List Allowed Values Function’), ‘description’ => t(‘This give field administrators access to alter the options list source for fields.’), ), ); } function dynallowed_form_field_ui_field_settings_form_alter(&$form, &$form_state){ dynallowed_form_field_ui_field_edit_form_alter($form, $form_state); } function dynallowed_form_field_ui_field_edit_form_alter(&$form, &$form_state) { if (user_access(‘administer dynallowed’)) { …

Create Order through Custom Code in Commerce [drupal cms]

function make_new_commerce_order($uid, $productID, $qty, $bc_order_id) { $cuser = user_load(array(‘uid’ => $uid)); $order = commerce_order_new($uid, ‘pending’); //Set order Number $order->order_number = $bc_order_id; $order->mail = $cuser->mail; // Save the order so its ID is assigned. commerce_order_save($order); // create an UC order for this user/product/qunatity $order_wrapper = entity_metadata_wrapper(‘commerce_order’, $order); //add products to order by ids array $product = …