For a downloadables-only shopping cart, I don't really need address and phone number details. In Zen-Cart I could specify from the Admin console which details are mandatory on create-account. I couldn't however find this in OpenCart's Admin console. If it's there, where would I find it?
If this feature is not available in OpenCart, what is the recommended way to make certain account fields (which are required by default) not required?
Thanks.
If this feature is not available in OpenCart, what is the recommended way to make certain account fields (which are required by default) not required?
Thanks.
What I did was a dirty hack (to call it something). Just make the fields you don't want to be required hidden fields, and assign them a value, such as "NULL" or "EMPTY" so that OC doesn't bring up an error.
This means, that in your "catalog/view/theme/default/account/create.tpl" file (replace default with your theme name if needed), if you want field "telephone" to be not mandatory, you should change the following code:
to this (for example):
I think that's the least invasive mod you can do, since it doesn't touch controllers or models at all.
Keep in mind that by default, this information will be visible to the user if they edit their account.
It will also be visible if they decide for some reason to view your source-code, however, it works.
This means, that in your "catalog/view/theme/default/account/create.tpl" file (replace default with your theme name if needed), if you want field "telephone" to be not mandatory, you should change the following code:
Code: Select all
<input type="text" name="telephone" value="<?php echo $telephone; ?>" />
Code: Select all
<input type="hidden" name="telephone" value="00000000" />
Keep in mind that by default, this information will be visible to the user if they edit their account.
It will also be visible if they decide for some reason to view your source-code, however, it works.
Hmmm... this is a nice and simple suggestion. In my case my bought theme does not the file catalog/view/theme/CustomTheme/account/create.tpl - so I guess I need to look modify catalog/view/theme/default/template/account/register.tpl in my case. My OC version is 1.5.3.1
Aubrey at
TheoLogos Publications 神道出版社
Bad way to do it... VERY bad...johnnyart wrote:What I did was a dirty hack (to call it something). Just make the fields you don't want to be required hidden fields, and assign them a value, such as "NULL" or "EMPTY" so that OC doesn't bring up an error.
This means, that in your "catalog/view/theme/default/account/create.tpl" file (replace default with your theme name if needed), if you want field "telephone" to be not mandatory, you should change the following code:
to this (for example):Code: Select all
<input type="text" name="telephone" value="<?php echo $telephone; ?>" />
I think that's the least invasive mod you can do, since it doesn't touch controllers or models at all.Code: Select all
<input type="hidden" name="telephone" value="00000000" />
Keep in mind that by default, this information will be visible to the user if they edit their account.
It will also be visible if they decide for some reason to view your source-code, however, it works.
it would be better to edit your .tpl file and take out the "*" register star... and then edit the controller php and take out the check to see if the field is full...
you could do something like this if you were to disable the first name:
open admin/contoller/sale/customer.php
find and delete:
Code: Select all
if (isset($this->error['firstname'])) {
$this->data['error_firstname'] = $this->error['firstname'];
} else {
$this->data['error_firstname'] = '';
}
Code: Select all
if ((utf8_strlen($this->request->post['firstname']) < 1) || (utf8_strlen($this->request->post['firstname']) > 32)) {
$this->error['firstname'] = $this->language->get('error_firstname');
}
[code]
(if you want you could also delete the calls to the error wording in the language files and delete it from the language files.
open admin/view/template/sale/customer_form.tpl
find:
[code] <tr>
<td><span class="required">*</span> <?php echo $entry_firstname; ?></td>
<td><input type="text" name="firstname" value="<?php echo $firstname; ?>" />
<?php if ($error_firstname) { ?>
<span class="error"><?php echo $error_firstname; ?></span>
<?php } ?></td>
</tr>
Code: Select all
<tr>
<td><?php echo $entry_firstname; ?></td>
<td><input type="text" name="firstname" value="<?php echo $firstname; ?>" />
</span></td>
</tr>
Please let me know if that helps
Cheers
Jem
Hand Dryers
Bookstore Mod
QuickShop Module
Restricted Access - Compulsory Login
Template Override - Category Specific (vQmod)
Template Override - Brand Specific (vQmod)
How did you find out about us register question mod
Compulsory Login vQmod
Brands In Top Menu
zoom - Product Image - Auto on hover
Active Member
Who is online
Users browsing this forum: No registered users and 102 guests