Is it possible to adjust / remove entry fields on registration page?
Image:
In admin panel go to Customer > Custom Field
Here you can add any custom field you want. Just check Required before saving new field, and enable it. After that you will see it in your registration page.
Removing unnecessary field, like Fax
Open catalog/view/theme/default/template/account/register.tpl
Find following
<div class="form-group">
<label class="col-sm-2 control-label" for="input-fax"><?php echo $entry_fax; ?></label>
<div class="col-sm-10">
<input type="text" name="fax" value="<?php echo $fax; ?>" placeholder="<?php echo $entry_fax; ?>" id="input-fax" class="form-control" />
</div>
</div>
Replace it with following (using same name="fax" as above)
<input type="hidden" name="fax" value="" />
Removing necessary field, like Address
Do everything from the previous chapter
Open catalog/view/theme/default/template/account/register.tpl
Find following
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-address-1"><?php echo $entry_address_1; ?></label>
<div class="col-sm-10">
<input type="text" name="address_1" value="<?php echo $address_1; ?>" placeholder="<?php echo $entry_address_1; ?>" id="input-address-1" class="form-control" />
<?php if ($error_address_1) { ?>
<div class="text-danger"><?php echo $error_address_1; ?></div>
<?php } ?>
</div>
</div>
Replace it with following (using same name="fax" as above)
<input type="hidden" name="address_1" value="" />
Now open catalog/controller/account/register.php
Find private function validate() {, Inside of this function we can see all validations.
Look for
if ((utf8_strlen(trim($this->request->post['address_1'])) < 3) || (utf8_strlen(trim($this->request->post['address_1'])) > 128)) {
$this->error['address_1'] = $this->language->get('error_address_1');
}
and remove (or comment) it.
Related
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-telephone1">Confirm Telephone</label>
<div class="col-sm-10">
<input type="tel" name="telephone1" value="" placeholder="Confirm Telephone" id="input-telephone1" class="form-control" required/>
<?php if ($error_telephone1) { ?>
<div class="text-danger"><?php echo $error_telephone1; ?></div>
<?php } ?>
</div>
</div>
I am getting an error message even though I have already defined a variable in language and controller. Error message is given below:
errorNotice: Undefined variable: error_telephone1 in /home/chaarms/public_html/catalog/view/theme/default/template/account/register.tpl on line 85
in corresponding controller file, in your case catalog/controller/account/register.php you should define it:
$data['error_telephone1'] = "some code where from you want to get this info";
for example if you want to add some text code should be next:
$data['error_telephone1'] = $this->language->get('error_telephone1');
and in corresponding language file add:
$_['error_telephone1'] = 'Telephone error!!!';
that's all.
I have a simple input radio for toggling between active and inactive. I can not figure out how to get Ember to tie this to the model. My RAW html currently looks like this:
<fieldset class="checkboxes">
<label class="active" for="is_active">
<input type="radio" id="is_active" name="status" value="1" checked="">
<span>Active</span>
<div class="input"></div>
</label>
<label class="sep">/</label>
<label class="inactive" for="inactive">
<input type="radio" id="inactive" value="0" name="status">
<span>Inactive</span>
<div class="input"></div>
</label>
Does anyone have any ideas on how to do this using the Ember form model binding?
make your labels action, that will allow you to play with them in the controller. I hope this help....
<fieldset>
<label class="option-buttons" for="reason1" {{action "setDeclineReason" "Too Expensive" on="mouseDown"}}>
<input name="decline-reason" id="reason1" value="Too Expensive" type="radio">
<span>
<div class="check"></div>
Too expensive
</span>
</label>
<label class="option-buttons" for="reason2" {{action "setDeclineReason" "Lack of Amenities" on="mouseDown"}}>
<input name="decline-reason" id="reason2" value="Lack of Amenities" type="radio">
<span>
<div class="check"></div>
Lack of amenities
</span>
</label>
</fieldset>
App.DeclineController = Ember.Controller.extend({
declineReason: null,
decline: function(){
var update = this.store.update('request', {
id: this.get('model').id,
user_decline_reason: this.get('declineReason')
});
update.save();
actions:{
setDeclineReason: function(declineReason){
this.set('declineReason', declineReason);
}
}
});
I have added a product in opencart with 0 quantity but when I see it in front end then I want to show out of stock text and the add to cart button should also be disabled
Note : It's not recommended to make the direct changes in the core
files. You can make the vqmod for the same changes. changes given here
are tested in the default template, it might be different in other
custom theme.
Before
After
(1) Open catalog/controller/product/product.php (approx line num : 273) and search for the line:
if ($product_info['quantity'] <= 0) {
and make the changes as below:
$data['stock_qty']=1;
if ($product_info['quantity'] <= 0) {
$data['stock'] = $product_info['stock_status'];
$data['stock_qty']=0;
} elseif ($this->config->get('config_stock_display')) {
$data['stock'] = $product_info['quantity'];
} else {
$data['stock'] = $this->language->get('text_instock');
}
(2) Open catalog/view/theme/default/template/product/product.tpl (approx line num 303 to 309)
and wrap the block of "add to cart button" inside the condition.
<?php if($stock_qty!=0) { ?>
<div class="form-group">
<label class="control-label" for="input-quantity"><?php echo $entry_qty; ?></label>
<input type="text" name="quantity" value="<?php echo $minimum; ?>" size="2" id="input-quantity" class="form-control" />
<input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
<br />
<button type="button" id="button-cart" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary btn-lg btn-block"><?php echo $button_cart; ?></button>
</div>
<?php } ?>
In the administrative dashboard;
Hover over the menu bar where it says SYSTEM and then click on
SETTINGS in the drop-down menu.
Select the STORE that you wish to edit and then click on EDIT on the
far right to proceed.
Click on the TAB that says OPTION, then scroll down until you see the
option labeled SHOW OUT-OF-STOCK WARNING.
i want to add an option with select control about send mail to customer or not when admin add new order or edit the existing order. and i have trouble with using API.
i added this :
<div class="form-group">
<label class="col-sm-2 control-label" for="input-mailcontrol"><?php echo $entry_email; ?><span data-toggle="tooltip" title="<?php echo $button_shipping; ?>" data-loading-text="<?php echo $text_loading; ?>" </span></label>
<div class="col-sm-10">
<select name="mailcontrol" id="input-mailcontrol" class="form-control">
<?php if ($mailcontrol) { ?>
<option value="1" selected="selected"><?php echo $text_enabled; ?></option>
<option value="0"><?php echo $text_disabled; ?></option>
<?php } else { ?>
<option value="1"><?php echo $text_enabled; ?></option>
<option value="0" selected="selected"><?php echo $text_disabled; ?></option>
<?php } ?>
</select>
</div>
</div>
and also these:
$('#tab-customer input[name=\'mailcontrol\']').val(item['mailcontrol']);
and i added everywhere that i see the customer fields.
but still i can not reach that data on the api side. always having same error about there is no such data.
thank you for your helps.
i solved problem with custom fields, i added radio controls with custom fields and checked this custom fields about send mail or not send.
catalog-model-checkout line 605.
$mail_control=$this->db->query("SELECT * from order where order_id='".(int)$order_id."'");
foreach($mail_control->rows as $m){
$t=$m['custom_field'];}
if (!$this->model_payment_amazon_checkout->isAmazonOrder($order_info['order_id']) && strpos($t,"3")){ // 3= custom_field_id
In the code above how can I search for editEntidadeXXX on the name attribute and then insert this value on the id attribute?
Something like editEntidade(\w)+ will found the names but it is possible to insert that values on the edit attribute?
<div class="control-group column-group horizontal-gutters">
<label class="large-15 small-100 content-right" for="editEntidadeRua">Rua</label>
<div class="control large-40 medium-40 small-100">
<input type="text" id="editEntidade" name="editEntidadeRua" value="<?php echo html_escape($entidadeValues['rua']) ?>">
</div>
</div>
<div class="control-group column-group horizontal-gutters">
<label class="large-15 small-100 content-right" for="editEntidadeCodpostal">Código Postal</label>
<div class="control large-10 medium-10 small-100">
<input type="text" id="editEntidade" name="editEntidadeCodpostal" value="<?php echo html_escape($entidadeValues['codpostal']) ?>">
</div>
</div>
Find What:
id="editEntidade"(\s+)name="editEntidade(\w+)"
Replace With:
id="editEntidade$2" name="editEntidade$2"