Blogs

How to customize cart form in ubercart

My recent Project now deals with ubercart: a shopping cart for drupal. This simple snippet will show you how to theme/customize your cart form like removing unnecessary data,fields,colums or text.
this snippet requires the knowledge about form_alter hook and getting the form_id. The handy form_alter is a great hook for this see my example code below.
 

<?php
function MYMODULENAME_form_alterer_form_alter(&$form, $form_state, $form_id){ switch ($form_id) { // This is our form ID. case 'uc_cart_view_form':

Category: 
Drupal

How to delete a folder or directory using cmd

Suppose you would like to delete a file or directory to ease some time.
let’s start with locating our folder, our folder is inside My Documents we will name this deletethisfolder
open your cmd, then locate your folder.
Follow this path in your cmd
C:\Documents and Settings\admin> cd “My Documents”
Press Enter,
C:\Documents and Settings\admin\My Documents>rmdir /s /q
ex.
C:\Documents and Settings\admin\My Documents>rmdir /s /q “C:\Documents and Settings\admin\My Documents\deletethisfolder”

Category: 
PHP

Unable to send email in ubercart

"Unable to send e-mail. Please contact the site administrator if the problem persists."
 
after i completed my payment from paypal sandbox i got this error messages.
What I did is I just configured the my contact details
http://www.example.com/admin/store/settings/store/edit
that's it! and this solves my problem above.
 
hope this helps!

Category: 
Drupal

How to set-up paypal sandbox in ubercart

taken from Ubercart PayPal sandbox setup
PayPal sandbox preface:

Category: 
Drupal

How to redirect a form in drupal

<?php

function MODULENAME_form_alter(&$form, $form_state, $form_id){
global $user;
switch ($form_id) {
// This is our form ID.
case 'YOUR_NODE_FORM_ID': // like page_node_form(for node/add/page)
$form['buttons']['submit']['#submit'][] = 'redirect_this_form';
break;
}
}
function redirect_this_form($form, &$form_state) {
if ($form_state['nid']) {
$node = node_load(array('nid' => $form_state['nid']));
switch($node->type) {
case 'page':

Category: 
Drupal

How to specify block visibility using specific content types and urls

Please refer to this URL (http://drupal.org/node/134425)

Category: 
Drupal

Fatal error Allowed memory size in drupal

Whenever you encountered this in your webserver/webhost just add this in your .htaccess file
 
php_value memory_limit 16M

Category: 
Drupal

how to remove index.php in code igniter

To do this just follows the following steps:

Category: 
Code Igniter

how to call base_url in codeigniter

just load the url helper
example:
class Welcome extends Controller { public function __construct(){ parent::Controller();    }    function index(){ //$this->config->load('config.php'); $this->load->helper('url'); $this->load->view('welcome_message'); }}

Category: 
Code Igniter

How to create a link image in drupal


this snippet enables you to create a image link


<?php
print l('<img src="'.path_to_theme().'/images/icons/page/hris.png" alt="Business Package - Human Resource Information System (HRIS) " class="business_package_images" />','solutions/hris_ja',array('html' => TRUE));
?>

notice there are 3 parameters: l(1st_param,2nd_param,3rd_param);

1st_param: the html image
2nd_param: the url/path
3rd_param: enable html to TRUE

Category: 
Drupal
Syndicate content
Welcome to my personal website
Name:
Arnel H. Bornales
E-mail:
arnelbornales@yahoo.com
Job:
Web developer/Freelancer
Cel No:
+639206369494
YM:
achilles085
Skype :
arnelbornales
See me online!
ONLINE
ONLINE
a