<?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; jquery</title>
	<atom:link href="http://nemops.com/tag/jquery/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>Create an Ajax Contact Form in PrestaShop</title>
		<link>http://nemops.com/prestashop-ajax-contact-form/</link>
		<comments>http://nemops.com/prestashop-ajax-contact-form/#comments</comments>
		<pubDate>Tue, 01 Nov 2016 10:33:03 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[prestashop]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2878</guid>
		<description><![CDATA[<p>In this awesome PrestaShop tutorial, we will add an ajax contact form to the product page View Demo (click Contact Us next to &#8220;In Stock&#8221;) Watch the Screencast</p>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-ajax-contact-form/">Create an Ajax Contact Form in PrestaShop</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this awesome PrestaShop tutorial, we will add an ajax contact form to the product page<br />
<span id="more-2878"></span></p>
<p><a href="http://demo.nemops.com/en/women/tops/tshirts/faded-short-sleeve-t-shirts" title="PrestaShop ajax contact form demo" target="_blank">View Demo (click Contact Us next to &#8220;In Stock&#8221;)</a></p>
<h2>Watch the Screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/F4FRr_GLLpw" frameborder="0" allowfullscreen></iframe><p><a href="https://www.youtube.com/user/NemoPostScriptum/videos" rel="nofollow" title="Subscribe Post Scriptum's Youtube Channel">Subscribe Post Scriptum's Youtube Channel</a></p>	</div>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-ajax-contact-form/">Create an Ajax Contact Form in PrestaShop</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/prestashop-ajax-contact-form/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Essential Prestashop Functions &#8211; Day 1</title>
		<link>http://nemops.com/prestashop-functions-1/</link>
		<comments>http://nemops.com/prestashop-functions-1/#comments</comments>
		<pubDate>Tue, 21 Jul 2015 10:03:01 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[prestashop]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2486</guid>
		<description><![CDATA[<p>Prestashop has lots of time-saving functions that we can use when developing modules or extensions. Let&#8217;s have a look at the first batch of Prestashop Functions, and in which context they might come in use. If you want to dive into Prestashop development, these are likely the first methods you&#8217;ll be needing. NOTICE: Values with [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-functions-1/">Essential Prestashop Functions &#8211; Day 1</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Prestashop has lots of time-saving functions that we can use when developing modules or extensions. Let&#8217;s have a look at the first batch of Prestashop Functions, and in which context they might come in use.</p>
<p><span id="more-2486"></span></p>
<p>If you want to dive into Prestashop development, these are likely the first methods you&#8217;ll be needing.</p>
<p><strong>NOTICE: Values with &#8220;=&#8221; in the declaration are optionals.</strong></p>
<h2>Managing Configuration values in Prestashop</h2>
<pre class="brush: php; title: ; notranslate">

// Updating a single/multiple value/s
Configuration::updateValue($key, $values, $html = false, $id_shop_group = null, $id_shop = null);

// Getting a single value
Configuration::get($key, $id_lang = null, $id_shop_group = null, $id_shop = null)

// Getting Multiple Values
Configuration::getMultiple($keys, $id_lang = null, $id_shop_group = null, $id_shop = null)

// Getting the same key in all languages
Configuration::getInt($key, $id_shop_group = null, $id_shop = null)

// Erase the given entry
Configuration::deleteByName($key)

</pre>
<p>These methods are used to interact with the *prefix_*configuration table. It&#8217;s the quickest way to store simple data in Prestashop.</p>
<h3>Example Usage</h3>
<pre class="brush: php; title: ; notranslate">
// Saving a normal string
$my_text = 'This is some text';
Configuration::updateValue('MY_CONFIG_PARAMETER', $my_text);

// Saving an html string
$my_text = '&lt;p&gt;This is some text&lt;/p&gt;';
Configuration::updateValue('MY_CONFIG_PARAMETER', $my_text, true);

// Saving multiple values, KEYS represend ID_LANG
$my_texts = array(
	1 =&gt; 'This is some text',
	2 =&gt; 'This is some text in another language'
	);
Configuration::updateValue('MY_CONFIG_PARAMETER_MULTILANG', $my_text);


// Getting a single value
$my_text = Configuration::get('MY_CONFIG_PARAMETER');

// Getting a single value for the current language only
$my_text = Configuration::get('MY_CONFIG_PARAMETER', $this-&gt;context-&gt;language-&gt;id);

// Getting Multiple Values
$keys_to_get = array('MY_CONFIG_PARAMETER', 'OTHER_CONFIG_PARAMETER');
Configuration::getMultiple($keys_to_get);

// Delete the given key
Configuration::deleteByName('MY_CONFIG_PARAMETER');
</pre>
<div class="separator"></div>
<h2>Getting POST and GET in Prestashop</h2>
<pre class="brush: php; title: ; notranslate">
Tools::getValue($key, $default_value = false)

</pre>
<p>Retrieves the current POST or GET variable with the given key</p>
<h3>Example Usage</h3>
<pre class="brush: php; title: ; notranslate">
// Getting either POST or GET with the key 'myvalue', the second parameter is what to assign then nothing is found.
$value = Tools::getValue('myvalue', 4);
// If no 'myvalue' POST or GET variable is set, $value will be 4.
</pre>
<div class="separator"></div>
<h2>Checking for submitted data in Prestashop</h2>
<pre class="brush: php; title: ; notranslate">
Tools::isSubmit($key);
</pre>
<p>Check whether or not the given key has been submitted to the current page.</p>
<h3>Example Usage</h3>
<pre class="brush: php; title: ; notranslate">
if(Tools::isSubmit('myvalue'))
{
	// do something
}
</pre>
<div class="separator"></div>
<h2>Displaying Errors in Prestashop</h2>
<pre class="brush: php; title: ; notranslate">
Tools::displayError($string = 'Fatal error', $htmlentities = true, Context $context = null)
</pre>
<p>Displays an error with proper formatting.</p>
<h3>Example Usage</h3>
<pre class="brush: php; title: ; notranslate">
if($myvalue != 1)
{
	// will need to be displayed later on
	$error_string = Tools::displayError('It is different from 1');
}
</pre>
<div class="separator"></div>
<h2>Displaying Confirmations in Prestashop Modules</h2>
<pre class="brush: php; title: ; notranslate">
$this-&gt;displayConfirmation($string);
</pre>
<p>Displays a properly formatted confirmation message. $this refers to a module, it is therefore only available in module contexts only. Refer to the proper variable elsewhere.</p>
<pre class="brush: php; title: ; notranslate">

// this is inside a module's method
if($myvalue == 1)
{
	// will need to be displayed later on
	$conf_string = $this-&gt;displayConfirmation('Updated!');
}

</pre>
<div class="separator"></div>
<h2>Adding CSS in Prestashop</h2>
<pre class="brush: php; title: ; notranslate">
ControllerCore::addCSS($css_uri, $css_media_type = 'all', $offset = null, $check_path = true)
</pre>
<p>Appends the given CSS file/s to the page</p>
<h3>Example Usage</h3>
<pre class="brush: php; title: ; notranslate">

// this is inside a module's method
$this-&gt;context-&gt;controller-&gt;addCSS($this-&gt;_path.'css/myfile.css', 'all');

// this is inside a controller's method
$this-&gt;addCSS(_THEME_CSS_DIR_.'product.css');

// adding multiple files
$files = array(
	_THEME_CSS_DIR_.'product.css' =&gt; 'all',
	_THEME_CSS_DIR_.'other_css.css' =&gt; 'all'
);
$this-&gt;addCSS($files);

</pre>
<div class="separator"></div>
<h2>Adding Javascript in Prestashop</h2>
<pre class="brush: php; title: ; notranslate">
ControllerCore::addJS($js_uri, $check_path = true);
</pre>
<p>Appends the given JS file/s to the page</p>
<h3>Example Usage</h3>
<pre class="brush: php; title: ; notranslate">

// this is inside a module's method
$this-&gt;context-&gt;controller-&gt;addCSS($this-&gt;_path.'css/myfile.css', 'all');

// this is inside a controller's method
$this-&gt;addCSS(_THEME_CSS_DIR_.'product.css');

</pre>
<div class="separator"></div>
<h2>Adding jQuery Plugins in Prestashop</h2>
<pre class="brush: php; title: ; notranslate">
ControllerCore::addJqueryPlugin($name, $folder = null, $css = true)
</pre>
<p>Appends the given jQuery Plugin/s to the page</p>
<h3>Example Usage</h3>
<pre class="brush: php; title: ; notranslate">

// this is inside a module's method, multiple files
$this-&gt;context-&gt;controller-&gt;addjqueryPlugin('fancybox');

// this is inside a controller's method
$this-&gt;addjqueryPlugin('fancybox');

// this is inside a controller's method, multiple values
$this-&gt;addjQueryPlugin(array('scrollTo', 'alerts', 'chosen', 'autosize', 'fancybox' ));

// this is inside a controller's method, without loading the plugin's CSS
$this-&gt;addjQueryPlugin('growl', null, false);

</pre>
<div class="separator"></div>
<h2>Adding jQuery UI Components in Prestashop</h2>
<pre class="brush: php; title: ; notranslate">
ControllerCore::addJqueryUI($component, $theme = 'base', $check_dependencies = true);
</pre>
<p>Appends the given jQuery UI component/s to the page</p>
<h3>Example Usage</h3>
<pre class="brush: php; title: ; notranslate">

// this is inside a module's method, single file
$this-&gt;context-&gt;controller-&gt;addjQueryUI(ui.datepicker');

// this is inside a controller's method, multiple files
$this-&gt;addJqueryUI(array('ui.slider', 'ui.datepicker'));

</pre>
<div class="separator"></div>
<h2>Wrapping it up</h2>
<p>We saw quite a number of useful PrestaShop Functions today, which are enough to start coding your own, simple module. Apart from trying to remember them all, I suggest creating code snippets with some text expander, so you can quickly drop them in, without having to remember the exact syntax.</p>
<div class="separator"></div>
<h3>Additional Resources</h3>
<ul>
<li><a href="http://nemops.com/prestashop-functions-2/#.Vb9Bxvnzrmg" title="Essential Prestashop Functions – Day 2">Essential Prestashop Functions – Day 2</a></li>
<li><a href="http://nemops.com/prestashop-functions-3/#.Vb9EAPnzrmg" title="Essential Prestashop Functions – Day 3">Essential Prestashop Functions – Day 3</a></li>
<li><a href="http://nemops.com/prestashop-functions-4/#.Vc2cffnzrmg" title="Essential Prestashop Functions – Day 4">Essential Prestashop Functions – Day 4</a></li>
<li><a href="http://nemops.com/prestashop-functions-5/#.Ve6fNxHzrmg" title="Essential Prestashop Functions – Day 5">Essential Prestashop Functions – Day 5</a></li>
</ul>
<p>The post <a rel="nofollow" href="http://nemops.com/prestashop-functions-1/">Essential Prestashop Functions &#8211; Day 1</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/prestashop-functions-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
