<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>e-commerce Archives - My Silly Point of View</title>
	<atom:link href="https://mysillypointofview.com/tag/e-commerce/feed/" rel="self" type="application/rss+xml" />
	<link>https://mysillypointofview.com</link>
	<description>it&#039;s my blog anyway</description>
	<lastBuildDate>Thu, 31 Jan 2013 09:48:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.13</generator>
<site xmlns="com-wordpress:feed-additions:1">13951596</site>	<item>
		<title>How to change the number of columns in Magento catalog grid</title>
		<link>https://mysillypointofview.com/2013/01/31/how-to-change-catalog-column-number-in-magento/</link>
					<comments>https://mysillypointofview.com/2013/01/31/how-to-change-catalog-column-number-in-magento/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Thu, 31 Jan 2013 17:45:18 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://mysillypointofview.richardferaro.com/?p=791</guid>

					<description><![CDATA[<p>The default Magento catalog grid is set to display 3 products per column. Most users alter the number of columns by modifying the file catalog/product/list.phtml. There&#8217;s actually a much cleaner approach to this task and you only need to modify an XML file. Open the catalog.xml file which can be found in the location below: [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2013/01/31/how-to-change-catalog-column-number-in-magento/">How to change the number of columns in Magento catalog grid</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The default Magento catalog grid is set to display 3 products per column. Most users alter the number of columns by modifying the file <code>catalog/product/list.phtml</code>. There&#8217;s actually a much cleaner approach to this task and you only need to modify an XML file.<br />
<span id="more-791"></span></p>
<p>Open the <code>catalog.xml</code> file which can be found in the location below:<br />
<code>/app/design/frontend/&lt;package-name&gt;/&lt;theme&gt;/layout/catalog.xml</code></p>
<p>Locate the line that declares the block for product listing similar to the one below:<br />
<code>&lt;block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml"&gt;</code></p>
<p>Immediately after the code above, add the XML node below:<br />
<code>&lt;action method="setColumnCount"&gt;&lt;columns&gt;4&lt;/columns&gt;&lt;/action&gt;</code></p>
<p>Save the file and clear the contents of your <code>var/cache</code> directory. Reload the catalog page to see the changes <img src="https://s.w.org/images/core/emoji/13.1.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><em>Note: You can also apply this to <code>catalogsearch.xml</code> or any layout XML file that uses the list.phtml</em></p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2013/01/31/how-to-change-catalog-column-number-in-magento/">How to change the number of columns in Magento catalog grid</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2013/01/31/how-to-change-catalog-column-number-in-magento/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">791</post-id>	</item>
		<item>
		<title>Mage Enabler is now available for download in the Official WordPress Plugin repository!</title>
		<link>https://mysillypointofview.com/2010/05/12/mage-enabler-is-now-available-for-download/</link>
					<comments>https://mysillypointofview.com/2010/05/12/mage-enabler-is-now-available-for-download/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Wed, 12 May 2010 14:48:03 +0000</pubDate>
				<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://mysillypointofview.wordpress.com/?p=378</guid>

					<description><![CDATA[<p>I&#8217;m soooo happy to see my very first plugin to be released for everyone to use. I hope it will help a lot of Magento and WordPress users! Click! click! click!</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/05/12/mage-enabler-is-now-available-for-download/">Mage Enabler is now available for download in the Official WordPress Plugin repository!</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://mysillypointofview.files.wordpress.com/2010/05/wordpress-e280ba-newest-c2ab-wordpress-plugins_1273645824215.png?resize=497%2C207"><img loading="lazy" src="http://mysillypointofview.files.wordpress.com/2010/05/wordpress-e280ba-newest-c2ab-wordpress-plugins_1273645824215.png?resize=497%2C207" alt="" title="Mage Enabler plugin" width="497" height="207" class="alignnone size-full wp-image-379" data-recalc-dims="1" /></a></p>
<p>I&#8217;m soooo happy to see my very first plugin to be released for everyone to use. I hope it will help a lot of Magento and WordPress users!</p>
<p><a href="http://wordpress.org/extend/plugins/mage-enabler/">Click! click! click!</a></p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/05/12/mage-enabler-is-now-available-for-download/">Mage Enabler is now available for download in the Official WordPress Plugin repository!</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2010/05/12/mage-enabler-is-now-available-for-download/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">378</post-id>	</item>
		<item>
		<title>Mage Enabler: A plugin to run Magento&#039;s session within WordPress</title>
		<link>https://mysillypointofview.com/2010/05/11/mage-enabler/</link>
					<comments>https://mysillypointofview.com/2010/05/11/mage-enabler/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Tue, 11 May 2010 18:56:30 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://mysillypointofview.wordpress.com/?p=350</guid>

					<description><![CDATA[<p>Update (May 12, 2010): Mage Enabler is now available in the Official WordPress Plugin repository. Get it here! It&#8217;s been a while since I posted my tweak that allows Mage object to be utilized within any WordPress installation. The tweak requires the blog owner to modify functions.php as stated in my post. I&#8217;m inspired by [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/05/11/mage-enabler/">Mage Enabler: A plugin to run Magento&#039;s session within WordPress</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" class="alignnone size-full wp-image-365" title="mage_enabler" src="http://mysillypointofview.files.wordpress.com/2010/05/mage_enabler.png?resize=497%2C167" alt="Mage Enabler" width="497" height="167" data-recalc-dims="1" /></p>
<p><strong>Update (May 12, 2010):</strong> Mage Enabler is now available in the Official WordPress Plugin repository. <a href="http://wordpress.org/extend/plugins/mage-enabler/">Get it here!</a></p>
<p>It&#8217;s been a while since I posted my tweak that allows Mage object to be utilized within any WordPress installation. The tweak requires the blog owner to modify <strong>functions.php</strong> as stated in my <a href="http://mysillypointofview.wordpress.com/2010/04/08/how-to-use-magentos-session-within-wordpress/">post</a>. I&#8217;m inspired by the feedback of the readers who used the tweak so I decided that a plugin that does the same thing should be made to prevent modifying the WordPress core files thus preventing the tweak to cause inconsistencies when an upgrade is necessary.</p>
<p><span id="more-350"></span>It is my pleasure to introduce to you, <strong>Mage Enabler</strong> plugin. <del datetime="2010-05-12T06:31:45+00:00">Just copy the whole code snippet below and save it as <em>mage-enabler.php</em>. Place it inside a folder named <strong>mage-enabler</strong> together with the <em>readme.txt</em> available right after the code block.</del> Please take time to read and follow the readme.txt instruction on how to install the plugin in your WordPress setup.</p>
<h2>How to use the plugin?</h2>
<p>To show you how the plugin works, I&#8217;ve decided to convert my example in my previous <a href="http://mysillypointofview.wordpress.com/2010/04/08/how-to-use-magentos-session-within-wordpress/">post</a> by providing a single login page for both WordPress (subscriber) and Magento (customer). This setup assumes that the account credentials (subcriber/customer) in both database are the same and that the function collision problem between WordPress and Magento has been <a href="http://mysillypointofview.wordpress.com/2010/04/08/how-to-use-magentos-session-within-wordpress/">fixed</a>. If you followed the <strong>functions.php</strong> update in that post, <strong>remove the block of code added at line 4123 to 4138</strong>.</p>
<p>Location of functions.php</p>
<pre>path-to-your-root-htdocs/wordpress/wp-includes/functions.php</pre>
<p>Let&#8217;s start by opening the <strong>index.php</strong> file of the WordPress theme Twenty Ten. I&#8217;m using version 3.0-beta1 of WordPress in this article. You can replicate the same code update to any WordPress version and theme you have.</p>
<pre>wordpress_root\wp-content\themes\twentyten\index.php</pre>
<p>Copy the necessary codes (lines 16-18 and 22-40) to make it similar below:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php

/**
 * The main template file
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty Ten
 * @since 3.0.0
 */
 if(class_exists('Mage')){
 	Mage::getSingleton('core/session', array('name' =&gt; 'frontend'));
 }
?&gt;

&lt;?php get_header(); ?&gt;
&lt;!-- Magento's custom greeting --&gt;
&lt;div style=&quot;font-size: 15px; margin-bottom: 15px; border-bottom: 1px solid #000; padding-bottom: 10px;&quot;&gt;
&lt;?php
if(class_exists('Mage')){
	$session = Mage::getSingleton(&quot;customer/session&quot;);
	$magento_message = &quot;Welcome &quot;;
	// Generate a personalize greeting
	if($session-&gt;isLoggedIn()){
		$magento_message .= $session-&gt;getCustomer()-&gt;getData('firstname').' ';
		$magento_message .= $session-&gt;getCustomer()-&gt;getData('lastname').'!';
	}else{
		$magento_message .= &quot;Guest!&quot;;
	}

	echo $magento_message;
}
?&gt;
&lt;/div&gt;
&lt;!-- End of Magento's custom greeting --&gt;</pre>
<p>The purpose of the code change above is to display a ?Welcome [customer name here]? when a customer is logged in, and show ?Welcome Guest? when they are not. <strong>Make sure that if you&#8217;re going to use any Magento related script in your code, always write it within the following if condition:</strong></p>
<pre class="brush: php; title: ; notranslate">if(class_exists('Mage')){
	// Write your Magento codes here
}</pre>
<p>This will prevent your page or theme files from breaking up if in case the plugin is deactivated, not working or if Mage.php can&#8217;t be found.</p>
<p>Open user.php file found at following address below:</p>
<pre>path-to-your-root-htdocs/wordpress/wp-includes/user.php</pre>
<p>Locate the function wp_authenticate_username_password()  and find the similar code below. I found mine at line 108.</p>
<pre class="brush: php; first-line: 108; title: ; notranslate">	if ( !wp_check_password($password, $userdata-&gt;user_pass, $userdata-&gt;ID) )
		return new WP_Error('incorrect_password', sprintf(__('&lt;strong&gt;ERROR&lt;/strong&gt;: Incorrect password. &lt;a href=&quot;%s&quot; title=&quot;Password Lost and Found&quot;&gt;Lost your password&lt;/a&gt;?'), site_url('wp-login.php?action=lostpassword', 'login')));</pre>
<p>Right after the code above, add the following code starting at line 111 to make it similar to the code below. This update allows us to run the login request of Magento within WordPress:</p>
<pre class="brush: php; first-line: 108; title: ; notranslate">	if ( !wp_check_password($password, $userdata-&gt;user_pass, $userdata-&gt;ID) )
		return new WP_Error('incorrect_password', sprintf(__('&lt;strong&gt;ERROR&lt;/strong&gt;: Incorrect password. &lt;a href=&quot;%s&quot; title=&quot;Password Lost and Found&quot;&gt;Lost your password&lt;/a&gt;?'), site_url('wp-login.php?action=lostpassword', 'login')));
	// Start Magento
	if(class_exists('Mage')){
		Mage::getSingleton('core/session', array('name' =&gt; 'frontend'));
		$session = Mage::getSingleton(&quot;customer/session&quot;);
		try{
			$login = $session-&gt;login($username, $password);
		}catch(Exception $e){
			// Do nothing
		}
	}</pre>
<p>Finally, to call the Magento&#8217;s logout function, locate the file below and open it:</p>
<pre>path-to-your-root-htdocs/wordpress/wp-login.php</pre>
<p>Find the switch case statement at line 352. Add the necessary code to make it similar to the code below and save it:</p>
<pre class="brush: plain; first-line: 352; title: ; notranslate">switch ($action) {

case 'logout' :
	check_admin_referer('log-out');
	// Start Magento
	if(class_exists('Mage')){
		Mage::getSingleton('core/session', array('name' =&gt; 'frontend'));
		Mage::getSingleton(&quot;customer/session&quot;)-&gt;logout();
	}
	wp_logout();</pre>
<p>Now test your WordPress by accessing the homepage at http://localhost/wordpress/. It should display the &#8216;Welcome Guest&#8217; similar to the image below with a cookie named as &#8216;frontend&#8217; in your Firebug cookie tab. That is your Magento cookie.</p>
<figure id="attachment_304" aria-describedby="caption-attachment-304" style="width: 489px" class="wp-caption aligncenter"><a href="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_home.png?resize=489%2C516"><img loading="lazy" class="size-full wp-image-304 " title="A Test WordPress homepage showing the default welcome message for Magento" src="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_home.png?resize=489%2C516" alt="A Test WordPress homepage showing the default welcome message for Magento" width="489" height="516" data-recalc-dims="1" /></a><figcaption id="caption-attachment-304" class="wp-caption-text">A Test WordPress homepage showing the default welcome message for Magento</figcaption></figure>
<p>Clicking the login for WordPress redirects us to the login form like the one below while still showing the &#8216;frontend&#8217; cookie. Since I have a customer with same credentials on both Magento (Customer) and WordPress (set as Subscriber), all I have to do is to use the username and password to login in the form below.</p>
<figure id="attachment_306" aria-describedby="caption-attachment-306" style="width: 486px" class="wp-caption aligncenter"><a href="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_login.png?resize=486%2C455"><img loading="lazy" class="size-full wp-image-306 " title="A Test WordPress login page with a generated Magento cookie" src="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_login.png?resize=486%2C455" alt="A Test WordPress login page with a generated Magento cookie" width="486" height="455" data-recalc-dims="1" /></a><figcaption id="caption-attachment-306" class="wp-caption-text">A Test WordPress login page with a generated Magento cookie</figcaption></figure>
<p>At this point, your Magento session should be running with an active customer session. To check if it does, go back to your homepage by clicking the top header text or going to http://localhost/wordpress/. It should display now the welcome message with your customer&#8217;s name.</p>
<figure id="attachment_308" aria-describedby="caption-attachment-308" style="width: 486px" class="wp-caption aligncenter"><a href="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_with_active_customer.png?resize=486%2C500"><img loading="lazy" class="size-full wp-image-308 " title="A Test WordPress homepage showing the customer's name in the welcome message" src="http://mysillypointofview.files.wordpress.com/2010/04/test_wordpress_with_active_customer.png?resize=486%2C500" alt="A Test WordPress homepage showing the customer's name in the welcome message" width="486" height="500" data-recalc-dims="1" /></a><figcaption id="caption-attachment-308" class="wp-caption-text">A Test WordPress homepage showing the customer&#039;s name in the welcome message</figcaption></figure>
<p>For those who will use this plugin, let me know the version of WordPress and Magento you&#8217;re using so I can keep track of the list of versions in which this plugin is compatible. <del datetime="2010-05-12T06:31:45+00:00">Until such time that the plugin is moved to the Official WordPress Plugin repository, I&#8217;ll accept and answer inquiries here thru comment/feedback form below.</del> Mage Enabler is now available in the Official WordPress Plugin repository. <a href="http://wordpress.org/extend/plugins/mage-enabler/">Get it here!</a></p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/05/11/mage-enabler/">Mage Enabler: A plugin to run Magento&#039;s session within WordPress</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2010/05/11/mage-enabler/feed/</wfw:commentRss>
			<slash:comments>205</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">350</post-id>	</item>
		<item>
		<title>How to run Magento (version 1.4.0.1) session into an external site?</title>
		<link>https://mysillypointofview.com/2010/03/25/how-to-run-magento-version-1-4-0-1-session-to-external-site/</link>
					<comments>https://mysillypointofview.com/2010/03/25/how-to-run-magento-version-1-4-0-1-session-to-external-site/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Thu, 25 Mar 2010 22:20:00 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://mysillypointofview.wordpress.com/?p=269</guid>

					<description><![CDATA[<p>This post is an update for my blog entry on how to extend the Magento session to an external site but instead of using the version 1.2.1.2, I used the the latest stable version as of this writing which is version 1.4.0.1. The script below also implements the login() and logout() method the Magento way [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/03/25/how-to-run-magento-version-1-4-0-1-session-to-external-site/">How to run Magento (version 1.4.0.1) session into an external site?</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This post is an update for my blog entry on <a href="http://mysillypointofview.richardferaro.com/2009/04/13/how-to-run-magento-session-to-an-external-site/">how to extend the Magento session to an external site</a> but instead of using the version 1.2.1.2, I used the the latest stable version as of this writing which is version 1.4.0.1. The script below also implements the <strong>login()</strong> and <strong>logout()</strong> method the Magento way as well as extracting the customer data (firstname and lastname) using <strong>getCustomer()</strong> method.</p>
<p><span id="more-269"></span></p>
<pre class="brush: php; title: ; notranslate">&lt;?php
// Include Magento application
require_once ( &quot;/var/www/your-magento-directory/app/Mage.php&quot; );
umask(0);

// Initialize Magento
Mage::app(&quot;default&quot;);

// You have two options here,
// &quot;frontend&quot; for frontend session or &quot;adminhtml&quot; for admin session
Mage::getSingleton(&quot;core/session&quot;, array(&quot;name&quot; =&gt; &quot;frontend&quot;));
$session = Mage::getSingleton(&quot;customer/session&quot;);

if(!isset($_REQUEST['action'])) {
	$_REQUEST['action'] = '';
}

switch($_REQUEST['action']){
	case &quot;login&quot;:
		try{
			// Do login request.
			// I know, there are ways to sanitize the form.
			// But for simplicity's sake, let's assume we already
			// did our homework regarding the matter.
			$login = $session-&gt;login($_POST['username'],$_POST['password']);
		}catch(Exception $e){
			// Do something for the error message
			$message = $e-&gt;getMessage();
		}

		header(&quot;location: index.php&quot;);

		break;
	case &quot;logout&quot;:
		// Execute the logout request
		$session-&gt;logout();
		header(&quot;location: index.php&quot;);

		break;
	default:
		// If the customer is not logged in, show login form
		// else, show logout link
		if(!$session-&gt;isLoggedIn()){
		?&gt;
			&lt;html&gt;
			&lt;head&gt;
			&lt;title&gt;External Page for Magento&lt;/title&gt;
			&lt;/head&gt;
			&lt;body&gt;
			&lt;h3&gt;Login here&lt;/h3&gt;
			&lt;form method=&quot;POST&quot; action=&quot;index.php&quot;&gt;
			Username &lt;input type=&quot;text&quot; name=&quot;username&quot; size=&quot;10&quot; /&gt;
			Password &lt;input type=&quot;password&quot; name=&quot;password&quot; size=&quot;10&quot; /&gt;
			&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;login&quot; /&gt;
			&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;login&quot; /&gt;
			&lt;/form&gt;
			&lt;/body&gt;
			&lt;/html&gt;
&lt;?php
		}else{
			$firstname = $session-&gt;getCustomer()-&gt;getData('firstname');
			$lastname = $session-&gt;getCustomer()-&gt;getData('lastname');
			echo &quot;Welcome &quot;.$firstname.&quot; &quot;.$lastname.&quot;!&lt;br&gt;&quot;;
			echo &quot;You're currently logged in &quot;;
			echo &quot;[ &lt;a href=\&quot;index.php?action=logout\&quot;&gt;click here to logout&lt;/a&gt; ]&quot;;
		}
}
?&gt;
</pre>
<p>Just copy the whole script and save it as <strong>index.php</strong> and run the script.</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2010/03/25/how-to-run-magento-version-1-4-0-1-session-to-external-site/">How to run Magento (version 1.4.0.1) session into an external site?</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2010/03/25/how-to-run-magento-version-1-4-0-1-session-to-external-site/feed/</wfw:commentRss>
			<slash:comments>99</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">269</post-id>	</item>
		<item>
		<title>How to add a product into Magento shopping cart from an external site?</title>
		<link>https://mysillypointofview.com/2009/04/27/how-to-add-a-product-into-magento-from-an-external-site/</link>
					<comments>https://mysillypointofview.com/2009/04/27/how-to-add-a-product-into-magento-from-an-external-site/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Mon, 27 Apr 2009 14:28:17 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://mysillypointofview.wordpress.com/?p=128</guid>

					<description><![CDATA[<p>Yes, I know. This topic has already been discussed here. But it seems the article isn&#8217;t really helpful for those people who would integrate Magento into a custom website because it will redirect the page to Magento&#8217;s default web store provided in the installation. The technique I&#8217;ll discuss here assumes that you know HTML and [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2009/04/27/how-to-add-a-product-into-magento-from-an-external-site/">How to add a product into Magento shopping cart from an external site?</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Yes, I know. This topic has already been discussed <a title="Adding a Product to the Cart via Querystring" href="http://www.magentocommerce.com/wiki/adding_a_product_to_the_cart_via_querystring" target="_blank">here</a>. But it seems the article isn&#8217;t really helpful for those people who would integrate Magento into a custom website because it will redirect the page to Magento&#8217;s default web store provided in the installation. The technique I&#8217;ll discuss here assumes that you know HTML and ofcourse familiar with Object Oriented Programming (OOP) in PHP.</p>
<p><span id="more-128"></span>Let&#8217;s start.</p>
<p>We begin our <strong>index.php</strong> page with a HTML form having one (1) textbox for quantity and a submit button.</p>
<pre class="brush: xml; title: ; notranslate">&lt;form action=&quot;process.php&quot;&gt;
Product name: T-shirt &lt;br&gt;
Quantity: &lt;input type=&quot;text&quot; name=&quot;qty[&lt;?=$productID?&gt;]&quot;&gt;
&lt;input type=&quot;submit&quot; value=&quot;Add to Cart&quot;&gt;
&lt;/form&gt;</pre>
<p>where <strong>$productID</strong> is the ID of the product that you want to add into your shopping cart and <strong>process.php</strong> is the file that will do the processing of the form. Also upon submission of the form, the qty field will pass the value into an array format similar to one below:</p>
<pre class="brush: xml; title: ; notranslate">&quot;qty&quot; = array(12345 =&gt; 1)</pre>
<p>where</p>
<blockquote><p><strong>qty</strong> is the field name<br />
<strong>12345</strong> is the product ID and<br />
<strong>1</strong> is the qty value</p></blockquote>
<p>This will be the content of <strong>process.php</strong> file:</p>
<p>Include the Mage.php file on top of the process.php. <a href="http://mysillypointofview.richardferaro.com/2009/04/13/how-to-run-magento-session-to-an-external-site/" target="_blank">Click here to see how.</a><br />
Then proceed with the php script below:</p>
<pre class="brush: php; title: ; notranslate">// continuation of process.php
$items = $_POST[&quot;qty&quot;];

// get the current Magento cart
$cart = Mage::getSingleton('checkout/cart');

foreach($items as $key =&gt; $value)
{
   // call the Magento catalog/product model
   $product = Mage::getModel('catalog/product')
                     // set the current store ID
                     -&gt;setStoreId(Mage::app()-&gt;getStore()-&gt;getId())
                     // load the product object
                     -&gt;load($key);

   // start adding the product
   $cart-&gt;addProduct($product, array('qty' =&gt; $value));
   // save the cart
   $cart-&gt;save();

   // very straightforward, set the cart as updated
   Mage::getSingleton('checkout/session')-&gt;setCartWasUpdated(true);
}

// redirect to index.php
header(&quot;Location: index.php&quot;);
</pre>
<p>That&#8217;s it! I didn&#8217;t add the end tag for php since <a href="http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general" target="_blank">it isn&#8217;t required for pure php file</a>. I included alot of comments within the code to explain how each line works. If it causes you some problems, just remove the comments <img src="https://s.w.org/images/core/emoji/13.1.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2009/04/27/how-to-add-a-product-into-magento-from-an-external-site/">How to add a product into Magento shopping cart from an external site?</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2009/04/27/how-to-add-a-product-into-magento-from-an-external-site/feed/</wfw:commentRss>
			<slash:comments>43</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">128</post-id>	</item>
		<item>
		<title>How to delete a quote in Magento?</title>
		<link>https://mysillypointofview.com/2009/04/13/how-to-delete-a-quote-in-magento/</link>
					<comments>https://mysillypointofview.com/2009/04/13/how-to-delete-a-quote-in-magento/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Mon, 13 Apr 2009 16:59:33 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://mysillypointofview.wordpress.com/?p=50</guid>

					<description><![CDATA[<p>If you&#8217;re using an external site with Magento as a backend for e-commerce functionality, you will notice that the shopping cart items doesn&#8217;t get deleted after you checkout. Actually in Magento, a shopping cart is a quote. So to remove everything in the shopping cart, you must delete the quote currently used by the user. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2009/04/13/how-to-delete-a-quote-in-magento/">How to delete a quote in Magento?</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you&#8217;re using an external site with Magento as a backend for e-commerce functionality, you will notice that the shopping cart items doesn&#8217;t get deleted after you checkout. Actually in Magento, a shopping cart is a quote. So to remove everything in the shopping cart, you must delete the quote currently used by the user. To do this, follow the code below:</p>
<p><span id="more-50"></span>First, insert the Magento app snippets which can be found <a href="2009/04/13/how-to-run-magento-session-to-an-external-site/">here</a></p>
<p>then use the code below to delete a quote:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php
$quoteID = Mage::getSingleton(&quot;checkout/session&quot;)-&gt;getQuote()-&gt;getId();

if($quoteID)
{
    try {
        $quote = Mage::getModel(&quot;sales/quote&quot;)-&gt;load($quoteID);
        $quote-&gt;setIsActive(false);
        $quote-&gt;delete();

        return &quot;cart deleted&quot;;
    } catch(Exception $e) {
        return $e-&gt;getMessage();
    }
}else{
    return &quot;no quote found&quot;;
}
</pre>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2009/04/13/how-to-delete-a-quote-in-magento/">How to delete a quote in Magento?</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2009/04/13/how-to-delete-a-quote-in-magento/feed/</wfw:commentRss>
			<slash:comments>15</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">50</post-id>	</item>
		<item>
		<title>How to run Magento session into an external site?</title>
		<link>https://mysillypointofview.com/2009/04/13/how-to-run-magento-session-to-an-external-site/</link>
					<comments>https://mysillypointofview.com/2009/04/13/how-to-run-magento-session-to-an-external-site/#comments</comments>
		
		<dc:creator><![CDATA[Richard Feraro]]></dc:creator>
		<pubDate>Mon, 13 Apr 2009 16:02:27 +0000</pubDate>
				<category><![CDATA[Feeling guru]]></category>
		<category><![CDATA[Techie Daw]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://mysillypointofview.wordpress.com/?p=52</guid>

					<description><![CDATA[<p>Recently I received a programming task requiring to use Magento as backend system while implementing its e-commerce functionality to a website created using CodeIgniter framework. After reading a book related to the software mentioned, I found this piece of code that will enable me to use all Magento&#8217;s power into my custom website: That&#8217;s it! [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2009/04/13/how-to-run-magento-session-to-an-external-site/">How to run Magento session into an external site?</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Recently I received a programming task requiring to use Magento as backend system while implementing its e-commerce functionality to a website created using CodeIgniter framework. After reading a book related to the software mentioned, I found this piece of code that will enable me to use all Magento&#8217;s power into my custom website:</p>
<p><span id="more-52"></span></p>
<pre class="brush: php; title: ; notranslate">&lt;?php
// Include Magento application
require_once ( &quot;/var/www/your-magento-directory/app/Mage.php&quot; );
umask(0);

// Initialize Magento
Mage::app(&quot;default&quot;);

// You have two options here,
// &quot;frontend&quot; for frontend session or &quot;adminhtml&quot; for admin session
Mage::getSingleton(&quot;core/session&quot;, array(&quot;name&quot; =&gt; &quot;frontend&quot;));</pre>
<p>That&#8217;s it! You can now use the internal classes and functions of Magento into your site. For example, the code below validates whether a customer is logged in or not by checking the Magento session:</p>
<pre class="brush: php; title: ; notranslate">$session = Mage::getSingleton(&quot;customer/session&quot;);

if($session-&gt;isLoggedIn())
{
    echo &quot;Logged in&quot;;
}else{
    echo &quot;Not logged in&quot;;
}</pre>
<p><strong>** Updated **</strong><br />
For users of Magento version 1.4.0.1, <a href="http://mysillypointofview.wordpress.com/2010/03/25/how-to-run-magento-version-1-4-0-1-session-to-external-site/">click here</a></p>
<p>The post <a rel="nofollow" href="https://mysillypointofview.com/2009/04/13/how-to-run-magento-session-to-an-external-site/">How to run Magento session into an external site?</a> appeared first on <a rel="nofollow" href="https://mysillypointofview.com">My Silly Point of View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mysillypointofview.com/2009/04/13/how-to-run-magento-session-to-an-external-site/feed/</wfw:commentRss>
			<slash:comments>61</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">52</post-id>	</item>
	</channel>
</rss>
