magento onepage checkout manage fields - php

I want to show FAX field at every checkout. Right now in magento 1.9.1 there is a functionality that if you are existing user and you are giving order two or more times then it doesn't ask you to enter address everytime but it will auto fill it from database. But I want that FAX fields should always be visible to user and if he enters value then store it otherwise it should store NULL value.
Thanks in advance.

You can add field in checkout look field add in checkout.
In this link you will find jobtitle added in checkout you need to replace "job title" with "FAX".

Magento should have a fax functionality under the customer address object.
https://www.mymagento.com/index.php/admin/customer_address_attribute/
Either enable it and toggle it to required or duplicate the phone field and set it to be fax. You may need to tweak it as desired in the frontend template used: ( vanilla: app\design\frontend\base\default\template\checkout\onepage\shipping.phtml )
If you're looking to force confirmation on an existing customer address entry (fax) there may be a more extensive customization you need to do.
I would explore your onepagecheckout controller that is currently used ( vanilla: app\code\core\Mage\Checkout\controllers\OnepageController.php ) to see if any other customizations/validation is needed.

Related

Wordpress checkout, modify fields content before going into db

I've add an hidden field on my checkout process plugin. I would like to programmatically change the customer phone number after he submits the order. What would be the correct hook to use, and also where I get the fields as reference, or I need to change the customers information in a different way ?
Thanks

How to make Woocommerce not to save Checkout billing fields

I have a particular case where I need many people to login to ONE specially created user (one login name and one password for all) and purchase items through it. The problem is if Person A logins with this ONE user credentials and makes a purchase he will leave a trace in shipping/billing details, person B will then see those details when in checkout page. Woocommerce saves those details by default, how could I disable that? How can I make Woocommerce Chechout page to always have empty fields with no prepopulated data from previous purchases?
Thanks!
Mantas
you need this filter... this filter is meant to overwrite the values being displayed at checkout... below will return empty string... to empty the values being displayed.
add_filter('woocommerce_checkout_get_value','__return_empty_string',10);
But this does not mean, these values won't be seen in other places.. like "My Account" page..

How can I put shipping and billing address on one page in virtuemart ?

I am trying to customize by putting shipping and billing address in registration page (group them by putting rectangle box) and have a check box for billing if it is same as shipping address. The problem is, I have no idea how to do it. Thank you in advance for your help.
Registration fields could be set under:
Virtuemart -> Configuration -> Shopper Fields
There are options if you want to show / hide fields in: Registration form, Shipment form, Account maintenance.
In order to group them with a rectangle box you have to set the appropriate delimiter fields for each section and design them with css.
Hope this helps

add billing address field in magento

I need to add a one new billing address field
which should be shown in frontend and admin both also in packaging slip.
For this I have search on google and I found the below link
http://www.magentocommerce.com/wiki/5_-_modules_and_development/how_to_add_custom_field_in_billing_and_shipping_address_in_frontend_and_backend
I have exactly follow all the steps they have suggested ,
but the new field is not appeared in the admin at the customer address section.
I am using the magento1.7.02 version.
Please suggest me what could be the issue or the changes should be.
I have added fields in magento admin panel
using the steps given in the link, directly in the database.
http://excellencemagentoblog.com/magento-adding-custom-field-to-customer-address
Then insert a record and check.
For checkout page, add the field in the path
/app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml
Then you have add the address format using the above url. Kindly let me know, if you have any clarification.

Magento Address Field not available in One Page Checkout

I have created couple of custom fields in Magento's customer addresses using a tutorial available here.
When a customer edits his/her address the fields are shown, when he is checking out through the one page checkout being logged in, the addresses appear as a drop down. In this case the address is hidden from the client using a display:none; style.
The problem is that the custom address attributes are not available but the regular attributes are available.
What I think is that when the customer is editing the address, the controller is customer and when he is on onepage the controller is checkout. There is some error or I am missing something so that the onepage controller fails to pull custom address fields.
What I have done:
I have overridden the billing.phtml file in
/app/design/frontend/base/default/template/checkout/onepage
The fields show up in the onepage checkout billing section. But when the system is loading a default address the fields values are not loaded like other values get loaded. For example, the phone number is loaded by calling the function
$this->getAddress()->getTelephone();
but when i call my custom field whose name is address_mobile like
$this->getAddress()->getAddressMobile();
The system can not pull the value, like it pulls for telephone. Below is the source code of how the field appears in hidden section.
The one step checkout does not look for any custom fields.
If you look in app / design / frontend / base / default / template / persistent / checkout / onepage / Billing.phtml
In this instance were looking at the billing address that can be changed you can also do the same for shipping if required.
What you will need to do is update the template file above ( Ideally moving it to your package under app design frontend ). This will be showing the new form fields on the checkout but it wont actually persist to the database. In order to save these values to the database you are going to need to override the OnePageController.php and the saveBilling / saveShipping methods to store your data.
If you need any more help on this let me know and I will look to find an example that you can use.

Categories