<?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/"
	>

<channel>
	<title>Australopitech &#187; Snippets</title>
	<atom:link href="http://www.australopitech.com/categorie/snippets/feed" rel="self" type="application/rss+xml" />
	<link>http://www.australopitech.com</link>
	<description>Un blog hi-tech</description>
	<pubDate>Mon, 26 Jul 2010 13:31:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Comment manipuler les prix tiers d&#8217;un produit Magento</title>
		<link>http://www.australopitech.com/1267-comment-manipuler-les-prix-tiers-dun-produit-magento</link>
		<comments>http://www.australopitech.com/1267-comment-manipuler-les-prix-tiers-dun-produit-magento#comments</comments>
		<pubDate>Fri, 22 Jan 2010 16:32:49 +0000</pubDate>
		<dc:creator>Damien Brugne</dc:creator>
		
		<category><![CDATA[Snippets]]></category>

		<category><![CDATA[magento]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[tier price]]></category>

		<guid isPermaLink="false">http://www.australopitech.com/?p=1267</guid>
		<description><![CDATA[Terminons notre semaine de découverte du code Magento en abordant une fonctionnalité bien pratique : les prix tiers (« tiers prices » en&#160;V.O.).

Les prix tiers sont des prix « conditionnés ». Un produit a au minimum un prix -fixe- et éventuellement un prix spécial pour une durée déterminée ou non. Les prix tiers permettent de [...]]]></description>
		<wfw:commentRss>http://www.australopitech.com/1267-comment-manipuler-les-prix-tiers-dun-produit-magento/feed</wfw:commentRss>
		</item>
		<item>
		<title>Comment créer un produit Magento par code</title>
		<link>http://www.australopitech.com/1252-comment-creer-un-produit-magento-par-code-2</link>
		<comments>http://www.australopitech.com/1252-comment-creer-un-produit-magento-par-code-2#comments</comments>
		<pubDate>Thu, 21 Jan 2010 08:00:40 +0000</pubDate>
		<dc:creator>Damien Brugne</dc:creator>
		
		<category><![CDATA[Snippets]]></category>

		<category><![CDATA[collection]]></category>

		<category><![CDATA[magento]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[produit]]></category>

		<guid isPermaLink="false">http://www.australopitech.com/?p=1252</guid>
		<description><![CDATA[Suite de notre découverte du modèle objet Magento. Après la création d’une catégorie et la manipulation des collections d’entités Mangento voyons comment créer un produit simple … by code of&#160;course.

Lors de la création des catégories nous avions utilisé un array PHP et la méthode setData() pour renseigner les attributs. Cette fois-ci nous allons utiliser les [...]]]></description>
		<wfw:commentRss>http://www.australopitech.com/1252-comment-creer-un-produit-magento-par-code-2/feed</wfw:commentRss>
		</item>
		<item>
		<title>Récupérer une ou plusieurs catégories par code dans Magento</title>
		<link>http://www.australopitech.com/1211-recuperer-une-ou-plusieurs-categories-par-code-dans-magento</link>
		<comments>http://www.australopitech.com/1211-recuperer-une-ou-plusieurs-categories-par-code-dans-magento#comments</comments>
		<pubDate>Wed, 20 Jan 2010 08:00:15 +0000</pubDate>
		<dc:creator>Damien Brugne</dc:creator>
		
		<category><![CDATA[Snippets]]></category>

		<category><![CDATA[catégorie]]></category>

		<category><![CDATA[collection]]></category>

		<category><![CDATA[eav]]></category>

		<category><![CDATA[magento]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.australopitech.com/?p=1211</guid>
		<description><![CDATA[Nous avons vu hier comment créer une catégorie par code dans&#160;Magento.
Je vous propose aujourd’hui de voir comment récupérer une ou plusieurs catégories, comment les parcourir puis d’implémenter une méthode permettant de vérifier si une catégorie existe ou non d’après son attribut&#160;&#8220;name&#8221;.

Cet article va nous permettre de découvrir la manipulation des collections d’objets Magento. Les notions [...]]]></description>
		<wfw:commentRss>http://www.australopitech.com/1211-recuperer-une-ou-plusieurs-categories-par-code-dans-magento/feed</wfw:commentRss>
		</item>
		<item>
		<title>Comment créer une catégorie Magento par code</title>
		<link>http://www.australopitech.com/1192-comment-creer-une-categorie-magento-par-code</link>
		<comments>http://www.australopitech.com/1192-comment-creer-une-categorie-magento-par-code#comments</comments>
		<pubDate>Tue, 19 Jan 2010 09:00:55 +0000</pubDate>
		<dc:creator>Damien Brugne</dc:creator>
		
		<category><![CDATA[Snippets]]></category>

		<category><![CDATA[catégorie]]></category>

		<category><![CDATA[magento]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.australopitech.com/?p=1192</guid>
		<description><![CDATA[Voici la suite de notre découverte de l&#8217;API Magento. Aujourd’hui je vous propose de créer -par code- une catégorie&#160;Magento.

Le concept des catégories est fondamentale de l’architecture Magento. Les catégories permettent d’organiser les produits de manière arborescente afin par exemple de structurer l’expérience visiteur sur le&#160;frontend.
Comme la création manuelle de -beaucoup de- catégories via l&#8217;interface d&#8217;administration [...]]]></description>
		<wfw:commentRss>http://www.australopitech.com/1192-comment-creer-une-categorie-magento-par-code/feed</wfw:commentRss>
		</item>
		<item>
		<title>Comment créer un batch Magento</title>
		<link>http://www.australopitech.com/1172-comment-creer-un-batch-magento</link>
		<comments>http://www.australopitech.com/1172-comment-creer-un-batch-magento#comments</comments>
		<pubDate>Fri, 15 Jan 2010 21:10:23 +0000</pubDate>
		<dc:creator>Damien Brugne</dc:creator>
		
		<category><![CDATA[Snippets]]></category>

		<category><![CDATA[batch]]></category>

		<category><![CDATA[cli]]></category>

		<category><![CDATA[magento]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.australopitech.com/?p=1172</guid>
		<description><![CDATA[&#8220;Damien, au lieu de Twitter écris des posts sur Australopitech &#8230; Damien fais un billet sur Australopitech &#8230; Damien tu ne montre pas l&#8217;exemple &#8230;&#8220;, gnia, gnia,&#160;gnia.
Et bien soit, je vous propose donc de commettre une série de posts sur Magento et son&#160;API.
Pour commencer par le commencement, voyons comment créer un batch Magento qui servira [...]]]></description>
		<wfw:commentRss>http://www.australopitech.com/1172-comment-creer-un-batch-magento/feed</wfw:commentRss>
		</item>
		<item>
		<title>Magento - Jouer avec les stocks</title>
		<link>http://www.australopitech.com/990-magento-jouer-avec-les-stocks</link>
		<comments>http://www.australopitech.com/990-magento-jouer-avec-les-stocks#comments</comments>
		<pubDate>Fri, 16 Oct 2009 10:06:08 +0000</pubDate>
		<dc:creator>Abdelhak</dc:creator>
		
		<category><![CDATA[Snippets]]></category>

		<category><![CDATA[magento]]></category>

		<category><![CDATA[stock]]></category>

		<guid isPermaLink="false">http://www.australopitech.com/?p=990</guid>
		<description><![CDATA[Comment afficher la quantité de stock disponible d&#8217;un produit&#160;:

$_product = Mage::getModel&#40;'catalog/product'&#41;-&#62;load&#40;PRODUCT_ID&#41;;
echo Mage::getModel&#40;'cataloginventory/stock_item'&#41;-&#62;loadByProduct&#40;$_product&#41;-&#62;getQty&#40;&#41;;

et voici comment mettre a jour les stocks (dans un batch par exemple)&#160;:

$_product = Mage::getModel&#40;'catalog/product'&#41;-&#62;load&#40;PRODUCT_ID&#41;;
Mage::getModel&#40;'cataloginventory/stock_item'&#41;
    	 -&#62;loadByProduct&#40;$_product&#41;
    	 -&#62;setData&#40;'qty', 666&#41;
    	 -&#62;save&#40;&#41;;

et parfois tous ces &#8220;save()&#8221; sur le produit ne fonctionnent pas ; premier reflex [...]]]></description>
		<wfw:commentRss>http://www.australopitech.com/990-magento-jouer-avec-les-stocks/feed</wfw:commentRss>
		</item>
		<item>
		<title>Magento - Sélectionner tous les produits d&#8217;un AttributeSet</title>
		<link>http://www.australopitech.com/822-magento-selectionner-tous-les-produits-dun-attributeset</link>
		<comments>http://www.australopitech.com/822-magento-selectionner-tous-les-produits-dun-attributeset#comments</comments>
		<pubDate>Fri, 10 Jul 2009 08:44:16 +0000</pubDate>
		<dc:creator>Abdelhak</dc:creator>
		
		<category><![CDATA[Snippets]]></category>

		<category><![CDATA[attributeset]]></category>

		<category><![CDATA[magento]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.australopitech.com/?p=822</guid>
		<description><![CDATA[un snippet pour montrer comment sélectionner les produits d&#8217;un attribute set donné.
pas besoin de connaitre son id, on fera avec le nom&#160;:

//trouver l'id a partir du nom :
$set_id = Mage::getModel&#40;'eav/entity_attribute_set'&#41;
                    -&#62;getCollection&#40;&#41;
      [...]]]></description>
		<wfw:commentRss>http://www.australopitech.com/822-magento-selectionner-tous-les-produits-dun-attributeset/feed</wfw:commentRss>
		</item>
		<item>
		<title>Magento - Comment ajouter un AttributeSet</title>
		<link>http://www.australopitech.com/803-magento-comment-ajouter-un-attributeset</link>
		<comments>http://www.australopitech.com/803-magento-comment-ajouter-un-attributeset#comments</comments>
		<pubDate>Fri, 03 Jul 2009 09:40:16 +0000</pubDate>
		<dc:creator>Abdelhak</dc:creator>
		
		<category><![CDATA[Snippets]]></category>

		<category><![CDATA[attributeset]]></category>

		<category><![CDATA[magento]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.australopitech.com/?p=803</guid>
		<description><![CDATA[Un premier snippet pour montrer comment ajouter un nouvel AttributeSet (groupe d&#8217;attributs) automatiquement :&#160;&#160;

//on vérifie qu'il n'existe pas déjà :
$attributeSetId = Mage::getModel&#40;'eav/entity_attribute_set'&#41;
	-&#62;getCollection&#40;&#41;
	-&#62;addFilter&#40;'attribute_set_name', 'LeNomDeMonAttributeSet'&#41;
	-&#62;getLastItem&#40;&#41;
	-&#62;getId&#40;&#41;;
&#160;
//si pas trouvé, on l'ajoute :
if&#40;!$attributeSetId&#41; &#123;    
	$attributeSetId = Mage::getModel&#40;'eav/entity_attribute_set'&#41;
		-&#62;setEntityTypeId&#40;Mage::getModel&#40;'eav/entity'&#41;-&#62;setType&#40;'catalog_product'&#41;-&#62;getTypeId&#40;&#41;&#41;
		-&#62;setAttributeSetName&#40;'LeNomDeMonAttributeSet'&#41;
		-&#62;save&#40;&#41;
		-&#62;initFromSkeleton&#40;4&#41; // le 4 c'est pour l'attributeSet Default.
		-&#62;save&#40;&#41;
		-&#62;getId&#40;&#41;;
&#125;

initFromSkeleton(4) permet de le créer à partir du &#8220;template&#8221; de l&#8217;attributeSet par défaut, on [...]]]></description>
		<wfw:commentRss>http://www.australopitech.com/803-magento-comment-ajouter-un-attributeset/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

