Tag: php

Magento How to convert text attribute to dropdown attribute

If you are using Magento as ecommerce framework you could be interested on how to change an attribute type. The main answer is: you can’t! Indeed, you have to create a new one because you can’t change the attribute types (nether the code name and many other things), so the best solution for me was […]

Get correct Magento multi level categories page title and canonical url

Hello, I noticed there was a problem with the page titles and canonical urls for multi-level categories pages, for example if I have a category like this: ebook/fiction/general Magento puts a wrong canonical url like this: http://example.com/ebook while it should be: http://example.com/ebook/fiction/general So we need a patch to fix this behavior and I will […]

AWS EC2 Manage Snapshot Backup with PHP SDK

This is a simple script based upon AWS SDK PHP to manage volume’s snapshots. It simply create one snapshot per volume (once you run it) and delete snapshot older then 1 month. Please provide your personal information by copying config-sample.inc.php into config.inc.php. Run the script backup-snapshots.php with your CRON. For example: # Auto AWS Snapshots […]

Magento adding you own custom RSS Feeds

You know you will need, before or after, to add your own custom RSS feeds to your Magento. For example, I needed to create some custom RSS Feeds to list bestseller products by date (bestseller weekly, monthly, etc…) How to do it? It’s quite complex but not so much if you follow this mini tutorial: […]

Magento adding downloadable product to cart by coding php

Probably you know it’s possible to add a product to the cart via querystring, but may be you prefer code a new module for your needs using Magento objects and methods. So adding a simple product is easy: But how to add a Downloadable product with its right link ? Just try this, it’s a […]

Magento Export products in custom XML [script]

If you have to export all or a part of your Magento products you can try this simple script which creates a products collection and writes a simple and custom XML file per product (but you can simply change it to write a single long XML file). Hope you enjoy it!

Integrate WordPress functions on Magento

Per integrare tutte le funzioni di WordPress su Magento in modo da poter fare chiamate come wp_list_pages(), wp_list_categories() o la famosa WP_Query, basta far caricare WordPress da Magento prima che si carichi lui stesso (per evitare il sovrapporsi di header e funzioni varie). Aprite il file index.php di Magento, all’inzio inserite le due righe: Ora rimane solo un piccolo problema, sia WordPress […]

Magento ecommerce tips & tricks

Tanto per non scordarmeli appunto alcuni suggerimenti molto utili sulla gestione di Magento: per disabilitare la frase “Exception printing is disabled by default for security reasons” quando occorre un errore e farlo printare a schermo basta modificare il file “errors/local.xml.sample” se invece non volete abilitare il printing (che e’ meglio) ma volete comunque vedere di […]

bbPress database integration on WordPress

Integrare i dati di un forum bbPress in WordPress e’ estremamente semplice, soprattutto se il database e’ lo stesso e cambia solo il prefix delle tabelle. Quindi se avete un blog WordPress con associato un forum bbPress bastera’ creare delle corrette query nel template di WordPress per ottenere i dati del forum collegato. Per esempio, […]

WordPress: Dynamic Meta Description and Keywords howto

This is a quick guide to add dynamic meta description and keyword to each different url of our WordPress blog, very useful to SEO users. Open your header.php file from your theme directory and put this code into: Meta Content Description <meta name=”description” content=” <?php if (have_posts() && is_single() OR is_page()):while(have_posts()):the_post(); $out_excerpt = str_replace(array(“\r\n”, “\r”, […]