To change the redirect location in Zen Cart after the user logs in, look for the following file:
"includes/languages/english/login.php"
Then search for the appropriate calls to "zen_redirect" and change to:
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'));
Programming solutions, source code, solutions to tech problems and other tech related stuff.
Wednesday, November 11, 2009
Removing required fields in zen cart user sign up page when they create an account
To remove most of the fields in the 'Create an Account' page, this can be achieved by disabling them one by on in the admin module under the menu:
Configuration->Customer details
One that caught me out was the Mr/Ms field for account gender. Which was strangely Called 'Email Salutation.'
However, there are other stubborn fields such as:
Telephone Number
City
State
Post Code
Street Address
Country (really stubborn)
This is a hack, but it did the job. Basically what I did to get rid of these was:
1. Delete/comment out any code inside the file that is not needed:
'templates/template_default/templates/tpl_modules_create_account.php'
Make sure that the layout of the page is not broken.
2. In the admin module of the shop, click on Configuration->Minimum Values, and set the minimum values for such deleted fields to 0.
3. Then you're left with the stubborn field 'Country'
To get rid of that (hack again), open the file:
'includes/modules/create_account.php'
Roughly around line 225, you will see the following code, which needs to be commented out:
if ( (is_numeric($country) == false) || ($country < 1) ) {
$error = true;
$messageStack->add('create_account', ENTRY_COUNTRY_ERROR);
}
4. Finally, edit the following file, so that the 'Your Account Has Been Created' page doesn't look silly:
'templates/template_default/templates/tpl_create_account_success.php'
I hope this helps!
Configuration->Customer details
One that caught me out was the Mr/Ms field for account gender. Which was strangely Called 'Email Salutation.'
However, there are other stubborn fields such as:
Telephone Number
City
State
Post Code
Street Address
Country (really stubborn)
This is a hack, but it did the job. Basically what I did to get rid of these was:
1. Delete/comment out any code inside the file that is not needed:
'templates/template_default/templates/tpl_modules_create_account.php'
Make sure that the layout of the page is not broken.
2. In the admin module of the shop, click on Configuration->Minimum Values, and set the minimum values for such deleted fields to 0.
3. Then you're left with the stubborn field 'Country'
To get rid of that (hack again), open the file:
'includes/modules/create_account.php'
Roughly around line 225, you will see the following code, which needs to be commented out:
if ( (is_numeric($country) == false) || ($country < 1) ) {
$error = true;
$messageStack->add('create_account', ENTRY_COUNTRY_ERROR);
}
4. Finally, edit the following file, so that the 'Your Account Has Been Created' page doesn't look silly:
'templates/template_default/templates/tpl_create_account_success.php'
I hope this helps!
Sunday, November 01, 2009
Zen cart Configuration and Email Options or Transport Not Showing
I thought I'd post this, since it just took up the last few hours of my day trying to figure it out.
The problem was that in my zencart installation on a windows machine I was getting nothing displayed when I clicked on any of the options in the configuration section of the admin panel.
Eventually, I found a fix at the strangest of places. I found the following line in "admin\configuration.php"
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where configuration_group_id = '" . (int)$gID . "'
order by sort_order");
Then changed it to:
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where trim(configuration_group_id) = '" . (int)$gID . "'
order by sort_order");
As you may notice, I used a trim function on the trim(configuration_group_id) then everything worked fine.
It seems that the mysql version that I am using might not be the smoothest to use for zencart, but all is working for now. So I will see how things go.
The problem was that in my zencart installation on a windows machine I was getting nothing displayed when I clicked on any of the options in the configuration section of the admin panel.
Eventually, I found a fix at the strangest of places. I found the following line in "admin\configuration.php"
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where configuration_group_id = '" . (int)$gID . "'
order by sort_order");
Then changed it to:
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where trim(configuration_group_id) = '" . (int)$gID . "'
order by sort_order");
As you may notice, I used a trim function on the trim(configuration_group_id) then everything worked fine.
It seems that the mysql version that I am using might not be the smoothest to use for zencart, but all is working for now. So I will see how things go.
Zen cart Configuration and Email Options or Transport Not Showing
I thought I'd post this, since it just took up the last few hours of my day trying to figure it out.
The problem was that in my zencart installation on a windows machine I was getting nothing displayed when I clicked on any of the options in the configuration section of the admin panel.
Eventually, I found a fix at the strangest of places. I found the following line in "admin\configuration.php"
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where configuration_group_id = '" . (int)$gID . "'
order by sort_order");
Then changed it to:
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where trim(configuration_group_id) = '" . (int)$gID . "'
order by sort_order");
As you may notice, I used a trim function on the trim(configuration_group_id) then everything worked fine.
It seems that the mysql version that I am using might not be the smoothest to use for zencart, but all is working for now. So I will see how things go.
The problem was that in my zencart installation on a windows machine I was getting nothing displayed when I clicked on any of the options in the configuration section of the admin panel.
Eventually, I found a fix at the strangest of places. I found the following line in "admin\configuration.php"
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where configuration_group_id = '" . (int)$gID . "'
order by sort_order");
Then changed it to:
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where trim(configuration_group_id) = '" . (int)$gID . "'
order by sort_order");
As you may notice, I used a trim function on the trim(configuration_group_id) then everything worked fine.
It seems that the mysql version that I am using might not be the smoothest to use for zencart, but all is working for now. So I will see how things go.
Subscribe to:
Posts (Atom)