In csv file
"Mage_Module::Original Text String","Customized Text String"
Source http://magebase.com/magento-tutorials/quick-tip-translating-strings-from-specific-modules/
<?php | |
/* | |
Just create as many shopping cart price rules that are elligible for free shipping | |
and this block class will use the most appropriate one to define: | |
- minimum amount to get freeshipping | |
- remaining amount to purchase to get freeshipping. | |
If no rule is elligible, the block falls back to a CMS block. |
<?php | |
Mage::getSingleton('core/session')->setSkipSessionIdFlag(true); | |
// line below may also be needed | |
Mage::app()->setUseSessionInUrl(false); | |
?> |
<?php | |
// This code must in a block class, child of Mage_Core_Block_Abstract | |
// Retrieve value of 'alt-template' attribute from layout for current block | |
$blockElement = $this->getLayout()->getXpath("*/block[@name='" . $this->getNameInLayout() . "']"); | |
if($blockElement) { | |
/* @var $blockElement Mage_Core_Model_Layout_Element */ | |
$blockElement = end($blockElement); | |
$altTemplate = $blockElement->getAttribute('alt-template'); | |
if(!is_null($altTemplate)) { | |
$this->setTemplate($altTemplate); // Or your logic... |
<!-- Update config node /config/global/sales/order/states like this: --> | |
<config> | |
<global> | |
<sales> | |
<order> | |
<states> | |
<[state_code]> | |
<!-- | |
Available state_code are: | |
. new |
<?php | |
/** | |
* 1) Make sure to display a correct date or datetime input field in admin forms | |
* | |
* Code below is in a _prepareForm() method of an admin form | |
*/ | |
$dateOutputFormat = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); | |
$fieldset->addField('my_date_field', 'date', array( | |
'name' => 'my_date_field', | |
'label' => $this->__('My Date Field'), |
<php | |
/** | |
* Parse variables string into array of variables | |
* | |
* @param string $variablesString | |
* @return array | |
*/ | |
protected function _parseVariablesString($variablesString) | |
{ | |
$variables = array(); |
<?php | |
/** | |
* In some Mage_Adminhtml_Block_Catalog_Form class... | |
*/ | |
protected function _prepareForm() | |
{ | |
$formDataObject = new Varien_Object() // Your logic to get original data for your form | |
$form = new Varien_Data_Form(); |
<?php | |
$canonicalUrl = Mage::getBaseUrl(); // your logic... | |
$this->getLayout() | |
->getBlock('head') | |
->addLinkRel('canonical', $canonicalUrl); |
<?php | |
Mage::getModel('my_model') | |
->getCollection() | |
->addAttributeToFilter('my_column', array('gt' => Zend_Db_Expr(MY_EXPRESSION))) | |
; |
In csv file
"Mage_Module::Original Text String","Customized Text String"
Source http://magebase.com/magento-tutorials/quick-tip-translating-strings-from-specific-modules/