<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Programmazione Web &#187; Prestashop</title>
	<atom:link href="http://www.programmazione-web.com/categorie/prestashop/feed" rel="self" type="application/rss+xml" />
	<link>http://www.programmazione-web.com</link>
	<description>il Blog open degli sviluppatori del web!</description>
	<lastBuildDate>Mon, 25 Jul 2011 16:39:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Prestashop ecommerce nuova versione 1.2.1</title>
		<link>http://www.programmazione-web.com/prestashop-ecommerce-nuova-versione-1-2-1.php</link>
		<comments>http://www.programmazione-web.com/prestashop-ecommerce-nuova-versione-1-2-1.php#comments</comments>
		<pubDate>Mon, 24 Aug 2009 07:49:32 +0000</pubDate>
		<dc:creator>neryo</dc:creator>
				<category><![CDATA[Applicazioni]]></category>
		<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[News dal web]]></category>
		<category><![CDATA[Open-source]]></category>
		<category><![CDATA[Prestashop]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[eshop]]></category>
		<category><![CDATA[pagamenti paypal]]></category>
		<category><![CDATA[software opensource]]></category>

		<guid isPermaLink="false">http://www.programmazione-web.com/?p=249</guid>
		<description><![CDATA[Il 12 Agosto è stata rilasciata la tanto attesa nuova versione 1.2.1 di Prestashop, il software open-source per l&#8217;ecommerce in stile web 2.0 più promettente in circolazione! La nuova release del ramo 1.2.x è il risultato del testing e del bug fixing della neo nata versione 1.2 rilasciata il 29 Giugno, che ora si presenta [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-254" title="prestashop" src="http://www.programmazione-web.com/wp-content/uploads/2009/08/gI_prestashoplogoGM2.jpg2.jpg" alt="prestashop" width="250" height="250" /></p>
<p>Il 12 Agosto è stata rilasciata la tanto attesa nuova <strong>versione 1.2.1 di Prestashop</strong>, il <strong>software open-source per l&#8217;ecommerce in stile web 2.0</strong> più promettente in circolazione! La nuova release del ramo 1.2.x è il risultato del testing e del bug fixing della neo nata <strong>versione 1.2 rilasciata il 29 Giugno</strong>, che ora si presenta più solida ed affidabile.</p>
<p>Tra le tante novità si può citare</p>
<ul>
<li> Maggiore possibilità di gestione del catalogo: disabilitare i prodotti, gestire i prodotti che non sono in stock.</li>
<li> Sistema di tracciamento dei visitatori</li>
<li> Possibilità di creare gruppi di acquirenti, con l&#8217;associazione di coupons e permessi a certe categorie e sistemi di pagamento.</li>
<li> Statistiche filtrate da data a data</li>
<li> Possibilità di visualizzare i carelli che sono stati creati dai clienti senza essere stati evasi.</li>
<li> Possibilità di inserire files da scaricare associati ai prodotti (brochure, data-sheets, modulistica ecc)</li>
<li> Possibilità di visualizzare la tassazione IVA o IVA esclusa nei prezzi dei prodotti</li>
<li> API Paypal</li>
<li> Modulo per il reminder ai clienti più affezionati</li>
</ul>
<p><strong>Riferimenti</strong><br />
<a href="http://www.prestashop.com/blog/article/prestashop_121_is_now_available/" target="_blank">http://www.prestashop.com/blog/article/prestashop_121_is_now_available/</a></p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.programmazione-web.com%2Fprestashop-ecommerce-nuova-versione-1-2-1.php&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.programmazione-web.com/prestashop-ecommerce-nuova-versione-1-2-1.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Realizzare moduli per Prestashop Ecommerce</title>
		<link>http://www.programmazione-web.com/realizzare-moduli-per-prestashop-ecommerce.php</link>
		<comments>http://www.programmazione-web.com/realizzare-moduli-per-prestashop-ecommerce.php#comments</comments>
		<pubDate>Sun, 26 Apr 2009 13:25:31 +0000</pubDate>
		<dc:creator>neryo</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[Prestashop]]></category>
		<category><![CDATA[Sviluppo applicazioni]]></category>
		<category><![CDATA[ecommerce opensource]]></category>
		<category><![CDATA[magento ecommerce]]></category>
		<category><![CDATA[moduli prestashop]]></category>
		<category><![CDATA[piattaforme ecommerce]]></category>
		<category><![CDATA[prestashop ecommerce]]></category>
		<category><![CDATA[sviluppo moduli prestashop]]></category>
		<category><![CDATA[zen cart]]></category>

		<guid isPermaLink="false">http://www.programmazione-web.com/?p=199</guid>
		<description><![CDATA[Prestashop è una piattaforma opensource per realizzare siti ecommerce. Questo post vuole illustrare come sia semplice sviluppare per Prestashop la base di un modulo personalizzato che si potrà installare.]]></description>
			<content:encoded><![CDATA[<p><strong>Sviluppare un modulo per la piattaforma Prestashop Ecommerce</strong></p>
<p>Per chi non lo sapesse <a title="Prestashop ecommerce" href="http://www.prestashop.com" target="_blank"><strong>Prestashop</strong></a> è una <strong>piattaforma opensource</strong> per realizzare <strong>siti ecommerce</strong>. Questo prodotto abbastanza giovane, ha da poco superato la realease 1.0 e stà avendo parecchi consensi positivi nell&#8217;ambito delle soluzioni moderne per il <strong>commercio elettronico</strong>, tanto da essere preferibile in molti casi a <strong>Magento Ecommerce</strong>, quest&#8217;ultimo giudicato l&#8217;alternativa sostitutiva a <strong>osCommerce </strong>e <strong>Zen-cart</strong>.</p>
<p>I punti di forza di <strong>Prestashop </strong>sono la <strong>ricchezza di funzionalità</strong> pur garantendo un <strong>ottima facilità di utilizzo</strong> sia per chi gestisce il proprio negozio online sia per chi deve svilupparlo, oltre ad essere veloce, leggero, e <strong>facilmente integrabile</strong>, il tutto grazie ad un <strong>codice di ottima fattura, moderno e ben organizzato</strong>.</p>
<p>Questo post non vuole essere però una introduzione a <strong>Prestashop</strong>, che in questi ultimi mesi è stato discusso ampliamente e recensito in molti altri siti, ma si vuole illustrare come sia semplice realizzare la base di un modulo personalizzato che si potrà installare sulla piattaforma in questione.</p>
<p><strong>La procedura per la creazione di un modulo è molto semplice:</strong></p>
<p>I moduli stanno tutti dentro alla cartella /modules, alcuni per velocizzare la creazione di un nuovo modulo copiano direttamente una cartella di un altro modulo poi iniziano a personalizzarlo per crearsi il proprio.. ma in questo esempio vediamo come <strong>crearlo from scratch</strong>.</p>
<ol>
<li>Creazione della cartella <strong>mymodule/</strong> dentro a <strong>/modules</strong></li>
<li>Creazione del file vista <strong>mymodule.tpl</strong> dentro a <strong>/modules/mymodule/</strong></li>
<li>Creazione della classe <strong>mymodule.php</strong> sempre dentro a <strong>/modules/mymodule/</strong></li>
</ol>
<p><strong>Classe mymodule.php</strong></p>
<p>In questo esempio di codice sottostante si vuole mostrare come realizzare una semplice classe <strong>Mymodule</strong>, che estende la classe padre module di <strong>prestashop, </strong>ereditandone le caratteristiche fondamentali.<strong> </strong>Tramite il costrutture vengono inizializzate le variabili necessarie, e attraverso il metodo install si puo&#8217; registrare il modulo nel <strong>Hook di default</strong>, in questo caso il Left, visualizzando il contenuto della vista tramite la chiamata a <strong>hookLeftColumn</strong>.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">class</span> Mymodule <span class="kw2">extends</span> Module</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">function</span> __construct<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">name</span> = <span class="st0">&#8216;mymodule&#8217;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">tab</span> = <span class="st0">&#8216;Blocks&#8217;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">version</span> = <span class="nu0">0</span>.l;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; parent::__construct<span class="br0">&#40;</span><span class="br0">&#41;</span>; <span class="co1">// The parent construct is required for translations</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">page</span> = <a href="http://www.php.net/basename"><span class="kw3">basename</span></a><span class="br0">&#40;</span><span class="kw2">__FILE__</span>, <span class="st0">&#8216;.php&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">displayName</span> = <span class="re0">$this</span>-&gt;<span class="me1">l</span><span class="br0">&#40;</span><span class="st0">&#8216;Block mymodule&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">description</span> = <span class="re0">$this</span>-&gt;<span class="me1">l</span><span class="br0">&#40;</span><span class="st0">&#8216;Add a mymodule block&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">function</span> install<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>!parent::<span class="me2">install</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>!<span class="re0">$this</span>-&gt;<span class="me1">registerHook</span><span class="br0">&#40;</span><span class="st0">&#8216;leftColumn&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">true</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; &nbsp; &nbsp; &nbsp; * Returns module content</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; &nbsp; &nbsp; &nbsp; *</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; &nbsp; &nbsp; &nbsp; * @param array $params Parameters</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; &nbsp; &nbsp; &nbsp; * @return string Content</span></div>
</li>
<li class="li2">
<div class="de2"><span class="coMULTI">&nbsp; &nbsp; &nbsp; &nbsp; */</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">function</span> hookLeftColumn<span class="br0">&#40;</span><span class="re0">$params</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.php.net/global"><span class="kw3">global</span></a> <span class="re0">$smarty</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$myvariable</span> = <span class="st0">&#8216;this is my var&#8217;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$smarty</span>-&gt;<span class="me1">assign</span><span class="br0">&#40;</span><span class="st0">&#8216;myvariable&#8217;</span>, <span class="re0">$myvariable</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">return</span> <span class="re0">$this</span>-&gt;<span class="me1">display</span><span class="br0">&#40;</span><span class="kw2">__FILE__</span>, <span class="st0">&#8216;mymodule.tpl&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>Come si può notare all&#8217;interno del metodo <strong>hookLeftColumn </strong>posso passare le variabili elaborate nella classe alle viste per poi visualizzarle. All&#8217;interno del modulo posso fare riferimento chiaramente a tutte le classi disponibili del framework di prestashop.. As esempio potrei fare una semplice query su una tabella del database:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">function</span> hookLeftColumn<span class="br0">&#40;</span><span class="re0">$params</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.php.net/global"><span class="kw3">global</span></a> <span class="re0">$smarty</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$myquery</span> = Db::<span class="me2">getInstance</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-&gt;<span class="me1">Execute</span><span class="br0">&#40;</span><span class="st0">&#8216;SELECT * FROM mytable&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">$smarty</span>-&gt;<span class="me1">assign</span><span class="br0">&#40;</span><span class="st0">&#8216;myresult&#8217;</span>, <span class="re0">$myquery</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">return</span> <span class="re0">$this</span>-&gt;<span class="me1">display</span><span class="br0">&#40;</span><span class="kw2">__FILE__</span>, <span class="st0">&#8216;mymodule.tpl&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>semplice vero?</p>
<p><strong>Creare la vista mymodule.tpl</strong><br />
Un semplice esempio di vista che verrà richiamata dalla precedente classe e sarà visualizzata nel parte left del nostro eshop.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&lt;div <span class="kw2">class</span>=<span class="st0">&quot;mymoduleblock&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;h4&gt;<span class="br0">&#123;</span>l s=<span class="st0">&#8216;My first module&#8217;</span> mod=<span class="st0">&#8216;mymodule&#8217;</span><span class="br0">&#125;</span>&lt;/h4&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;div <span class="kw2">class</span>=<span class="st0">&quot;block_content&quot;</span> style=<span class="st0">&quot;padding:0px;&quot;</span>&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; My First Prestashop module, <span class="br0">&#123;</span>myvariable<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;a href=<span class="st0">&quot;http://www.neryo.com/&quot;</span>&gt;Neryo consulenza software&lt;/a&gt;&lt;/div&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;/div&gt;</div>
</li>
</ol>
</div>
<p>Come si può notare <strong>Prestashop utilizza smarty </strong>come motore di template, quindi abbiamo a disposizione tutte le sue funzionalità per fare cicli e manipolazioni.. e inoltre attraverso il quale si possono definire alcuni stringhe di codice, es <strong>{l s=&#8217;My first module&#8217; mod=&#8217;mymodule&#8217;} </strong>all interno delle viste, che poi potranno essere tradotti dal sistema di traduzione presente nella piattaforma, generando vari files all&#8217;intenro della cartella del modulo (es. it.php, fr.php).</p>
<p>All&#8217;interno del modulo possiamo usare ad esempio la variabile smarty <strong>{$module_dir}</strong> per far riferimento alla directory di questo modulo e quindi facilitarci i riferimenti all&#8217;interno di esso.</p>
<p>Questo Mymodule chiaramente non fa molto, visualizza questo blocco di codice html nella colonna di sinistra del eshop&#8230; però è il punto di partenza che ci permette di capire come funziona il sistema e sviluppare qualcosa di complesso e di personalizzato. Ci basterà quindi dare un occhiata agli altri moduli e prendere spunto.</p>
<p><strong>Riferimenti</strong></p>
<p><a title="How to create a new module for prestashop" href="http://www.prestashop.com/forums/viewthread/730/modules/how_to_create_a_new_module_any_kind" target="_blank">http://www.prestashop.com/forums/viewthread/730/modules/how_to_create_a_new_module_any_kind</a><br />
<a title="How to create a prestashop modules" href="http://marghoobsuleman.com/blogs/how-to-create-prestashop-modules" target="_blank">http://marghoobsuleman.com/blogs/how-to-create-prestashop-modules</a></p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.programmazione-web.com%2Frealizzare-moduli-per-prestashop-ecommerce.php&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.programmazione-web.com/realizzare-moduli-per-prestashop-ecommerce.php/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

