<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
<li class="fields">
<?php if ($_dob->isEnabled()): ?>
<div class="field"><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></div>
<?php endif ?>
<?php if ($_gender->isEnabled()): ?>
<div class="field"><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></div>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function myObserver(Varien_Event_Observer $observer) | |
{ | |
if (Mage::registry('my_observer_has_run')) { | |
return $this; | |
} | |
.... Your Code Here .... | |
Mage::register('my_observer_has_run', true); | |
} |
Para salvar informações na conta do cliente durante o checkout é preciso fazer um "de para" no config.xml. O nome do nó varia conforme o checkout utilizado, pois ele é acionado em um dispatch como por exemplo:
Mage::helper('core')->copyFieldset('checkout_onepage_billing', 'to_customer', $bill, $customer);
Exemplo do config.xml (ref. /app/code/core/Mage/Checkout/etc/config.xml)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Método depreciado não funciona | |
Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($productCollection); | |
//Utilizar | |
$productCollection->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Se receber uma mensagem de página não encontrada ao acessar o backend do magento, verifique o .htaccess | |
RewriteBase /magento/ #substitua magento pelo caminho da loja | |
ou | |
comente o Rewrite base adicionando # no início da linha | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch | |
After add .DS_Store to .gitignore file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$orderId = YOUR_ORDER_ID; | |
$order = Mage::getModel(‘sales/order’) | |
->load($orderId); | |
If you have order increment id, you can load order in the following way:- | |
$orderIncrementId = YOUR_ORDER_INCREMENT_ID; | |
$order = Mage::getModel(‘sales/order’) | |
->loadByIncrementId($orderIncrementId); | |
Now, here is the code to change order status:- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(empty($_GET['cep'])){ | |
exit; | |
} | |
$cep = preg_replace('/[^0-9]/', '', $_GET['cep']); | |
if(strlen($cep) != 8){ | |
exit; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Alguns servidores exigem a declaração abaixo para redirecionamento de url no .htaccess. | |
Você deve adicioná-la em todos arquivos .htaccess (/.htaccess, /app/.htaccess, /app/webroot/.htaccess). | |
RewriteEngine On | |
RewriteBase /caminho/da/app/ | |
Referência: http://book.cakephp.org/2.0/en/installation/url-rewriting.html |
OlderNewer