Snippet

In this section you will find a collection of ready-to-use snippets to better speed up your work with Magento.

How to execute Magento code externally in a php file No ratings yet.

Hai bisogno di prelevare le informazioni del tuo store, coe ad esempio informazioni sui clienti, sugli ordini o sui prodotti in un file esterno? Questo semplice snippet ti aiuterà a collegarti facilmente alla tua installazione di Magento e prendere tutte le info che ti servono. <?php require_once(‘app/Mage.php’); // Percorso della tua installazione Magento. umask(0); Mage::app(); […]

How to execute Magento code externally in a php fileNo ratings yet. Read More "

Insert a block of new products in a Magento cms page No ratings yet.

This simple little snippet will allow you to display products set as new in a Magento cms page. Please note that to set products as new, you must use the "Set as new from" attribute {{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}} Did you like this article? Vote for it! If you liked the post, put the

Insert a block of new products in a Magento cms pageNo ratings yet. Read More "

Calling a static block in a Magento template phtml page 4.5/5 (2)

In un precedente articolo, abbiamo visto come richiamare un blocco cms in una pagina cms di Magento. Questo semplice snippet invece, ti tornerà utile qualora dovessi richiamare un blocco cms all’interno di un file phtml. <?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘blocco-contatti’)->toHtml(); ?> Attenzione! Ricorda di cambiare cms-block-id con l’ID del tuo blocco statico. Ti è piaciuto questo articolo?

Call a static block in a Magento template phtml page 4.5/5(2) Read More "

Magento - how to load a product from ID or SKU code No ratings yet.

<?php $_product = Mage::getModel(‘catalog/product’)->load(108); // dove 108 è l’ ID del prodotto $_product = Mage::getModel(‘catalog/product’)->loadByAttribute(‘sku’,’codice-prodotto’); // dove codice-prodotto è il codice del prodotto 🙂 Ti è piaciuto questo articolo? Votalo! Se il post ti è piaciuto, metti le 5 stelline!

Magento - how to upload a product from ID or SKU codeNo ratings yet. Read More "

How to delete all products from Magento database 4/5 (1)

Need to delete all products and test data from your Magento store database? Here is a simple script to run in your database. This has been tested and works correctly with Magento 1.9. WARNING! Be sure to [highlight]remember to backup your database[/highlight] before any database operation! Remember to include at the beginning of the

How to delete all products from Magento database 4/5(1) Read More "

How to disable WYSIWYG editor in Magento No ratings yet.

If you, too, have had problems with Magento's text editor, you can solve the problem by simply disabling it by default or disabling it completely. It may also happen that you don't want to give this option to customers who most of the time tend to create monsters, underlining, changing fonts, coloring with hallucinating colors the various

How to disable WYSIWYG editor in MagentoNo ratings yet. Read More "

Magento Tutorial: Adding a new structural block (reference) in Magento 4.14/5 (7)

If you already know a little bit about Magento, you surely know that it is completely modular, which allows for great scalability and flexibility for your store. As you develop a template for Magento, you are faced with many blocks that you can put in structural blocks. If you don't know what they are, I recommend

Magento Tutorial: Add a new structural block (reference) in Magento 4.14/5(7) Read More "

Link "View product in frontend" in Magento admin No ratings yet.

Have you ever happened to create or edit a product in the Magento admin and then have to go search for it in the frontend? Maybe after a few tries you can get to the product either through the category or through search, but most of the time you have to redo the search indexes and you

"View product in frontend" link in Magento adminNo ratings yet. Read More "

Magento Newsletter Import

Import Magento newsletter subscribers without confirmation email 4/5 (1)

Di recente ho dovuto importare in Magento una lista di email per la newsletter. Per fare questo ho trovato uno script molto veloce che fa proprio questo. 1. Create un file php chiamato importSubscribers.php e incollateci questo codice: < ?php require_once "app/Mage.php"; Mage::app(); $subscribers = array('[email protected]','[email protected]'); foreach ($subscribers as $email) { Mage::getModel('newsletter/subscriber')->subscribe($email); } 2. Inserite

Import Magento Newsletter subscribers without confirmation email 4/5(1) Read More "

Back to top