getformaction()
Please follow the below directory structure : And find the required Answer,
it may help you to customize your block
Defined at:
/app/code/core/Mage/Tag/Block/Product/List.php -> line 75
/app/code/core/Mage/Tag/Block/Customer/Edit.php -> line 50
/app/code/community/Phoenix/Moneybookers/Block/Placeform.php -> line 58
Referenced 5 times:
/app/design/frontend/base/default/template/contacts/form.phtml -> line 31
/app/design/frontend/base/default/template/tag/list.phtml -> line 39
/app/design/frontend/default/iphone/template/contacts/form.phtml -> line 31
/app/design/frontend/default/iphone/template/tag/customer/edit.phtml -> line 31
/app/design/frontend/base/default/template/moneybookers/placeform.phtml -> line 29
For Adding custom attribute, we have to create new column for custom attribute field in sales_flat_order
and sales_flat_quote
We can create it By 2 ways
- By custom Module Mysql setup file (file path-
app/code/local/pwt/singlepagecheckout/sql/singlepagecheckout_setup/mysql4-install-1.1.php
)
Here (pwt -NameSpace, singlepagecheckout-Module)
$installer = $this;
$installer->startSetup();
$installer->addAttribute("order", "delivery_date", array("type"=>"varchar"));
$installer->addAttribute("quote", "delivery_date", array("type"=>"varchar"));
$installer->endSetup();
If you don't have a own module, simply create a php file in the project's root folder with the below code and run this file manually
<?php require_once('app/Mage.php');
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;
$attribute = array(
'type' => 'varchar',
'backend_type' => 'varchar',
'frontend_input' => 'varchar',
'is_user_defined' => true,
'label' => 'Delivery Date,
'visible' => true,
'required' => false,
'user_defined' => false,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'default' => ""
);
$installer->addAttribute('order', 'delivery_date', $attribute);
$installer->addAttribute('quote', 'delivery_date', $attribute);
$installer->endSetup();
echo "success";
Run this file on root folder
Now we have allotted a space for our custom attribute in DB (Created new column in sales_flat_order
and sales_flat_quote
table)
After this, we have to add this custom attribute to global scope in config.xml
.
(if you have been using custom module file path is-app/code/local/pwt/singlepagecheckout/etc/config.xml
if not, app/code/core/mage/sales/etc/config.xml
. But editing core file isn't good practice )
<global>
...
<fieldsets>
<sales_convert_quote>
<delivery_date><to_order>*</to_order></delivery_date>
</sales_convert_quote>
<sales_convert_order>
<delivery_date><to_quote>*</to_quote></delivery_date>
</sales_convert_order>
</fieldsets>
...
</global>
Then create an event in this same config.xml
file
<global>
...
<events>
<checkout_type_onepage_save_order>
<observers>
<delivery_date_observer>
<type>singleton</type>
<class>singlepagecheckout/observer</class>
<method>saveCustomData</method>
</delivery_date_observer>
</observers>
</checkout_type_onepage_save_order>
</events>
...
</global>
<class>singlepagecheckout/observer</class>
–Edit as per your custom module name (in core file you can simply put sales/observer)
The above event triggers the following observer method
public function saveCustomData($observer)
{
$event = $observer->getEvent();
$order = $event->getOrder();
$fieldVal = Mage::app()->getFrontController()->getRequest()->getParams();
$order->setDeliveryDate($fieldVal['delivery_date']);
}
Best Answer
Shipping method for guests
/app/design/frontend/COMPANY/THEMENAME/template/checkout/onepage/shipping_method/available.phtml
Not sure if there are anywhere else that I need to override.
/app/design/frontend/COMPANY/THEMENAME/template/checkout/cart/shipping.phtml