VirtueMart Custom Address Fields - php

I'm building a shipping module for Virtuemart 2 for a South African Courier Company, and I need to add a few extra fields to the addresses, and change some existing ones.
I have to add Location Type (Drop down), Building Details (Text) and pre-populate state and city with my own fields (Drop down).
I already managed to find a solution for State, as there is a database table called _virtuemart_states, and adding to that seems to work. However, that’s about as far as I get...
The extra fields should be read and saved by my shipping module for later use... And should also be saved to the address so that a client can check out later using the same address.

try this,
I think the VM2.x is already providing those option.
You can add as many as custom address fields from back end
Under configuration of VM - > Shopper Fields.
www.yousite.com/administrator/index.php?option=com_virtuemart&view=userfields
If you are planning for shipping plugin just check the code for creating custom address fields and try that in your plugin .
Hope its help you..

Related

magento onepage checkout manage fields

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.

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.

Magento onestepcheckout change billing address fields order

I want to change the order of the billing address fields on onestepcheckout page. I found from the admin onestepcheckout settongs "field position management" But a message displays here "Configure positions of fields in Section Billing and Shipping Address. You can display fields into 2 columns (eg: First name + Last name) or 1 full column (eg: Address + Null)".
I change the order her but its not reflecting. Also I am unable to find the billing and shipping address section. Pleas help me to find this secion.
You are probably using a paid 3rd party extension so the best option would be to contact extension provider support to get the answer.
And in all cases when you are using paid extensions try to solve your issues with support first then ask as:
other developers most probably don't have access to source to help you out
your questions in open internet are indexed and may just cost a sale for the extension provider
your questions in open internet might not get the extension provider attention
You can do that from Admin > System > Configuration > Onestepcheckout
http://www.YOURWEBSITE.com/index.php/admin/system_config/edit/section/onestepcheckout/

Magento Custom Address Attribute in Back-end

I have created a customer address attribute in Magento called 'addresstype' that is a varchar with radio options of 'Residential' and 'Business' on the front-end.
The attribute is saved during checkout and appears in the database. Customers can edit their profiles and I can actively pull the variables using $address->getAddresstype(); to check the appropriate radio button.
My only problem is that in the back-end on individual sales order pages, the variable is not coming through. I have edited /app/code/core/Mage/Customer/Block/Address/Renderer/Default.php (using $address->getAddresstype()) and can see the attribute in the array using print_r($attributes = Mage::helper('customer/address')->getAttributes());
It is marked as 'is_visible' in the database as well.
This is because the sales order / invoice pages pull the information back from different tables (sales_flat_order_address). Assuming you have it in the right place in the first time (which it seems you do), then you just need to make Magento copy the correct information over.
<fieldsets>
<sales_convert_quote_address>
<your_attribute>
<to_order>*</to_order>
</your_attribute>
</fieldsets>
You might also have to add another field set value in to copy the value from the address to the quote address, off the top of my head I can't remember. If you search Magento's code for fieldsets in *.xml you should find examples.

Categories