<?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; suppliers</title>
	<atom:link href="http://nemops.com/tag/suppliers/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>Displaying more Supplier information on the Product Page in PrestaShop</title>
		<link>http://nemops.com/prestashop-supplier-info-product-page/</link>
		<comments>http://nemops.com/prestashop-supplier-info-product-page/#comments</comments>
		<pubDate>Wed, 18 Nov 2015 10:41:33 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Theming]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[suppliers]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2602</guid>
		<description><![CDATA[<p>Displaying more information about a product&#8217;s Supplier, directly on the product page, is quite easy in PrestaShop. It only needs an override and a tiny modification to the product template. Overriding the Product Controller Unless you want to hard-modify the original ProductController, you would need an override to assign all the necessary Supplier data to [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-supplier-info-product-page/">Displaying more Supplier information on the Product Page in PrestaShop</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Displaying more information about a product&#8217;s Supplier, directly on the product page, is quite easy in PrestaShop. It only needs an override and a tiny modification to the product template.</p>
<p><span id="more-2602"></span></p>
<h2>Overriding the Product Controller</h2>
<p>Unless you want to hard-modify the original ProductController, you would need an override to assign all the necessary Supplier data to your product page.</p>
<p>Create a new file in <em>override/controllers/front</em>, and name it <strong>ProductController.php</strong>. Open it up and add some generic override code inside php tags:</p>
<pre class="brush: php; title: ; notranslate">
class ProductController extends ProductControllerCore
{

}
</pre>
<p>We have to override the initContentMethod</p>
<pre class="brush: php; title: ; notranslate">
class ProductController extends ProductControllerCore
{
	public function initContent()
	{
		parent::initContent();
	}
}
</pre>
<p>Make sure you call the parent at the very beginning of it, then add the following inside:</p>
<pre class="brush: php; title: ; notranslate">
if($this-&gt;product-&gt;id_supplier)
{
	
	$id_supplier_address = Address::getAddressIdBySupplierId($this-&gt;product-&gt;id_supplier);
	$supplier_address = new Address($id_supplier_address);
}
</pre>
<p>First off, we are checking the current product has a supplier. Then, we need its address id, which we use to instantiate a new Address object that contains all of the information we seek.</p>
<p>At this point, we can simply assign all we want to the template:</p>
<pre class="brush: php; title: ; notranslate">
if (Validate::isLoadedObject($supplier_address))
				{
					$this-&gt;context-&gt;smarty-&gt;assign(array(
						'supplier_country'=&gt;  $supplier_address-&gt;country,
						'supplier_company'=&gt;  $supplier_address-&gt;company,
						'supplier_address1'=&gt;  $supplier_address-&gt;address1,
						'supplier_postcode'=&gt;  $supplier_address-&gt;postcode,
						'supplier_city'=&gt;  $supplier_address-&gt;city,
						'supplier_phone'=&gt;  $supplier_address-&gt;phone,
						'supplier_state' =&gt; State::getNameById($supplier_address-&gt;id_state),
						'supplier_vat_number'=&gt;  $supplier_address-&gt;vat_number,
					));
				}

</pre>
<p>As an extra measure, we make sure the loaded address object is valid and exists</p>
<p>When you&#8217;re done modifying the file, reach the <em>cache/</em> folder and erase <strong>class_index.php</strong></p>
<div class="separator"></div>
<h2>Amending the product template</h2>
<p>Now we are ready to display our data. Open <strong>product.tpl</strong>, located in your theme&#8217;s folder. You can choose any spot, I decided to go for the area below the social links in the center column.</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
			{if $product-&gt;id_supplier}
				&lt;h4&gt;&lt;a href=&quot;{$link-&gt;getSupplierLink($product-&gt;id_supplier)}&quot;&gt;&lt;strong&gt;{$product-&gt;supplier_name}&lt;/strong&gt;&lt;/a&gt;&lt;/h4&gt;
				&lt;ul&gt;
					&lt;li&gt;{$supplier_address1}&lt;/li&gt;
					&lt;li&gt;{$supplier_postcode}&lt;/li&gt;
					&lt;li&gt;{$supplier_city}, {$supplier_state}&lt;/li&gt;
					&lt;li&gt;{$supplier_country}&lt;/li&gt;
					{if $supplier_vat_number}
						&lt;li&gt;{$supplier_vat_number}&lt;/li&gt;
					{/if}
				&lt;/ul&gt;

			{/if}	
</pre>
<p>I am obviously checking if this product has a supplier, otherwise those variables would not be assigned. Save and refresh, you might need to clear cache in the back office (<strong>Advanced Parameters, Performance</strong>). We&#8217;re done!</p>
<p><a href="http://nemops.com/wp-content/uploads/2015/11/supplier_info.png"><img src="http://nemops.com/wp-content/uploads/2015/11/supplier_info.png" alt="Displaying more Supplier information on the Product Page in PrestaShop" width="550" height="366" class="aligncenter size-full wp-image-2604" /></a></p>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-supplier-info-product-page/">Displaying more Supplier information on the Product Page in PrestaShop</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/prestashop-supplier-info-product-page/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Flash Tip: Brand logos to Prestashop Manufacturers/Suppliers blocks</title>
		<link>http://nemops.com/brand-logos-prestashop-manufacturers-suppliers/</link>
		<comments>http://nemops.com/brand-logos-prestashop-manufacturers-suppliers/#comments</comments>
		<pubDate>Thu, 19 Sep 2013 07:35:59 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[brands]]></category>
		<category><![CDATA[manufacturers]]></category>
		<category><![CDATA[suppliers]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=1590</guid>
		<description><![CDATA[<p>In this Flash tip we will see how to add brand logos to both the manufacturer and supplier block in Prestashop Whether you want to use Manufacturers or Suppliers to display your brands across your web store, it&#8217;s a good idea to showcase their Logos, instead of names, in the menu. Let&#8217;s see how to [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/brand-logos-prestashop-manufacturers-suppliers/">Flash Tip: Brand logos to Prestashop Manufacturers/Suppliers blocks</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 add brand logos to both the manufacturer and supplier block in Prestashop</p>
<p><span id="more-1590"></span></p>
<p>Whether you want to use Manufacturers or Suppliers to display your brands across your web store, it&#8217;s a good idea to showcase their Logos, instead of names, in the menu. Let&#8217;s see how to do it for both entities. As always, note that I&#8217;m using the default theme and your css or tpl files might differ.</p>
<div class="separator"></div>
<h2>Displaying Brand Logos in the Manufacturers block</h2>
<p>Open up <strong>blockmanufacturer.php</strong>, located in your theme&#8217;s folder <em>/modules/blockmanufacturer</em>. If this folder is not present, reach your main <em>/modules/</em> folder, then open <em>blockmanufacturer/</em> and copy <strong>blockmanufacturer.tpl</strong> in the previously mentioned location.</p>
<p>In this .tpl file, locate, at about line 35, the following code snippet:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">

&lt;li class=&quot;{if $smarty.foreach.manufacturer_list.last}last_item{elseif $smarty.foreach.manufacturer_list.first}first_item{else}item{/if}&quot;&gt;&lt;a href=&quot;{$link-&gt;getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)|escape:'html'}&quot; title=&quot;{l s='Learn more about' mod='blockmanufacturer'} {$manufacturer.name}&quot;&gt;{$manufacturer.name|escape:'htmlall':'UTF-8'}&lt;/a&gt;&lt;/li&gt;

</pre>
<p>We want to grab the image instead of text:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">

&lt;li class=&quot;{if $smarty.foreach.manufacturer_list.last}last_item{elseif $smarty.foreach.manufacturer_list.first}first_item{else}item{/if}&quot;&gt;&lt;a href=&quot;{$link-&gt;getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)}&quot; title=&quot;{l s='More about' mod='blockmanufacturer'} {$manufacturer.name}&quot;&gt;&lt;img src=&quot;{$base_dir}img/m/{$manufacturer.id_manufacturer}.jpg&quot;/&gt;&lt;/a&gt;&lt;/li&gt;

</pre>
<p><strong>Please note that the file extension might change if you use .png as your base image format in .Preferences -> Images</strong>.</p>
<p>Of course, you can hardcode the image&#8217;s max width according to your layout! As a final touch, let&#8217;s get rid of those useless arrows at the left side: Open up the theme&#8217;s <strong>global.css</strong> located inside the theme&#8217;s folder, <em>/css/</em>, and look for </p>
<pre class="brush: css; title: ; notranslate">
	.blockmanufacturer li a {
		display:block;
		padding:7px 11px 5px 22px;
		color:#333;
		background:url(../../../modules/blockmanufacturer/img/arrow_right_2.png) no-repeat 10px 10px transparent
	}
</pre>
<p>Then, change it to</p>
<pre class="brush: css; title: ; notranslate">
	.blockmanufacturer li a {
		display:block;
	}
</pre>
<p>Done!</p>
<p><img src="http://nemops.com/wp-content/uploads/2013/09/manufacturers.png" alt="Brand Logos in the Manufacturers List in Prestashop" width="206" height="259" class="alignnone size-full wp-image-1592" /></p>
<div class="separator"></div>
<h2>Displaying Brand Logos in the Suppliers block</h2>
<p>This is quite similar as before, open up <strong>blocksupplier.php</strong>, located in your theme&#8217;s folder <em>/modules/blocksupplier</em>. If this folder is not present, add it as we did before.</p>
<p>Now locate the following snippet in the file:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">

&lt;li class=&quot;{if $smarty.foreach.supplier_list.last}last_item{elseif $smarty.foreach.supplier_list.first}first_item{else}item{/if}&quot;&gt;
			&lt;a href=&quot;{$link-&gt;getsupplierLink($supplier.id_supplier, $supplier.link_rewrite)|escape:'html'}&quot; title=&quot;{l s='More about' mod='blocksupplier'} {$supplier.name}&quot;&gt;{$supplier.name|escape:'htmlall':'UTF-8'}&lt;/a&gt;
		&lt;/li&gt;

</pre>
<p>Add the image to replace the text inside the anchor tag:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">

&lt;li class=&quot;{if $smarty.foreach.supplier_list.last}last_item{elseif $smarty.foreach.supplier_list.first}first_item{else}item{/if}&quot;&gt;
	&lt;a href=&quot;{$link-&gt;getsupplierLink($supplier.id_supplier, $supplier.link_rewrite)|escape:'html'}&quot; title=&quot;{l s='More about' mod='blocksupplier'} {$supplier.name}&quot;&gt;&lt;img src=&quot;{$base_dir}img/su/{$supplier.id_supplier}.jpg&quot;/&gt;&lt;/a&gt;
&lt;/li&gt;

</pre>
<p><strong>Again, note that the file extension might change if you use .png as your base image format in .Preferences -> Images</strong>.</p>
<p>And once more, let&#8217;s get rid of the arrows as we did before, in <strong>global.css</strong></p>
<pre class="brush: css; title: ; notranslate">
	.blocksupplier li a {
		display:block;
		padding:7px 11px 5px 22px;
		color:#333;
		background:url(../../../modules/blocksupplier/img/arrow_right_2.png) no-repeat 10px 10px transparent
	}

</pre>
<p>Then, change it to</p>
<pre class="brush: css; title: ; notranslate">
	.blocksupplier li a {
		display:block;
	}

</pre>
<p>Again, done!</p>
<p><img src="http://nemops.com/wp-content/uploads/2013/09/suppliers.png" alt="Brand Logos in the Suppliers List in Prestashop" width="214" height="207" class="alignnone size-full wp-image-1591" /></p>
<p>The post <a rel="nofollow" href="http://nemops.com/brand-logos-prestashop-manufacturers-suppliers/">Flash Tip: Brand logos to Prestashop Manufacturers/Suppliers blocks</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/brand-logos-prestashop-manufacturers-suppliers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
