2

One of my client's requirements is that all purchases are made as 'guests' in order to simplify the checkout process.

So what I did was go to
System > Configuration > Advanced
and disabled the Mage_Customer

Everything looked like it was exactly what I needed until I tried the checkout process again. For some reason, the First Name and Last Name fields are no longer showing up and I cannot get past the Billing Information step.

enter image description here

How can I get these fields to show up again while still only allowing for guest purchases? Is it wrong to disable Mage_Customer?

Thanks! Mike

p.s. I am on Magento ver. 1.9.2.2

7
  • What made you think that disabling Mage_Customer from the admin will let your customer checkout as guests? Mar 29 '16 at 22:15
  • @musicliftsme experimentation ... as it removes all links for customer account log ins, I figured it would be what I was looking for. Do you have any insight on how I may be able to allow only Guest checkout? Mar 30 '16 at 1:56
  • You want to remove first name & last name or what ?
    – Magento 2
    Mar 30 '16 at 5:04
  • @Kothari I want the First and Last name fields to show up again. They are currently hidden because I disabled Mage_Customer Mar 30 '16 at 18:11
  • you want to disable right
    – Magento 2
    Mar 30 '16 at 18:18
1

Try this,

Note : Don't Edit Core File

It will remove mandatory fields of First Name & Last Name.

UPDATE eav_attribute SET is_required = 0 WHERE attribute_code = 'lastname'

/app/code/local/Mage/customer/Model/Address/Abstract.php:

 /* if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) {
         $this->addError(Mage::helper('customer')->__('Please enter the last name.'));
     }
*/

/app/code/local/Mage/customer/Model/Customer.php

/*        if (!Zend_Validate::is( trim($this->getLastname()) , 'NotEmpty')) {
        $errors[] = Mage::helper('customer')->__('The last name cannot be empty.');
    }
*/

/app/code/local/Mage/customer/etc/config.xml

<lastname>
                    <billing>1</billing>
                    <shipping>1</shipping>
                    **<required>0</required>** // change from 1 to 0
                    <mapped>1</mapped>
     </lastname>
2
  • Okay I will give this a shot... but ideally I would still like to record the buyers First and Last name. Making it optional does not really solve my problem. Mar 30 '16 at 18:29
  • It's working Example it will make it as optional as First name & Last Name
    – Magento 2
    Mar 30 '16 at 18:31
1

An easier and more cleaner approach is to copy “opcheckout.js” from base theme to your custom theme

/skin/frontend/base/default/js/opcheckout.js

and place this code after line (45 approx)

this.accordion.disallowAccessToNextSections = true;


 this.method = 'guest';
   Element.hide('register-customer-password');
   this.gotoSection('billing', true);

and you are done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.