add billing address field in magento - php

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.

Related

How to add custom filed name 'mobile number' in customer registration form in magento 2?

I want to add mobile number field in customer registration page. And also want to display that field in admin site customer listing page.
For that I don't want to change in core file. May I create my own extension for that ? If yes then how can i do that please guide me, I am new in magento.
Please go to stores->configuration->customer configuration and enable mobile number.

Issue while adding custom field in billing address section in Magento

I followed this tutorial for inserting new field in billing address section in Magento checkout.
I added new module, form field in billing.phtml page as described in this tutorial. I make sure that the module is enabled in advanced section in admin panel. And the attribute is saved in eav_attribute, sales_flat_order_address, sales_flat_quote_address tables.
The issue is when I make place order the checkout page become broken and nothing can done.
How can I solve this? Please help..

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.

Get notified on stock unavailability

I am trying to create a "Notify me" feature if the stock is unavailable.
On search on admin panel, I could find only that a user should sign up / log in to get notified about the stock availability.
But I just want to let the user (a guest) enter only his/her email address to get notified.
How should I do this?
Please give suggestions..
EDIT:
I have got this link, which gives me a way to start.
Till now what I did is added the following code in my template file which is creating a url for redirect (thinking to do it in ajax way, to stop page refreshing).
<?php
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$base64 = strtr(base64_encode($actual_link), '+/=', '-_,');
$postUrl = "http://$_SERVER[HTTP_HOST]/efk/productalert/add/stock/product_id/" . $simpleProduct->getId() . "/uenc/". $base64;
?>
In the above code, efk is my project folder name.
After this, I have gone to productalert/add/stock controller method i.e stockAction() which is calling sign up / login form (I think so) using $model->save();.
How should I disable this save calling and add my own small overlay which holds a textbox to enter a email address?
Magento has "Notify me when product is back in stock" feature out of the box. It can be configured in admin panel: system / configuration / catalog / product alerts and product alerts run settings.
You're right, it works only for registred customers. To make it working for guest users some coding is required. I'd say you need to do the following steps:
Add email column to product_alert_stock table
Create new controller and action (believe me, it's better than you override existing one via config.xml) which extends Mage_ProductAlert_AddController::stockAction(). Your method will have to set guest's email to productalert/stock model.
Create subscription form and make sure it submits data to your new controller/action.
Update (override) Mage_ProductAlert_Model_Observer::_processStock() method to make it respect situations when "customer" has no ID but has email.
When you'll be testing, I suggest you to install SMTP Pro Email extension and mailcatcher to ease the testing process.
We have done this (http://www.alfresia.co.uk/sorrento-side-table.html/). Here we ended up creating a custom module as when we did this magento did not support any product alert system for the guest users (i do not know if this is supported now).
We first created a text box which would appear on product page where the product is out of stock. We were saving this info in one of our custom tables where we the schema was {id, email, product_sku, status} (status had three values Awaiting Stock, In Stock, and Already Notified).
We then wrote an observer which was hooked to cataloginventory_stock_item_save_after event, this helped us get the product sku which has been back in stock, and update all entries in our custom table with status In Stock and send a mail to the user.
This is how we did it, surely there will be a much cleaner way doing this.
You could have work with plugins. MagentoCommerce has loads of plugins/extensions which does the same
Free Version - http://www.magentocommerce.com/magento-connect/product-out-of-stock-subscription-1350.html
I too had similar requirement, and have installed 'http://www.magentocommerce.com/magento-connect/product-out-of-stock-subscription-1350.html' this plugin.
Well this plugin does the job, But they have override complete product view page template instead of simply adding a new block. By this your custom development on product view page development might get reflected on frontend.
Or else this plugin definitely does the job.
This http://www.magentocommerce.com/magento-connect/product-out-of-stock-subscription-1350.html plugin is really good but it breaks for configurable product types and it completely overrides the product controller which makes your system vulnerable to future upgrades. I think observers should be hooked to events where the product is back in stock and should update the users.

VirtueMart Custom Address Fields

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..

Categories