<?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>NemoPS &#187; features</title>
	<atom:link href="http://nemops.com/tag/features/feed/" rel="self" type="application/rss+xml" />
	<link>http://nemops.com</link>
	<description>Prestashop Tutorials, Modules and More!</description>
	<lastBuildDate>Wed, 05 Dec 2018 13:25:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.35</generator>
	<item>
		<title>Quick Tip: Add product features to the Prestashop 1.6 Quick View box</title>
		<link>http://nemops.com/quick-tip-add-product-features-prestashop-1-6-quick-view-box/</link>
		<comments>http://nemops.com/quick-tip-add-product-features-prestashop-1-6-quick-view-box/#comments</comments>
		<pubDate>Mon, 16 Jun 2014 09:54:08 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[prestashop 1.6]]></category>
		<category><![CDATA[quick view]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2074</guid>
		<description><![CDATA[<p>We already saw how to add features to the products list. It&#8217;s now time to implement then into the quick view box! In a recent tutorial, we saw How to add features to the product list in Prestashop 1.6. However, if you want to save some space, and take full advantage of Prestashop 1.6, you [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/quick-tip-add-product-features-prestashop-1-6-quick-view-box/">Quick Tip: Add product features to the Prestashop 1.6 Quick View box</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>We already saw how to add features to the products list. It&#8217;s now time to implement then into the quick view box!</p>
<p><span id="more-2074"></span></p>
<p>In a recent tutorial, we saw <a target="_blank" href="http://nemops.com/features-to-product-list-prestashop-16/" title="How to add features to the product list in Prestashop 1.6">How to add features to the product list in Prestashop 1.6</a>.</p>
<p>However, if you want to save some space, and take full advantage of Prestashop 1.6, you might want to add them to the QuickView box instead. The procedure is quite simple, and only involves editing one file!</p>
<div class="separator"></div>
<h2>Understanding the Quick View box in Prestashop 1.6</h2>
<p>What is this Quick View box, exactly? Where is it pulling data from? Simply put, it fetches the <strong>product.tpl</strong> file by sending an ajax request to the ProductController, and returns a portion of the page, instead of the whole. <br />
How does it do it? It uses the <strong>{$content_only}</strong> variable in Smarty, which allows Prestashop to know if we are trying to display the content inside a lightbox, or generally picking it using ajax. Therefore, to add content to the Quick View, it&#8217;s enough to use a condition in the product.tpl file.
</p>
<div class="separator"></div>
<h2>Editing product.tpl</h2>
<p>As always, it&#8217;s best practice not to edit files directly, but cloning the default template and proceeding from there. Once you have a clean copy, enable it, then open <strong>product.tpl</strong>.</p>
<p>The spot where to add feature is entirely up to your discretion, I chose the one right below quantities, as shown below.</p>
<p><img src="http://nemops.com/wp-content/uploads/2014/06/quickview_features_spot-680x375.jpg" alt="Adding product features to quick view in prestashop 1.6, spot" width="680" height="375" class="aligncenter size-large wp-image-2076" /></p>
<p>To add them over there, locate the following inside product.tpl</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
	{if isset($HOOK_EXTRA_RIGHT) &amp;&amp; $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if}
</pre>
<p>Right before it, add</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
			{if $content_only}
				{if isset($features) &amp;&amp; $features}
					&lt;!-- Data sheet --&gt;
					&lt;section class=&quot;page-product-box&quot;&gt;
						&lt;p&gt;&lt;strong&gt;{l s='Features'}&lt;/strong&gt;&lt;/p&gt;
				
							{foreach from=$features item=feature}
							&lt;div class=&quot;{cycle values=&quot;odd,even&quot;}&quot;&gt;
								{if isset($feature.value)}			    
									{$feature.name|escape:'html':'UTF-8'} :
									{$feature.value|escape:'html':'UTF-8'}
								{/if}
							&lt;/div&gt;
							{/foreach}

					&lt;/section&gt;
					&lt;!--end Data sheet --&gt;
				{/if}
			{/if}


</pre>
<p><strong>Explanation</strong>: What are we doing here? As explained above, we need to tell prestashop to show this content only if it&#8217;s grabbing the template in &#8220;content_only&#8221; mode. Otherwise, the features list would be added to the normal product page as well. Then, we make sure there actually are features, and if so, we add the box with them inside. I used a slightly modified version of the original features table that you can find in the very same product.tpl file, so that it doesn&#8217;t look as big as that one. {cycle values=&#8221;odd,even&#8221;} allows you to style each row separately, in case you need to.</p>
<p>We are done!</p>
<p><img src="http://nemops.com/wp-content/uploads/2014/06/features_quickview-680x375.jpg" alt="Adding product features to quick view in prestashop 1.6, added" width="680" height="375" class="aligncenter size-large wp-image-2078" /></p>
<p>The post <a rel="nofollow" href="http://nemops.com/quick-tip-add-product-features-prestashop-1-6-quick-view-box/">Quick Tip: Add product features to the Prestashop 1.6 Quick View box</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/quick-tip-add-product-features-prestashop-1-6-quick-view-box/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Adding features to the product list in Prestashop 1.6</title>
		<link>http://nemops.com/features-to-product-list-prestashop-16/</link>
		<comments>http://nemops.com/features-to-product-list-prestashop-16/#comments</comments>
		<pubDate>Tue, 01 Apr 2014 08:00:12 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Theming]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[prestashop 1.6]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=1924</guid>
		<description><![CDATA[<p>In this quick tip we will see how to add features to the product list/grid in Prestashop 1.6. The changes will, of course, apply to the home modules as well! Product-list.tpl The first step is to physically add features within the template, so open up product-list.tpl, which you can find in the theme&#8217;s folder. For [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/features-to-product-list-prestashop-16/">Quick Tip: Adding features to the product list in Prestashop 1.6</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this quick tip we will see how to add features to the product list/grid in Prestashop 1.6. The changes will, of course, apply to the home modules as well!</p>
<p><span id="more-1924"></span></p>
<h2>Product-list.tpl</h2>
<p>The first step is to physically add features within the template, so open up <strong>product-list.tpl</strong>, which you can find in the theme&#8217;s folder. For the sake of this tutorial, we will add the features list right after the product name. Therefore, locate:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
					&lt;h5 itemprop=&quot;name&quot;&gt;
						{if isset($product.pack_quantity) &amp;&amp; $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}
						&lt;a class=&quot;product-name&quot; href=&quot;{$product.link|escape:'html':'UTF-8'}&quot; title=&quot;{$product.name|escape:'html':'UTF-8'}&quot; itemprop=&quot;url&quot; &gt;
							{$product.name|truncate:45:'...'|escape:'html':'UTF-8'}
						&lt;/a&gt;
					&lt;/h5&gt;
</pre>
<p>Right after it, and before (or after, depending on your likes!) the <strong>{hook h=&#8217;displayProductListReviews&#8217; product=$product}</strong> part, add:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
					{if isset($product.features)}
						&lt;div class=&quot;features&quot;&gt;
							
								{foreach from=$product.features item=feature}
									&lt;div&gt;
										{$feature.name}: &lt;span&gt;{$feature.value}&lt;/span&gt;
									&lt;/div&gt;
								{/foreach}
							
							
						&lt;/div&gt;
					{/if}
</pre>
<p>Save and refresh, features will pop out if you have the grid view enabled once the page is loaded. But what happens if you switch to the list view, or have this one enabled on page load instead? They will not show up! Let&#8217;s deal with it!</p>
<div class="separator"></div>
<h2>Global.js</h2>
<p>The list/grid switch is handled through javascript. The grid view being the default one, once you load the page and you had it set to list, the actual content will be generated using javascript; same for when you hit the list/grid switch button. To overcome this little issue, open up <strong>global.js</strong> located in the theme folder <em>/js/</em>. Find both occurrences of the following snippet:</p>
<pre class="brush: jscript; title: ; notranslate">
html += '&lt;h5 itemprop=&quot;name&quot;&gt;'+ $(element).find('h5').html() + '&lt;/h5&gt;';
</pre>
<p>And add this right after:</p>
<pre class="brush: jscript; title: ; notranslate">
html += '&lt;div class=&quot;features&quot;&gt;'+ $(element).find('.features').html() + '&lt;/div&gt;';
</pre>
<p>Once more, freely choose if to add this before or after ratings! It&#8217;s basically done, but let&#8217;s also add some cosmetic touches!</p>
<div class="separator"></div>
<h2>Cosmetic Touches</h2>
<p>First off, features&#8217; text is currently centered in the grid view; quite unnpleasant!</p>
<p><a href="http://nemops.com/wp-content/uploads/2014/04/16_gridlist-features.png"><img src="http://nemops.com/wp-content/uploads/2014/04/16_gridlist-features-680x316.png" alt="Adding features to the product list in Prestashop 1.6 - Unstyled list" width="680" height="316" class="aligncenter size-large wp-image-1927" /></a></p>
<h3>Using SASS?</h3>
<p>Prestashop 1.6 uses the <a href="http://sass-lang.com/" target="_blank" title="SASS" rel="nofollow">SASS</a> css preprocessor to handle stylesheets, along with compass. Therefore, if you have a sass/compass-ready environment already setup, use <strong>product_list.scss</strong> instead of the .css version!</p>
<p>Open up <strong>product_list.css</strong> (or .scss) located in the <em>/css/</em> folder of your theme. For convenience, let&#8217;s add the new code nearby the one relative to the product name in the grid/list. Therefore, locate:</p>
<pre class="brush: css; title: ; notranslate">
			h5 {
				padding: 0 15px 7px 15px;
				min-height: 53px;
			}
</pre>
<p>After this, add:</p>
<pre class="brush: css; title: ; notranslate">
			.features {
				text-align:left;
				padding-left:32px;
				padding-bottom:15px;
			}
			.features span {
				font-weight: bold;
			}
</pre>
<p><strong>Note:</strong> I am using the normal css syntax, use indentation is you are modifying the <strong>.scss</strong> file!</p>
<p>My suggestion for the product grid is to try and align the left of the features block with the &#8216;add to cart&#8217; button that pops out once the grid is hovered. Thus, you might need to adjust the left padding, depending on your language or &#8220;Add to cart&#8221; text!</p>
<p><a href="http://nemops.com/wp-content/uploads/2014/04/16_gridlist_grid_done.jpg"><img src="http://nemops.com/wp-content/uploads/2014/04/16_gridlist_grid_done.jpg" alt="Adding features to the product list in Prestashop 1.6 - Grid Styled" width="671" height="489" class="aligncenter size-full wp-image-1928" /></a></p>
<p>The grid view is settled, now to fix the list one locate:</p>
<pre class="brush: css; title: ; notranslate">
		h5 {
			padding-bottom: 8px;
		}
</pre>
<p>And insert the following right afterwards:</p>
<pre class="brush: css; title: ; notranslate">

		.features {
			text-align:left;
			margin-bottom:8px;
		}
		.features span {
			font-weight: bold;
		}
</pre>
<p>We are done!</p>
<p><a href="http://nemops.com/wp-content/uploads/2014/04/16_gridlist_list_done.png"><img src="http://nemops.com/wp-content/uploads/2014/04/16_gridlist_list_done.png" alt="Adding features to the product list in Prestashop 1.6 - List Styled" width="659" height="316" class="aligncenter size-full wp-image-1929" /></a></p>
<p>The post <a rel="nofollow" href="http://nemops.com/features-to-product-list-prestashop-16/">Quick Tip: Adding features to the product list in Prestashop 1.6</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/features-to-product-list-prestashop-16/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Flash Tip: Order Prestashop Features by name</title>
		<link>http://nemops.com/order-prestashop-features-name/</link>
		<comments>http://nemops.com/order-prestashop-features-name/#comments</comments>
		<pubDate>Tue, 03 Dec 2013 08:53:44 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[order]]></category>
		<category><![CDATA[prestashop]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=1705</guid>
		<description><![CDATA[<p>In this flash tip, we will see how to order Prestashop Features by name automatically, without having to manually adjust their position every time! Ordering Prestashop Features by name In order to change the features&#8217; order we need to amend the method called getFrontFeaturesStatic, of the Product class. As it&#8217;s best practice, let&#8217;s use an [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/order-prestashop-features-name/">Flash Tip: Order Prestashop Features by name</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this flash tip, we will see how to order Prestashop Features by name automatically, without having to manually adjust their position every time!</p>
<p><span id="more-1705"></span></p>
<h2>Ordering Prestashop Features by name</h2>
<p>In order to change the features&#8217; order we need to amend the method called <strong>getFrontFeaturesStatic</strong>, of the Product class. As it&#8217;s best practice, let&#8217;s use an override!</p>
<p>Go to <em>override/classes</em> and create a file named <strong>Product.php</strong>. Inside, add the following:</p>
<pre class="brush: php; title: ; notranslate">
class Product extends ProductCore
{
}
</pre>
<p>Then, let&#8217;s have a look at the original getFrontFeaturesStatic, located in the code Product.php file, found in the <em>classes/</em> folder.</p>
<pre class="brush: php; title: ; notranslate">

	public static function getFrontFeaturesStatic($id_lang, $id_product)
	{
		if (!Feature::isFeatureActive())
			return array();
		if (!array_key_exists($id_product.'-'.$id_lang, self::$_frontFeaturesCache))
		{
			self::$_frontFeaturesCache[$id_product.'-'.$id_lang] = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS('
				SELECT name, value, pf.id_feature
				FROM '._DB_PREFIX_.'feature_product pf
				LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.')
				LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '.(int)$id_lang.')
				LEFT JOIN '._DB_PREFIX_.'feature f ON (f.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.')
				'.Shop::addSqlAssociation('feature', 'f').'
				WHERE pf.id_product = '.(int)$id_product.'
				ORDER BY f.position ASC'
			);
		}
		return self::$_frontFeaturesCache[$id_product.'-'.$id_lang];
	}
</pre>
<p>Pay close attention to the ORDER BY clause. It currently says: f.position. We want to order by name, which is a column of the feature_lang table! Therefore, copy this whole method to the new override:</p>
<pre class="brush: php; title: ; notranslate">
class Product extends ProductCore
{

	public static function getFrontFeaturesStatic($id_lang, $id_product)
	{
		if (!Feature::isFeatureActive())
			return array();
		if (!array_key_exists($id_product.'-'.$id_lang, self::$_frontFeaturesCache))
		{
			self::$_frontFeaturesCache[$id_product.'-'.$id_lang] = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS('
				SELECT name, value, pf.id_feature
				FROM '._DB_PREFIX_.'feature_product pf
				LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.')
				LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '.(int)$id_lang.')
				LEFT JOIN '._DB_PREFIX_.'feature f ON (f.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.')
				'.Shop::addSqlAssociation('feature', 'f').'
				WHERE pf.id_product = '.(int)$id_product.'
				ORDER BY f.position ASC'
			);
		}
		return self::$_frontFeaturesCache[$id_product.'-'.$id_lang];
	}

}
</pre>
<p>And change the ORDER BY clause as follows: </p>
<pre class="brush: php; title: ; notranslate">
ORDER BY fl.name ASC
</pre>
<p>Done! If you are using a version newer than 1.5.3, go to the <em>cache/</em> folder and delete the class_index.php file in order for the new changes to take place!</p>
<p>The final override:</p>
<pre class="brush: php; title: ; notranslate">
class Product extends ProductCore
{

	public static function getFrontFeaturesStatic($id_lang, $id_product)
	{
		if (!Feature::isFeatureActive())
			return array();
		if (!array_key_exists($id_product.'-'.$id_lang, self::$_frontFeaturesCache))
		{
			self::$_frontFeaturesCache[$id_product.'-'.$id_lang] = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS('
				SELECT name, value, pf.id_feature
				FROM '._DB_PREFIX_.'feature_product pf
				LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.')
				LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '.(int)$id_lang.')
				LEFT JOIN '._DB_PREFIX_.'feature f ON (f.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.')
				'.Shop::addSqlAssociation('feature', 'f').'
				WHERE pf.id_product = '.(int)$id_product.'
				ORDER BY fl.name ASC'
			);
		}
		return self::$_frontFeaturesCache[$id_product.'-'.$id_lang];
	}

}
</pre>
<p>The post <a rel="nofollow" href="http://nemops.com/order-prestashop-features-name/">Flash Tip: Order Prestashop Features by name</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/order-prestashop-features-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
