Weirdly, I need a fix for this as well (sorry for butting in on your thread manguitas!).
I tried removing all instances of the Fax and Company fields from the checkout process in the following files in catalog\view\theme\my_theme\template\checkout
address.tpl
guest.tpl
guest_shipping.tpl
register.tpl
I also removed the following lines from catalog\language\english\checkout
$_['entry_fax'] = 'Fax:';
$_['entry_company'] = 'Company:';
However once I do this, the continue button in step 2 of the checkout process stops working. I get the small loading gif next to the button but step 3 fails to load.
Any help in removing these 2 fields in particular from the checkout would be massively appreciated!!
Thank you.
I tried removing all instances of the Fax and Company fields from the checkout process in the following files in catalog\view\theme\my_theme\template\checkout
address.tpl
guest.tpl
guest_shipping.tpl
register.tpl
I also removed the following lines from catalog\language\english\checkout
$_['entry_fax'] = 'Fax:';
$_['entry_company'] = 'Company:';
However once I do this, the continue button in step 2 of the checkout process stops working. I get the small loading gif next to the button but step 3 fails to load.
Any help in removing these 2 fields in particular from the checkout would be massively appreciated!!
Thank you.
Apart from removing fields from templates, you also need to remove corresponding actions in appropriate controllers.
If you, for example, remove the field "Fax" from guest checkout template, you also have to make sure it doesn't throw an undefined variable message in guest checkout controller and comment out the following in catalog/controller/checkout/guest.php
Same applies for every other checkout template/controller pairs.
If you, for example, remove the field "Fax" from guest checkout template, you also have to make sure it doesn't throw an undefined variable message in guest checkout controller and comment out the following in catalog/controller/checkout/guest.php
Code: Select all
$this->session->data['guest']['fax'] = $this->request->post['fax'];
Moving from Step 1 to Step 2 works fine for me with a single click on your website. Then there's a json parse error when clicking Continue on Step 5, you need to modify catalog/controller/checkout/confirm.php and remove the reference to fax field too, that's the line
Code: Select all
$data['fax'] = $this->session->data['guest']['fax'];
Hmm...clearly I've done something wrong somewhere. Here's the error log!
Code: Select all
2011-11-08 19:14:40 - PHP Notice: Undefined variable: entry_fax in /homepages/18/d229507269/htdocs/customers/valore/upload/catalog/view/theme/OPC010023/template/checkout/register.tpl on line 20
2011-11-08 19:14:40 - PHP Notice: Undefined variable: entry_company in /homepages/18/d229507269/htdocs/customers/valore/upload/catalog/view/theme/OPC010023/template/checkout/register.tpl on line 39
2011-11-08 19:16:14 - PHP Notice: Undefined index: fax in /homepages/18/d229507269/htdocs/customers/valore/upload/catalog/model/account/customer.php on line 4
2011-11-08 19:16:14 - PHP Notice: Undefined index: company in /homepages/18/d229507269/htdocs/customers/valore/upload/catalog/model/account/customer.php on line 8
2011-11-08 19:16:16 - PHP Notice: Undefined variable: entry_company in /homepages/18/d229507269/htdocs/customers/valore/upload/catalog/view/theme/OPC010023/template/checkout/address.tpl on line 32
2011-11-08 19:16:17 - PHP Notice: Undefined variable: entry_company in /homepages/18/d229507269/htdocs/customers/valore/upload/catalog/view/theme/OPC010023/template/checkout/address.tpl on line 32
2011-11-08 19:16:51 - PHP Notice: Undefined variable: entry_company in /homepages/18/d229507269/htdocs/customers/valore/upload/catalog/view/theme/OPC010023/template/checkout/address.tpl on line 32
2011-11-08 19:16:51 - PHP Notice: Undefined variable: entry_company in /homepages/18/d229507269/htdocs/customers/valore/upload/catalog/view/theme/OPC010023/template/checkout/address.tpl on line 32
2011-11-08 19:16:54 - PHP Notice: Undefined variable: entry_company in /homepages/18/d229507269/htdocs/customers/valore/upload/catalog/view/theme/OPC010023/template/checkout/address.tpl on line 32
2011-11-08 19:16:58 - PHP Notice: Undefined index: fax in /homepages/18/d229507269/htdocs/customers/valore/upload/catalog/model/checkout/order.php on line 4
2011-11-08 19:16:58 - PHP Notice: Undefined index: shipping_company in /homepages/18/d229507269/htdocs/customers/valore/upload/catalog/model/checkout/order.php on line 4
2011-11-08 19:16:58 - PHP Notice: Undefined index: payment_company in /homepages/18/d229507269/htdocs/customers/valore/upload/catalog/model/checkout/order.php on line 4
@manguitas
Okay, let's say I want to remove company field from the payment address fieldset in the second step of the checkout page for both new users and guests (OpenCart 1.5.1.3)
To achieve it, I need to do the following:
1. For customers who want to register an account (checkout - register account)
- remove Company field from the template template/checkout/register.tpl
- add a blank company variable to post array in catalog/controller/checkout/register.php so I don't get any undefined index warnings when the account gets created. Add the line
before
2. For customers who want to checkout as a guest (checkout - guest checkout):
- remove or comment out Company field from the template template/checkout/guest.tpl
- add a blank company variable to post array in catalog/controller/checkout/guest.php so I don't get any undefined index warnings. Add the line
after
in two places.
If you want to remove that field from "New address" input ("I want to use a new address"), you'll also have to do same thing for template/checkout/address.tpl and catalog/controller/checkout/address.php.
That's it for for "Address" fieldset. Basically you have to perform similar actions for other fields in that fieldset. If it's a "required" field, you'll also have to remove validation from the controllers mentioned above.
Same goes for user data (name, surname, etc.) except that you also need to modify or comment out calls to $this->session->data array elements in controller/checkout/confirm.php that you have removed before.
Okay, let's say I want to remove company field from the payment address fieldset in the second step of the checkout page for both new users and guests (OpenCart 1.5.1.3)
To achieve it, I need to do the following:
1. For customers who want to register an account (checkout - register account)
- remove Company field from the template template/checkout/register.tpl
- add a blank company variable to post array in catalog/controller/checkout/register.php so I don't get any undefined index warnings when the account gets created. Add the line
Code: Select all
$this->request->post['company'] = '';
Code: Select all
$this->model_account_customer->addCustomer($this->request->post);
- remove or comment out Company field from the template template/checkout/guest.tpl
- add a blank company variable to post array in catalog/controller/checkout/guest.php so I don't get any undefined index warnings. Add the line
Code: Select all
$this->request->post['company'] = '';
Code: Select all
if ($this->request->server['REQUEST_METHOD'] == 'POST') {
If you want to remove that field from "New address" input ("I want to use a new address"), you'll also have to do same thing for template/checkout/address.tpl and catalog/controller/checkout/address.php.
That's it for for "Address" fieldset. Basically you have to perform similar actions for other fields in that fieldset. If it's a "required" field, you'll also have to remove validation from the controllers mentioned above.
Same goes for user data (name, surname, etc.) except that you also need to modify or comment out calls to $this->session->data array elements in controller/checkout/confirm.php that you have removed before.
I am facing the same problem. i read the conversation and i changed everything accordingly but i am still not able to move to step 3 from step 2. the loading symbol appears once i click on continue but nothing happens. Please help.
Who is online
Users browsing this forum: FazalFariz and 112 guests