<?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>My Science Is Better &#187; magento</title>
	<atom:link href="http://www.myscienceisbetter.info/tag/magento/feed" rel="self" type="application/rss+xml" />
	<link>http://www.myscienceisbetter.info</link>
	<description></description>
	<lastBuildDate>Sun, 18 Dec 2011 22:26:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Magento get all products</title>
		<link>http://www.myscienceisbetter.info/magento-get-all-products.html</link>
		<comments>http://www.myscienceisbetter.info/magento-get-all-products.html#comments</comments>
		<pubDate>Tue, 15 Nov 2011 06:00:40 +0000</pubDate>
		<dc:creator>Romeo Adrian Cioaba</dc:creator>
				<category><![CDATA[magento]]></category>

		<guid isPermaLink="false">http://www.myscienceisbetter.info/?p=284</guid>
		<description><![CDATA[Here is an easy way to return all the products from a magento store.]]></description>
			<content:encoded><![CDATA[<p>Here is an easy way to return all the products from a magento store.</p>
<pre class="brush: php; title: ; notranslate">
$collection = Mage::getModel('catalog/product')
                        -&gt;getCollection()
                        -&gt;addAttributeToSelect('*');

foreach ($collection as $product) {
    echo $product-&gt;getName() . &quot;&lt;br /&gt;&quot;;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.myscienceisbetter.info/magento-get-all-products.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento top navigation show products in category</title>
		<link>http://www.myscienceisbetter.info/magento-top-navigation-show-products-in-category.html</link>
		<comments>http://www.myscienceisbetter.info/magento-top-navigation-show-products-in-category.html#comments</comments>
		<pubDate>Wed, 29 Jun 2011 13:21:47 +0000</pubDate>
		<dc:creator>Romeo Adrian Cioaba</dc:creator>
				<category><![CDATA[magento]]></category>

		<guid isPermaLink="false">http://www.myscienceisbetter.info/?p=235</guid>
		<description><![CDATA[I had a structure like this in admin - Category - - SubCategory1 - - - Product 1 - - - Product 2 - - - Product 3 - - SubCategory2 - - - Product 1 - - - Product 2 - - - Product 3 but the default magento navigation would only list my [...]]]></description>
			<content:encoded><![CDATA[<p>I had a structure like this in admin</p>
<p>- Category<br />
- - SubCategory1<br />
- - - Product 1<br />
- - - Product 2<br />
- - - Product 3<br />
- - SubCategory2<br />
- - - Product 1<br />
- - - Product 2<br />
- - - Product 3</p>
<p>but the default magento navigation would only list my categories and subcategories, not the products. after a bit of tweaking around i noticed that both SubCategory1 and SubCategory2 are level 1 so i only needed to find a way to display products for those categories. That is done easily by extending /core/Mage/Catalog/Block/Navigation.php into your local (/local/Mage/Catalog/Block/Navigation.php) and replacing the function _renderCategoryMenuItemHtml with the one below:</p>
<pre class="brush: php; title: ; notranslate">
    protected function _renderCategoryMenuItemHtml($category, $level = 0, $isLast = false, $isFirst = false,
        $isOutermost = false, $outermostItemClass = '', $childrenWrapClass = '', $noEventAttributes = false)
    {
        if (!$category-&gt;getIsActive()) {
            return '';
        }
        $html = array();

        // get all children
        if (Mage::helper('catalog/category_flat')-&gt;isEnabled()) {
            $children = (array)$category-&gt;getChildrenNodes();
            $childrenCount = count($children);
        } else {
            $children = $category-&gt;getChildren();
            $childrenCount = $children-&gt;count();
        }
        $hasChildren = ($children &amp;&amp; $childrenCount);

        // select active children
        $activeChildren = array();
        foreach ($children as $child) {
            if ($child-&gt;getIsActive()) {
                $activeChildren[] = $child;
            }
        }
        $activeChildrenCount = count($activeChildren);
        $hasActiveChildren = ($activeChildrenCount &gt; 0);

        // prepare list item html classes
        $classes = array();
        $classes[] = 'level' . $level;
        $classes[] = 'nav-' . $this-&gt;_getItemPosition($level);
        if ($this-&gt;isCategoryActive($category)) {
            $classes[] = 'active';
        }
        $linkClass = '';
        if ($isOutermost &amp;&amp; $outermostItemClass) {
            $classes[] = $outermostItemClass;
            $linkClass = ' class=&quot;'.$outermostItemClass.'&quot;';
        }
        if ($isFirst) {
            $classes[] = 'first';
        }
        if ($isLast) {
            $classes[] = 'last';
        }
        if ($hasActiveChildren) {
            $classes[] = 'parent';
        }

        // prepare list item attributes
        $attributes = array();
        if (count($classes) &gt; 0) {
            $attributes['class'] = implode(' ', $classes);
        }
        if ($hasActiveChildren &amp;&amp; !$noEventAttributes) {
             $attributes['onmouseover'] = 'toggleMenu(this,1)';
             $attributes['onmouseout'] = 'toggleMenu(this,0)';
        }

        // assemble list item with attributes
        $htmlLi = '&lt;li';
        foreach ($attributes as $attrName =&gt; $attrValue) {
            $htmlLi .= ' ' . $attrName . '=&quot;' . str_replace('&quot;', '\&quot;', $attrValue) . '&quot;';
        }
        $htmlLi .= '&gt;';
        $html[] = $htmlLi;

        $html[] = '&lt;a href=&quot;'.$this-&gt;getCategoryUrl($category).'&quot;'.$linkClass.'&gt;';
        $html[] = '&lt;span&gt;' . $this-&gt;escapeHtml($category-&gt;getName()) . '&lt;/span&gt;';
        $html[] = '&lt;/a&gt;';

		// Grabbing the products for the category if it's level is 1
		if ($level == 1) {

			$catId = $category-&gt;getId();
			$categorie = new Mage_Catalog_Model_Category();
			$categorie-&gt;load($catId); // this is category id
			$collection = $categorie-&gt;getProductCollection()-&gt;addAttributeToSort('name', 'asc');
			$html[] = '&lt;ul&gt;';

			foreach ($collection as $pc)
			{
			    $p = new Mage_Catalog_Model_Product();
			    $p-&gt;load($pc-&gt;getId());

			    $data = $p-&gt;_data;
				$html[] = '&lt;li&gt;&lt;a href=&quot;/'.$data['url_path'].'&quot;&gt;'.$data['name'] .'&lt;/a&gt;&lt;/li&gt;';
			}

			$html[] = &quot;&lt;/ul&gt;\n&quot;;

		}
		// Done

        // render children
        $htmlChildren = '';
        $j = 0;
        foreach ($activeChildren as $child) {
            $htmlChildren .= $this-&gt;_renderCategoryMenuItemHtml(
                $child,
                ($level + 1),
                ($j == $activeChildrenCount - 1),
                ($j == 0),
                false,
                $outermostItemClass,
                $childrenWrapClass,
                $noEventAttributes
            );
            $j++;
        }
        if (!empty($htmlChildren)) {
            if ($childrenWrapClass) {
                $html[] = '&lt;div class=&quot;' . $childrenWrapClass . '&quot;&gt;';
            }
            $html[] = '&lt;ul class=&quot;level' . $level . '&quot;&gt;';
            $html[] = $htmlChildren;
            $html[] = '&lt;/ul&gt;';
            if ($childrenWrapClass) {
                $html[] = '&lt;/div&gt;';
            }
        }

        $html[] = '&lt;/li&gt;';

        $html = implode(&quot;\n&quot;, $html);
        return $html;
    }
</pre>
<p>The rest of the file stays the same. Note this works on magento > 1.4</p>
]]></content:encoded>
			<wfw:commentRss>http://www.myscienceisbetter.info/magento-top-navigation-show-products-in-category.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Delete test orders in magento 1.4.x</title>
		<link>http://www.myscienceisbetter.info/delete-test-orders-in-magento-1-4-x.html</link>
		<comments>http://www.myscienceisbetter.info/delete-test-orders-in-magento-1-4-x.html#comments</comments>
		<pubDate>Tue, 24 May 2011 19:11:53 +0000</pubDate>
		<dc:creator>Romeo Adrian Cioaba</dc:creator>
				<category><![CDATA[magento]]></category>
		<category><![CDATA[sql snippets]]></category>

		<guid isPermaLink="false">http://www.myscienceisbetter.info/?p=230</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: sql; title: ; notranslate">
– Reset Magento TEST Data
SET FOREIGN_KEY_CHECKS=0;
– reset dashboard search queries
TRUNCATE `catalogsearch_query`;
ALTER TABLE `catalogsearch_query` AUTO_INCREMENT=1;
– reset sales order info
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_order_grid`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_payment`;
TRUNCATE `sales_flat_order_status_history`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_quote_payment`;
TRUNCATE `sales_flat_quote_shipping_rate`;
TRUNCATE `sales_flat_shipment`;
TRUNCATE `sales_flat_shipment_comment`;
TRUNCATE `sales_flat_shipment_grid`;
TRUNCATE `sales_flat_shipment_item`;
TRUNCATE `sales_flat_shipment_track`;
TRUNCATE `sales_invoiced_aggregated`;
TRUNCATE `sales_invoiced_aggregated_order`;
TRUNCATE `sales_order_aggregated_created`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;
ALTER TABLE `sales_flat_creditmemo` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_track` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_aggregated_created` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;
SET FOREIGN_KEY_CHECKS=1;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.myscienceisbetter.info/delete-test-orders-in-magento-1-4-x.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delete test orders in magento 1.5.x</title>
		<link>http://www.myscienceisbetter.info/delete-test-orders-in-magento-1-5-x.html</link>
		<comments>http://www.myscienceisbetter.info/delete-test-orders-in-magento-1-5-x.html#comments</comments>
		<pubDate>Tue, 24 May 2011 19:10:52 +0000</pubDate>
		<dc:creator>Romeo Adrian Cioaba</dc:creator>
				<category><![CDATA[magento]]></category>
		<category><![CDATA[sql snippets]]></category>

		<guid isPermaLink="false">http://www.myscienceisbetter.info/?p=228</guid>
		<description><![CDATA[Before getting a magento 1.5.x site from development to live you should first remove the test orders. To do that, just run the following script in your mysql admin.]]></description>
			<content:encoded><![CDATA[<p>Before getting a magento 1.5.x site from development to live you should first remove the test orders. To do that, just run the following script in your mysql admin.</p>
<pre class="brush: sql; title: ; notranslate">
SET FOREIGN_KEY_CHECKS=0;

TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_order_grid`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_status_history`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_order_payment`;
TRUNCATE `sales_flat_quote_payment`;
TRUNCATE `sales_flat_shipment`;
TRUNCATE `sales_flat_shipment_item`;
TRUNCATE `sales_flat_shipment_grid`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;

ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;

-- lets reset customers
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;
TRUNCATE `customer_entity_datetime`;
TRUNCATE `customer_entity_decimal`;
TRUNCATE `customer_entity_int`;
TRUNCATE `customer_entity_text`;
TRUNCATE `customer_entity_varchar`;
TRUNCATE `log_customer`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;

ALTER TABLE `customer_address_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `log_customer` AUTO_INCREMENT=1;
ALTER TABLE `log_visitor` AUTO_INCREMENT=1;
ALTER TABLE `log_visitor_info` AUTO_INCREMENT=1;

-- Now, lets Reset all ID counters
TRUNCATE `eav_entity_store`;
ALTER TABLE `eav_entity_store` AUTO_INCREMENT=1;

SET FOREIGN_KEY_CHECKS=1;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.myscienceisbetter.info/delete-test-orders-in-magento-1-5-x.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Wipe all categories from magento database</title>
		<link>http://www.myscienceisbetter.info/wipe-all-categories-from-magento-database.html</link>
		<comments>http://www.myscienceisbetter.info/wipe-all-categories-from-magento-database.html#comments</comments>
		<pubDate>Tue, 05 Oct 2010 07:37:09 +0000</pubDate>
		<dc:creator>Romeo Adrian Cioaba</dc:creator>
				<category><![CDATA[magento]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql snippets]]></category>

		<guid isPermaLink="false">http://www.myscienceisbetter.info/?p=170</guid>
		<description><![CDATA[Below is a small sql snippet that will delete all the categories from a magento database:]]></description>
			<content:encoded><![CDATA[<p>Below is a small sql snippet that will delete all the categories from a magento database:</p>
<pre class="brush: sql; title: ; notranslate">
 TRUNCATE TABLE `catalog_category_entity`;
 TRUNCATE TABLE `catalog_category_entity_datetime`;
 TRUNCATE TABLE `catalog_category_entity_decimal`;
 TRUNCATE TABLE `catalog_category_entity_int`;
 TRUNCATE TABLE `catalog_category_entity_text`;
 TRUNCATE TABLE `catalog_category_entity_varchar`;
 TRUNCATE TABLE `catalog_category_product`;
 TRUNCATE TABLE `catalog_category_product_index`;

 insert  into `catalog_category_entity`(`entity_id`,`entity_type_id`,`attribute_set_id`,`parent_id`,`created_at`,`updated_at`,`path`,`position`,`level`,`children_count`) values (1,3,0,0,'0000-00-00 00:00:00','2009-02-20 00:25:34','1',1,0,1),(2,3,3,0,'2009-02-20 00:25:34','2009-02-20 00:25:34','1/2',1,1,0);
 insert  into `catalog_category_entity_int`(`value_id`,`entity_type_id`,`attribute_id`,`store_id`,`entity_id`,`value`) values (1,3,32,0,2,1),(2,3,32,1,2,1);
 insert  into `catalog_category_entity_varchar`(`value_id`,`entity_type_id`,`attribute_id`,`store_id`,`entity_id`,`value`) values (1,3,31,0,1,'Root Catalog'),(2,3,33,0,1,'root-catalog'),(3,3,31,0,2,'Default Category'),(4,3,39,0,2,'PRODUCTS'),(5,3,33,0,2,'default-category');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.myscienceisbetter.info/wipe-all-categories-from-magento-database.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wipe all products from magento database</title>
		<link>http://www.myscienceisbetter.info/wipe-all-products-from-magento-database.html</link>
		<comments>http://www.myscienceisbetter.info/wipe-all-products-from-magento-database.html#comments</comments>
		<pubDate>Tue, 05 Oct 2010 07:05:44 +0000</pubDate>
		<dc:creator>Romeo Adrian Cioaba</dc:creator>
				<category><![CDATA[magento]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.myscienceisbetter.info/?p=166</guid>
		<description><![CDATA[Here's a sql snippet that deletes all the products from a mysql database:]]></description>
			<content:encoded><![CDATA[<p>Here's a sql snippet that deletes all the products from a mysql database:</p>
<pre class="brush: sql; title: ; notranslate">
TRUNCATE TABLE `catalog_product_bundle_option`;
TRUNCATE TABLE `catalog_product_bundle_option_value`;
TRUNCATE TABLE `catalog_product_bundle_selection`;
TRUNCATE TABLE `catalog_product_entity_datetime`;
TRUNCATE TABLE `catalog_product_entity_decimal`;
TRUNCATE TABLE `catalog_product_entity_gallery`;
TRUNCATE TABLE `catalog_product_entity_int`;
TRUNCATE TABLE `catalog_product_entity_media_gallery`;
TRUNCATE TABLE `catalog_product_entity_media_gallery_value`;
TRUNCATE TABLE `catalog_product_entity_text`;
TRUNCATE TABLE `catalog_product_entity_tier_price`;
TRUNCATE TABLE `catalog_product_entity_varchar`;
TRUNCATE TABLE `catalog_product_link`;
TRUNCATE TABLE `catalog_product_link_attribute`;
TRUNCATE TABLE `catalog_product_link_attribute_decimal`;
TRUNCATE TABLE `catalog_product_link_attribute_int`;
TRUNCATE TABLE `catalog_product_link_attribute_varchar`;
TRUNCATE TABLE `catalog_product_link_type`;
TRUNCATE TABLE `catalog_product_option`;
TRUNCATE TABLE `catalog_product_option_price`;
TRUNCATE TABLE `catalog_product_option_title`;
TRUNCATE TABLE `catalog_product_option_type_price`;
TRUNCATE TABLE `catalog_product_option_type_title`;
TRUNCATE TABLE `catalog_product_option_type_value`;
TRUNCATE TABLE `catalog_product_super_attribute`;
TRUNCATE TABLE `catalog_product_super_attribute_label`;
TRUNCATE TABLE `catalog_product_super_attribute_pricing`;
TRUNCATE TABLE `catalog_product_super_link`;
TRUNCATE TABLE `catalog_product_enabled_index`;
TRUNCATE TABLE `catalog_product_website`;
TRUNCATE TABLE `catalog_product_entity`;
TRUNCATE TABLE `cataloginventory_stock`;
TRUNCATE TABLE `cataloginventory_stock_item`;
TRUNCATE TABLE `cataloginventory_stock_status`;
insert  into `catalog_product_link_type`(`link_type_id`,`code`) values (1,'relation'),(2,'bundle'),(3,'super'),(4,'up_sell'),(5,'cross_sell');
insert  into `catalog_product_link_attribute`(`product_link_attribute_id`,`link_type_id`,`product_link_attribute_code`,`data_type`) values (1,2,'qty','decimal'),(2,1,'position','int'),(3,4,'position','int'),(4,5,'position','int'),(6,1,'qty','decimal'),(7,3,'position','int'),(8,3,'qty','decimal');
insert  into `cataloginventory_stock`(`stock_id`,`stock_name`) values (1,'Default');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.myscienceisbetter.info/wipe-all-products-from-magento-database.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magento create custom order statuses</title>
		<link>http://www.myscienceisbetter.info/magento-create-custom-order-statuses.html</link>
		<comments>http://www.myscienceisbetter.info/magento-create-custom-order-statuses.html#comments</comments>
		<pubDate>Wed, 15 Sep 2010 21:49:00 +0000</pubDate>
		<dc:creator>Romeo Adrian Cioaba</dc:creator>
				<category><![CDATA[magento]]></category>
		<category><![CDATA[how to]]></category>

		<guid isPermaLink="false">http://www.myscienceisbetter.info/?p=155</guid>
		<description><![CDATA[This post is just a reminder for myself. It's taken from http://www.magentocommerce.com/boards/viewthread/9976/P30/ . The code below was tested and works just fine on magento 1.4.0.1 So to recapitulate, I did the following (citing the other guys, thanks to atlasit, ajayksh and rune00): 1) write a list of the additional statuses that you want 2) download [...]]]></description>
			<content:encoded><![CDATA[<p>This post is just a reminder for myself. It's taken from http://www.magentocommerce.com/boards/viewthread/9976/P30/ . The code below was tested and works just fine on magento 1.4.0.1</p>
<blockquote>
<p>So to recapitulate, I did the following (citing the other guys, thanks to atlasit, ajayksh and rune00):</p>
<p>1) write a list of the additional statuses that you want</p>
<p>2) download and open the file Magento\app\code\core\Mage\Sales\etc\config.xml<br />
(do not upload it again as soon as you’re done, you need to place it into a different folder, see below)</p>
<p>3) find this code:</p>
<pre class="brush: xml; title: ; notranslate">&lt;pending translate=&quot;label&quot;&gt;&lt;label&gt;Pending&lt;/label&gt;&lt;/pending&gt;</pre>
<p>and after that add your own new custom status</p>
<pre class="brush: xml; title: ; notranslate">&lt;my_new_custom_status translate=&quot;label&quot;&gt;&lt;label&gt;My New Custom Status&lt;/label&gt;&lt;/my_new_custom_status&gt;</pre>
<p>4) Now find this code, a few lines below:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;states&gt;
  &lt;new translate=&quot;label&quot;&gt;
    &lt;label&gt;New&lt;/label&gt;
    &lt;statuses&gt;
      &lt;pending/&gt;
    &lt;/statuses&gt;
  &lt;/new&gt;
</pre>
<p>and under or above this block create a new block with your own custom status:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;states&gt;

  &lt;new translate=&quot;label&quot;&gt;
    &lt;label&gt;New&lt;/label&gt;
    &lt;statuses&gt;
      &lt;pending/&gt;
    &lt;/statuses&gt;
  &lt;/new&gt;

  &lt;my_new_custom_status translate=&quot;label&quot;&gt;
    &lt;label&gt;My New Custom Status&lt;/label&gt;
    &lt;statuses&gt;
      &lt;my_new_custom_status/&gt;
    &lt;/statuses&gt;
  &lt;/my_new_custom_status&gt;
</pre>
<p>repeat this (step 3 and 4) for each new custom status</p>
<p>5) So that you can change your status from the admin interface back and forth<br />
from any current status, you need to edit again each of the status code block<br />
as follows.</p>
<p>change this</p>
<pre class="brush: xml; title: ; notranslate">
&lt;new translate=&quot;label&quot;&gt;
    &lt;label&gt;New&lt;/label&gt;
    &lt;statuses&gt;
      &lt;pending/&gt;
    &lt;/statuses&gt;
  &lt;/new&gt;
</pre>
<p>to this</p>
<pre class="brush: xml; title: ; notranslate">
&lt;new translate=&quot;label&quot;&gt;
    &lt;label&gt;New&lt;/label&gt;
    &lt;statuses&gt;
      &lt;my_new_custom_status/&gt;
      &lt;pending/&gt;
      &lt;processing/&gt;
      &lt;holded/&gt;
      &lt;complete/&gt;
      &lt;closed/&gt;
      &lt;canceled/&gt;
    &lt;/statuses&gt;
    &lt;visible_on_front/&gt;
  &lt;/new&gt;
</pre>
<p>you need to do this with all of the existing statuses and the new custom statuses that you’ve just created</p>
<p>so that these new statuses do not only become available and visible to the admin, but also to the customer<br />
on his “my account” page (order history, current status), you need to make the new statues visible (thanks to rune00)<br />
with the tag <visible_on_front/>, as described above.</p>
<p>6) After you saved your changes, upload the new config.xml file to<br />
/app/code/local/Mage/Sales/etc/ (you will need to create that folder structure)</p>
<p>7)Create a file named Mage_Sales.xml with the following content (thanks to atlasit)</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;config&gt;
    &lt;modules&gt;
        &lt;Mage_Sales&gt;
            &lt;active&gt;true&lt;/active&gt;
            &lt;codePool&gt;local&lt;/codePool&gt;
        &lt;/Mage_Sales&gt;
    &lt;/modules&gt;
&lt;/config&gt;
</pre>
<p>Upload it to /app/etc/modules/</p>
<p>that’s pretty much it.</p>
<p>If you got it running successfully as well, let us know so that it will help others as well.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.myscienceisbetter.info/magento-create-custom-order-statuses.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Magento export categories with id</title>
		<link>http://www.myscienceisbetter.info/magento-export-categories-with-id.html</link>
		<comments>http://www.myscienceisbetter.info/magento-export-categories-with-id.html#comments</comments>
		<pubDate>Mon, 07 Sep 2009 09:07:58 +0000</pubDate>
		<dc:creator>Romeo Adrian Cioaba</dc:creator>
				<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.myscienceisbetter.info/?p=81</guid>
		<description><![CDATA[A friend asked me to help out import some products and categories from an old database to a brand new magento install. What I first did was to construct a CSV file with all the categories from the old store (that was the easy part...) and import them to magento. I followed this thread and [...]]]></description>
			<content:encoded><![CDATA[<p>A friend asked me to help out import some products and categories from an old database to a brand new magento install. What I first did was to construct a CSV file with all the categories from the old store (that was the easy part...) and import them to magento. I followed <a href="http://www.magentocommerce.com/boards/viewthread/26022/P0/">this</a> thread and the import when smooth. Now I needed to get the ids that magento addigned to my categories so that I could import a product inside the categories so that my friend won't have to do it in backend.</p>
<p>First thing I did was to look on magento forums how to get all store categories. After finding <a href="http://www.magentocommerce.com/boards/viewthread/24947/">this</a> great thread, i came up with this little script which I put into my template folder in /catalog/allcategories.phtml:</p>
<pre class="brush: php; title: ; notranslate">
$category = Mage::getModel ( 'catalog/category' );
$tree = $category-&gt;getTreeModel ();
$tree-&gt;load ();

$ids = $tree-&gt;getCollection ()-&gt;getAllIds ();

if ($ids) {
$fp = fopen('var/import/catwithid.csv', 'a');
fwrite($fp,  'catId, catName\n');
foreach ( $ids as $id ) {
                $string = $id . ', ' .$category-&gt;load($id)-&gt;getName() . '\n';
fwrite($fp,  $string);
}
fclose($fp);
}
</pre>
<p>As a note, you need to make sure that /var/import/catwithid.csv exists and it's writeable by your web server. You can make sure it is by chmod-ing it to 777</p>
<pre class="brush: bash; title: ; notranslate">
touch var/import/catwithid.csv # we create the file
chmod 777 var/import/catwithid.csv #make sure it's writeable
</pre>
<p>Since this was a dev install, I then just loaded that script into a block element by editing the Home Page inside the CMS section:</p>
<pre class="brush: xml; title: ; notranslate">
{{block type=&quot;core/template&quot; template=&quot;catalog/allcategories.phtml&quot;}}
</pre>
<p>Hope this helps someone <img src='http://www.myscienceisbetter.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.myscienceisbetter.info/magento-export-categories-with-id.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

