Don't know why magento is not installing? - magento

I am facing problem when installing magento on my xampp server. There is some path url issue which I have been facing. please look at the screenshot
chrome-extension://mcbpblocgmgfnpjjppndjkmgjaogfceg/fsCaptured.html

Open \app\design\install\default\default\template\install\config.phtml
Find the textbox where the base url is entered. It will be around line no 85 with name ‘config[unsecure_base_url]‘
Remove ‘validate-url’ from its class and save the file.
<li>
<label for="base_url"><?php echo $this->__('Base URL') ?> <span class="required">*</span></label><br />
<input type="text" name="config[unsecure_base_url]" id="base_url" value="<?php echo $this->getFormData()->getUnsecureBaseUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Base URL')) ?>" class="required-entry validate-url input-text" />
</li>
Replace with
<li>
<label for="base_url"><?php echo $this->__('Base URL') ?> <span class="required">*</span></label><br />
<input type="text" name="config[unsecure_base_url]" id="base_url" value="<?php echo $this->getFormData()->getUnsecureBaseUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Base URL')) ?>" class="required-entry input-text" />
</li>
4.Refresh installation page and continue.

Try check "Skip Base URL Validation Before the next step"
Take a look at Please enter a valid URL. Protocol is required (http://, https:// or ftp://) in Magento 1.9.2 installing?

Related

Codeigniter's Validation

Guys I am stuck here in Codeigniter validation. The scenario is that I want to display all the error messages right below each respective input field and not all the error messages together on the top of the form. Could anyone help me, how to do this?
Check below mentioned code. This will help you.
<h5>Username</h5>
<?php echo form_error('username'); ?>
<input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" />
<h5>Password</h5>
<?php echo form_error('password'); ?>
<input type="text" name="password" value="<?php echo set_value('password'); ?>" size="50" />
<h5>Password Confirm</h5>
<?php echo form_error('passconf'); ?>
<input type="text" name="passconf" value="<?php echo set_value('passconf'); ?>" size="50" />
<h5>Email Address</h5>
<?php echo form_error('email'); ?>
<input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" />
Use form_error() function to do that. As describe in manual
echo form_error('username');
All you have to do is put this line under the field where you want to see error message. Here username is the name of the form field
more details
https://www.codeigniter.com/user_guide/libraries/form_validation.html#showing-errors-individually
write below code after your text or drop-down field
<?php echo form_error('field_name','<div class="errorClass">','</div>');?>

Magento Add Instructions to Purchase Order Method on Onepage Checkout

Magento 1.9.1 allows for payment instructions for Bank Transfer and Cash on Delivery, however, there isn't an instructions option for Purchase Order. I'd like to have the same box type below the Purchase Order Number field when the user selects Purchase Order on the checkout. How can I add Instructions in the following places:
Admin Configuration (Purchase Order)
One Page Checkout Payment Type: Purchase Order
Order Review - Payment Method
Receipt / Invoice Page
Purchase Order (No Instructions)
Bank Transfer (Instructions)
Bank Transfer (Payment Method Instructions)
Admin Configuration
I ultimately solved this by going to app/design/frontend/base/default/template/payment/form/purchaseorder.phtml and edidted the source code here.
From this:
<ul class="form-list" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none;">
<li>
<label for="po_number" class="required"><em>*</em><?php echo $this->__('Purchase Order Number') ?></label>
<div class="input-box">
<input type="text" id="po_number" name="payment[po_number]" title="<?php echo $this->__('Purchase Order Number') ?>" class="input-text required-entry" value="<?php echo $this->escapeHtml($this->getInfoData('po_number')) ?>" />
</div>
</li>
</ul>
To this:
<ul class="form-list checkout-agreements" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none;">
<li>
<label for="po_number" class="required"><em>*</em><?php echo $this->__('Purchase Order Number') ?></label>
<div class="input-box">
<input type="text" id="po_number" name="payment[po_number]" title="<?php echo $this->__('Purchase Order Number') ?>" class="input-text required-entry" value="<?php echo $this->escapeHtml($this->getInfoData('po_number')) ?>" />
</div>
</li>
<li>
<div class="<?php echo $this->getMethodCode() ?>-instructions-content agreement-content"><?php echo $this->__('your text here') ?>
</div>
</li>
</ul>
Make sure to add checkout-agreements to the ul class.

Email Validation in Checkout Page in Magento

I need to change the email validation of Magento's Checkout page (Checkout as a Guest).
The problem is the default style of input box contains character support only. When I tried to input email with numbers, it doesn't accept and display number.
So I need a proper validation with regard to its email. The email address input box should also accept characters with numbers.
Thanks,
I tried to check this Code:
File location: onepage/billing.phtml
<?php if(!$this->isCustomerLoggedIn()): ?>
<div class="field">
<label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
<div class="input-box">
<input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->escapeHtml($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
</div>
</div>
<?php endif; ?>
File location: validation.js
['validate-email', 'Please enter a valid email address. For example johndoe#domain.com.', function (v) {
//return Validation.get('IsEmpty').test(v) || /\w{1,}[#][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(v)
//return Validation.get('IsEmpty').test(v) || /^[\!\#$%\*/?|\^\{\}`~&\'\+\-=_a-z0-9][\!\#$%\*/?|\^\{\}`~&\'\+\-=_a-z0-9\.]{1,30}[\!\#$%\*/?|\^\{\}`~&\'\+\-=_a-z0-9]#([a-z0-9_-]{1,30}\.){1,5}[a-z]{2,4}$/i.test(v)
return Validation.get('IsEmpty').test(v) || /^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*#([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(v)
}],
I found the solution.
File Location: template/webtexgiftregisrty/billing.phtml
On th field box of email address, insert the string data types inside the class validation.
Here's the code:
<input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->htmlEscape($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="string input-block-level input-text validate-email required-entry billing-email" />

Magento middle name required

How to make middle name required in magento customer entity?
There is option in System->Configuration->Customer configuration, but it's optional.
To make your Middle Name field Required open the following file:
/app/design/frontend/default/[YOURTHEME]/template/customer/widget/name.phtml
or if it doesn't exist there, open:
/app/design/frontend/base/default/template/customer/widget/name.phtml
Look for the following code:
<input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->htmlEscape($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text" <?php echo $this->getFieldParams() ?> />
Where it says class="input-text" make it say class="input-text required-entry"
<input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->htmlEscape($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text required-entry" <?php echo $this->getFieldParams() ?> />
It's toward the end of the line. Look at the other code in the file as well-- they all have the same class.

Force newsletter subscription in Magento

I am working with Magento, in which I need to require that, if any customer signs up, he/she must be automatically be subscribed to the newsletter.
For instance, in the admin site, if we edit a customer, we get the newsletter checkbox for "Subscribed to Newsletter?". I want that check box to always be checked.
Please help me out.
One small thing : Check this is legal in the territory you are deploying in.
For instance, several legislations insist marketing emails must default to 'Opt In' not 'Opt Out' - this is likely why Magento has the default set as is.
It is also accepted best practice not to try to 'trick' users into accidentally subscribing to things. It may be better to leave the option as 'Off' and use some other way to display a message to encourage users to subscribe.
The simplest way would be to modify the template and substitute the checkbox with a hidden input which is always set to 1. You need to edit the file /app/design/frontend/your_interface/your_theme/template/customer/form/register.phtml.
Remove this chunk of code:
<li>
<input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed" <?php if($this->getFormData()->getIsSubscribed()){ ?> checked="checked"<?php }elseif($this->getFormData()->getIsSubscribed == NULL){ ?> checked="checked"<?php }?> />
<label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
</li>
And add your hidden input just after the other ones near the top of the form:
<input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
<input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
<input type="hidden" name="is_subscribed" value="1" id="is_subscribed" />

Resources