This file contains hidden or 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
| Create a new module and in config.xml do the follow: | |
| <?xml version="1.0"?> | |
| <config> | |
| <modules> | |
| <Company_Module> | |
| <version>0.1.0</version> | |
| </Company_Module> | |
| </modules> | |
| <adminhtml> |
This file contains hidden or 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
| isSafari = navigator.vendor.indexOf("Apple")==0 && /\sSafari\//.test(navigator.userAgent); // true or false |
This file contains hidden or 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
| https://wordpress.org/plugins/site-is-offline-plugin/ |
This file contains hidden or 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
| http://www.magpleasure.com/blog/free-imagecleanup-script-for-removing-unused-images.html |
This file contains hidden or 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
| /app/design/frontend/default/[theme name]/template/catalog/product/view/attribute.phtml | |
| <?php foreach ($_additional as $_data): ?> | |
| <?php $_attribute = $_product->getResource()->getAttribute($_data['code']); | |
| if (!is_null($_product->getData($_attribute->getAttributeCode())) && ((string)$_attribute->getFrontend()->getValue($_product) != '')) { ?> | |
| <tr> | |
| <th class="label"><?php echo $this->htmlEscape($this->__($_data['label'])) ?></th> | |
| <td class="data"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td> | |
| </tr> | |
| <?php } ?> |
This file contains hidden or 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
| Enable core.precomposeunicode on the Mac | |
| git config --global core.precomposeunicode true | |
| Then reclone the repository. For this to work, you need to have at least Git 1.7.12, which is bundled with Xcode 4.6. | |
| git config --global core.quotepath off |
This file contains hidden or 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
| Helper para exibir o trecho de um texto próximo a palavra-chave | |
| http://bakery.cakephp.org/articles/grigri/2007/12/26/showing-a-text-excerpt-around-multiple-keywords | |
| On a typical search results page, you want to display an excerpt of each matching item, showing the keywords. TextHelper::excerpt() works, but only for a single word/phrase. This helper finds the chunk of text containing as many keywords as possible. | |
| <?php | |
| class SummaryHelper extends AppHelper { | |
| function excerpt($text, $words, $length=150, $prefix="...", $suffix = null, $options = array()) { |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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:- |