<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: Target specific pages from a Prestashop Module&#8217;s Hook</title>
	<atom:link href="http://nemops.com/page-specific-prestashop-module/feed/" rel="self" type="application/rss+xml" />
	<link>http://nemops.com/page-specific-prestashop-module/</link>
	<description>Prestashop Tutorials, Modules and More!</description>
	<lastBuildDate>Fri, 10 Mar 2023 23:25:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.35</generator>
	<item>
		<title>By: andreas</title>
		<link>http://nemops.com/page-specific-prestashop-module/comment-page-1/#comment-45667</link>
		<dc:creator><![CDATA[andreas]]></dc:creator>
		<pubDate>Sat, 17 May 2014 10:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=1361#comment-45667</guid>
		<description><![CDATA[i love you man... been trying to unhook some module from unregistered unhook option. thanks man]]></description>
		<content:encoded><![CDATA[<p>i love you man&#8230; been trying to unhook some module from unregistered unhook option. thanks man</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anto</title>
		<link>http://nemops.com/page-specific-prestashop-module/comment-page-1/#comment-45661</link>
		<dc:creator><![CDATA[Anto]]></dc:creator>
		<pubDate>Thu, 08 May 2014 18:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=1361#comment-45661</guid>
		<description><![CDATA[This is the statement

	public function hookDisplayBanner($params)

	{ 

       if ( Tools::getValue(&#039;id_category&#039;) == 4 $this-&gt;context-&gt;controller-&gt;php_self) 

	  

             return false;

			 }

		return $this-&gt;hookDisplayTop($params);

	}





but no works 
very thanks for the support]]></description>
		<content:encoded><![CDATA[<p>This is the statement</p>
<p>	public function hookDisplayBanner($params)</p>
<p>	{ </p>
<p>       if ( Tools::getValue(&#8216;id_category&#8217;) == 4 $this-&gt;context-&gt;controller-&gt;php_self) </p>
<p>             return false;</p>
<p>			 }</p>
<p>		return $this-&gt;hookDisplayTop($params);</p>
<p>	}</p>
<p>but no works<br />
very thanks for the support</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anto</title>
		<link>http://nemops.com/page-specific-prestashop-module/comment-page-1/#comment-45660</link>
		<dc:creator><![CDATA[Anto]]></dc:creator>
		<pubDate>Thu, 08 May 2014 17:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=1361#comment-45660</guid>
		<description><![CDATA[I try this and no works

Tools::getValue(&#039;id_category&#039;) !=4 $this-&gt;context-&gt;controller-&gt;php_self) 

return false;

Parse error: syntax error, unexpected T_VARIABLE

very thanks nemo]]></description>
		<content:encoded><![CDATA[<p>I try this and no works</p>
<p>Tools::getValue(&#8216;id_category&#8217;) !=4 $this-&gt;context-&gt;controller-&gt;php_self) </p>
<p>return false;</p>
<p>Parse error: syntax error, unexpected T_VARIABLE</p>
<p>very thanks nemo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NemoPS</title>
		<link>http://nemops.com/page-specific-prestashop-module/comment-page-1/#comment-45658</link>
		<dc:creator><![CDATA[NemoPS]]></dc:creator>
		<pubDate>Thu, 08 May 2014 13:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=1361#comment-45658</guid>
		<description><![CDATA[For the category id itself, Tools::getValue(&#039;id_category&#039;) == THE_ONE_TO_CHECK]]></description>
		<content:encoded><![CDATA[<p>For the category id itself, Tools::getValue(&#8216;id_category&#8217;) == THE_ONE_TO_CHECK</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anto</title>
		<link>http://nemops.com/page-specific-prestashop-module/comment-page-1/#comment-45657</link>
		<dc:creator><![CDATA[Anto]]></dc:creator>
		<pubDate>Thu, 08 May 2014 13:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=1361#comment-45657</guid>
		<description><![CDATA[Nemo please.


If statement for one category id ¿?


Thanks]]></description>
		<content:encoded><![CDATA[<p>Nemo please.</p>
<p>If statement for one category id ¿?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian</title>
		<link>http://nemops.com/page-specific-prestashop-module/comment-page-1/#comment-45646</link>
		<dc:creator><![CDATA[Adrian]]></dc:creator>
		<pubDate>Fri, 02 May 2014 12:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=1361#comment-45646</guid>
		<description><![CDATA[i have this error on payment module (bankwire and cashondelivery)

Notice:  Undefined property: BankwirePaymentModuleFrontController::$php_self]]></description>
		<content:encoded><![CDATA[<p>i have this error on payment module (bankwire and cashondelivery)</p>
<p>Notice:  Undefined property: BankwirePaymentModuleFrontController::$php_self</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://nemops.com/page-specific-prestashop-module/comment-page-1/#comment-45394</link>
		<dc:creator><![CDATA[Jim]]></dc:creator>
		<pubDate>Sun, 01 Dec 2013 20:31:42 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=1361#comment-45394</guid>
		<description><![CDATA[I answered my own question about PS version 1.4. Here is a modification to the hookHeader function that does the following things:

1. If for any reason PHP_SELF is not set, then go ahead and load the CSS (just in case the user is on home page).
2. If website exists on a subdirectory, then the variable __PS_BASE_URI__ will handle parsing off the subdirectory from the haystack search target string. This is not really needed, though, since the function looks anywhere in the target string, not just at the beginning of the target string.
2. slash is included in search string, to help add specificity and help avoid garbage URLs from triggering CSS to load.
3. index.php will be found if it occurs anywhere in the search target string (if &#039;index.php&#039; is prefaced by a slash). This is useful for using this function on other types of pages, where the .php file occurs later in the path.
4. Variations of this function could include an array with a FOREACH loop, that limits CSS loading to specific pages, or prevents CSS from loading on the pages defined in the array.
5. The IF statement must be changed to account for excluding pages (rather than including pages). Excluding or including the desired action from CATALOG_MODE can also be handled in the IF statement.

The code:

&lt;code&gt;
	public function hookHeader($params)
	{	
		$php_self = $_SERVER[&#039;PHP_SELF&#039;];
		$haystack = substr($php_self, strlen(__PS_BASE_URI__)-1);
		$needle = &#039;/index.php&#039;;
		$position = strpos($haystack, $needle);

		if (isset($php_self) &amp;&amp; $position === false)
			return;

		Tools::addCSS(($this-&gt;_path).&#039;homefeatured.css&#039;, &#039;all&#039;);
		return;
	}
&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>I answered my own question about PS version 1.4. Here is a modification to the hookHeader function that does the following things:</p>
<p>1. If for any reason PHP_SELF is not set, then go ahead and load the CSS (just in case the user is on home page).<br />
2. If website exists on a subdirectory, then the variable __PS_BASE_URI__ will handle parsing off the subdirectory from the haystack search target string. This is not really needed, though, since the function looks anywhere in the target string, not just at the beginning of the target string.<br />
2. slash is included in search string, to help add specificity and help avoid garbage URLs from triggering CSS to load.<br />
3. index.php will be found if it occurs anywhere in the search target string (if &#8216;index.php&#8217; is prefaced by a slash). This is useful for using this function on other types of pages, where the .php file occurs later in the path.<br />
4. Variations of this function could include an array with a FOREACH loop, that limits CSS loading to specific pages, or prevents CSS from loading on the pages defined in the array.<br />
5. The IF statement must be changed to account for excluding pages (rather than including pages). Excluding or including the desired action from CATALOG_MODE can also be handled in the IF statement.</p>
<p>The code:</p>
<p><code><br />
	public function hookHeader($params)<br />
	{<br />
		$php_self = $_SERVER['PHP_SELF'];<br />
		$haystack = substr($php_self, strlen(__PS_BASE_URI__)-1);<br />
		$needle = '/index.php';<br />
		$position = strpos($haystack, $needle);</p>
<p>		if (isset($php_self) &amp;&amp; $position === false)<br />
			return;</p>
<p>		Tools::addCSS(($this-&gt;_path).'homefeatured.css', 'all');<br />
		return;<br />
	}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://nemops.com/page-specific-prestashop-module/comment-page-1/#comment-45335</link>
		<dc:creator><![CDATA[Jim]]></dc:creator>
		<pubDate>Fri, 29 Nov 2013 05:17:11 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=1361#comment-45335</guid>
		<description><![CDATA[How to do this in Prestashop version 1.4? &#039;context&#039; is undefined in 1.4..]]></description>
		<content:encoded><![CDATA[<p>How to do this in Prestashop version 1.4? &#8216;context&#8217; is undefined in 1.4..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shoulders</title>
		<link>http://nemops.com/page-specific-prestashop-module/comment-page-1/#comment-31434</link>
		<dc:creator><![CDATA[shoulders]]></dc:creator>
		<pubDate>Wed, 14 Aug 2013 13:40:24 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=1361#comment-31434</guid>
		<description><![CDATA[this is an excellent nugget of information. I am going to use it to disable address editing for client who have not reached a certain spend threshold.]]></description>
		<content:encoded><![CDATA[<p>this is an excellent nugget of information. I am going to use it to disable address editing for client who have not reached a certain spend threshold.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: doat</title>
		<link>http://nemops.com/page-specific-prestashop-module/comment-page-1/#comment-31335</link>
		<dc:creator><![CDATA[doat]]></dc:creator>
		<pubDate>Tue, 13 Aug 2013 14:51:49 +0000</pubDate>
		<guid isPermaLink="false">http://nemops.com/?p=1361#comment-31335</guid>
		<description><![CDATA[Yes, this works fine! Thank you very much!
And sorry, i didn&#039;t see your answer before.
&lt;code&gt;if (&#039;3&#039;== Tools::getValue(&#039;id_cms&#039;))&lt;code&gt;]]></description>
		<content:encoded><![CDATA[<p>Yes, this works fine! Thank you very much!<br />
And sorry, i didn&#8217;t see your answer before.<br />
<code>if ('3'== Tools::getValue('id_cms'))</code><code></code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
