Post by nayefy » Fri May 25, 2012 5:03 am

Hi All,

I need to remove * from postcode,city,telephone so it will not be mandatory when the customer registers.

Version:1.5.2.1
Theme:Shoppica 2

Thanks

Newbie

Posts

Joined
Thu May 10, 2012 4:47 am

Post by opcrat » Fri May 25, 2012 11:12 pm

For that its not just to remove * from your tpl files, you also have to remove its validation from particular controller. Example if you wants to remove city validation from account registration than you have to remove city's validation from catalog/controller/account/register.php file's validate() function,

Code: Select all

if ((utf8_strlen($this->request->post['city']) < 2) || (utf8_strlen($this->request->post['city']) > 128)) {
      		$this->error['city'] = $this->language->get('error_city');
    	}
Add Comment to above lines of code so it will bypass city's validation and remove * from your theme's template/account/register.tpl file's city input field,

Code: Select all

<span class="required">*</span>

Most Useful Extensions || Most Selling Extensions
Opencart Development || Opencart Designing || eCommerce Project

✔ Join more than 5000 Happy Opencart Store Owners enjoying the extensions designed and developed by Opcrat, Opencart Partner.


User avatar
Active Member

Posts

Joined
Wed Dec 21, 2011 6:54 am

Post by gabbya » Wed May 30, 2012 10:36 pm

Best why use ( style="display:none") as below
<tr style="display:none">
<td><span class="required">*</span> <?php echo $entry_telephone; ?></td>
<td><input type="text" name="telephone" value="<?php echo $telephone; ?>" />
<?php if ($error_telephone) { ?>
<span class="error"><?php echo $error_telephone; ?></span>
<?php } ?></td>
</tr>

If required go to (catalog/controller/account/register.php) and add /* */ do disable code.
/*
if (isset($this->error['telephone'])) {
$this->data['error_telephone'] = $this->error['telephone'];
} else {
$this->data['error_telephone'] = '';
}
*/

User avatar
New member

Posts

Joined
Sun May 06, 2012 11:39 pm

Post by tillieb » Mon Jun 18, 2012 10:27 am

I would like to change what fields are required in the checkout page and the return page, but do not quite understand how to do it based on these responses.

I have my own custom theme so that I would not edit any of the default files, but If i have to change controller files (those are located outside of the theme folder, correct?)

Is that okay?
Is that the best practice to make the store work the way *I* need it to?

Any advice or links to other threads about this topic?

Thanks

Newbie

Posts

Joined
Mon Jun 18, 2012 9:40 am

Post by qahar » Mon Jun 18, 2012 8:35 pm

tillieb wrote:I have my own custom theme so that I would not edit any of the default files, but If i have to change controller files (those are located outside of the theme folder, correct?)

Is that okay?
Is that the best practice to make the store work the way *I* need it to?
You can read How do I remove registration form fields?
and if you need to modificate controller, the best think to do is use vQmod.

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia
Who is online

Users browsing this forum: No registered users and 11 guests