Add New Hook In Prestashop

Prestashop
PrestaShop hooks are great way to insert or add data at the most important places or actions of this great e-commerce platform. But may be some time you want to use custom hooks with my custom modules. So here I show you how to implement custom hook? How to create custom hook? Step 1: Register a new hook in FrontController.php open file \classes\FrontController.php and find below code [php] self::$smarty->assign(array( 'HOOK_HEADER' => Module::hookExec('header'), 'HOOK_TOP' => Module::hookExec('top'), 'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn') )); [/php] Updated code For add new hook I add this line of code [php]'HOOK_Top_Center' => Module::hookExec('topCenter') // New Hook [/php] So you code look like below. [php] self::$smarty->assign(array( 'HOOK_HEADER' => Module::hookExec('header'), 'HOOK_TOP' => Module::hookExec('top'), 'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn'), 'HOOK_Top_Center' => Module::hookExec('topCenter') )); [/php] Step 2: All active hooks are hold in Prestashop…
Read More

Read xml data in php

PHP
PHP: Hypertext Preprocessor programming language, a popular dynamic web page scripting language, features the built-in SimpleXML extension, which simplifies reading and using XML in your PHP scripts. Read an RSS feed, XML office documents, or your own custom XML document. Here we use SimpleXML library, which is not only the best for converting string to XML object but is also built into PHP core so there is no need to install it. Once you have the URL of the XML feed that you are going to use, you need to have PHP load the contents of the feed into a string variable. Using file_get_contents, you could fetch the XML file like so: How to Read an XML File With PHP [php] <?php $xmlStr = file_get_contents('http://www.youdomain.com/feeds/news.xml'); $xmlObj = simplexml_load_string($xmlStr); $arrXml =…
Read More

Override Magento Admin Controller

Magento
When you use magento sometime need to customize some admin core functionality based on requirement. If you want to change core functionality of any controller so you need to override controller action with your controller action. Learning how to perform this action may be helpful to those who have computer forensics degrees. how to override magento admin controller action This example to show you override edit action from ProductController.php is located app/code/core/Mage/Adminhtml/controllers/Catalog Step 1: Create new module from app/etc/Justwebdevelopment_Overridecontroller.xml [sourcecode language="plain"] <?xml version="1.0"?> <config> <modules> <Justwebdevelopment_Overridecontroller> <active>true</active> <codePool>local</codePool> </Justwebdevelopment_Overridecontroller> </modules> </config> [/sourcecode] Step 2: Make config.xml from app/code/local/Justwebdevelopment/Overridecontroller/etc/config.xml [sourcecode language="plain"] <?xml version="1.0"?> <config> <modules> <Justwebdevelopment_Overridecontroller> <version>0.0.1</version> </Justwebdevelopment_Overridecontroller> </modules> <admin> <routers> <adminhtml> <args> <modules> <Justwebdevelopment_Overridecontroller before="Mage_Adminhtml">Justwebdevelopment_Overridecontroller</Justwebdevelopment_Overridecontroller> </modules> </args> </adminhtml> </routers> </admin> </config> [/sourcecode] Using above code you want to override any…
Read More

Move a WordPress One Domain to Another

Wordpress
In some cases user need to move wordpress to subdomain or move wordpress from subdomain to main domain. Students in basic computer classes can learn how to move wordpress to another domain. Here I want to show you how to move wordpress from one domain to another. move wordpress site from subdomain to main domain Please follow this step for moving your wordpress site. 1. Please take backup whole site with database.2. Compress, Download & Upload site files via FTP or SSH (Secure Shell).3. Open wp-config.php and edit with to set your new domain. [sourcecode language="plain"]define('WP_SITEURL', 'http://www.NEW-DOMAIN.com');<br> define('WP_HOME', 'http://www.NEW-DOMAIN.com');[/sourcecode] Put this code at top of the file. 4. Edit wp-config.php with your new Database settings (host, db, user, password) 5. For replace old URL with new URL from your database…
Read More

What is google plus one

SEO
Google was introduced around with the name "+1" for an upcoming social product. At that time, we were told it was sort of like Google’s version of the "like" or "retweet" button. Google took a great decision to compete with Social Media giants like Facebook and Twitter. Google introducing +1 Button which is something in the similar lines of Facebook Like button. +1 Button will soon appear beside to search results and Google Adwords Advertisements. By clicking on this button, you can see how many of your friends liked this website/content/page/post etc.., it will also inform to your friends if you share a link online. When you're signed into your Google account, every Google search result will now have a +1 icon next to it. If you find the search…
Read More

Get Magento URL and Path

Magento
When you work or develop magento site so many places you need to some magento URL. Magento URL and magento path is very helpful to make development easy. When you want to create magento static block and you want to show some image or set any page link then you need to set exact path for that. Maegnto provide some basic path or URL by default. Here I want to show you magento path and URL. Use magento URL in static block get SKIN URL [php]{{skin url='images/sampleimage1.png'}}[/php] get Media URL [php]{{media url='/sampleimage1.png'}}[/php] get Store URL [php]{{store url='contact.html'}}[/php] get Base URL [php]{{base url='yourstore/contact.html'}}[/php] Use magento URL path in PHTML get Homepage URL [php]<?php $home_url = Mage::helper('core/url')->getHomeUrl(); ?>[/php] Or check current page is homepage [php]<?php if( Mage::getSingleton('cms/page')->getIdentifier() == 'home' && Mage::app()->getFrontController()->getRequest()->getRouteName() ==…
Read More

How to create custom module in magento

Magento
Magento is best eCommerce system now a days which is offering rich customization possibilities by extensions and modules. Magento is built on a fully modular model that influences an unlimited scalability and flexibility for your store. Ajaxform and Ajaxsubmit There are many things custom modules can do, from editing your Database, to handling module upgrades to overriding classes (Blocks, Controllers, Models) … and more! Magento is an open source solution. So you can write new modules for Magento by yourself. Here I want to show you how to create simple costume module magento. In Magento all modules are organized under a package. This package is nothing but a simple folder under codepool containing different modules. For example all core modules of magento system is kept under package “Mage” (open the…
Read More

AjaxForm and AjaxSubmit Options

JQuery
Ajaxform uses progressive enhancement, users without JavaScript can still use the form in a traditional way users with JavaScript will get a more sophisticated experience.AjaxForm takes zero or one argument. The single argument can be either a callback function or an Options Object. [code lang="js"]$('#myFormId').ajaxForm();[/code] AjaxForm and AjaxSubmit support numerous options which can be provided using an Options Object. The Options Object is simply a JavaScript object that contains properties with values set as follows: urlURL to which the form data will be submitted.Default value: value of form's action attributetypeThe method in which the form data should be submitted, 'GET' or 'POST'.Default value: value of form's method attribute (or 'GET' if none found)targetIdentifies the element(s) in the page to be updated with the server response. This value may be specified…
Read More

XML Sitemap for SEO

SEO
XML sitemap are best an easy method to inform search engines about the website content/pages. XML sitemap lists URLs for a website along with additional information like: date of update, how frequently usually changes, and importance. XML sitemap offer the ability for you to give a priority ranking to all your webpages on a scale from 0.0 to 1.0, with 1.0 being the most important and 0.5 being the default neutral rank. For example your index page you would give a ranking of 1.0 to, while your terms of service page you would probably want to assign a 0.1 to. This point value system helps the search engines by giving them and their bots a way to know which pages on your site you value most and therefore which to…
Read More

Benefits of SEO

SEO
SEO is a process where you can improve your site by ranking higher in search engines. It brings motivated buyers to you online and offline both. It sustains traffic to the site and builds a brand reputation of the same. Free article writing services can help you with SEO content for your site. =>Boost your trafficGet news coverage of your business and your site, Become active in bulletin boards and chat rooms focusing on your industry. =>Long term positioningOnce a website obtains a position through an SEO campaign, it should stay there for the long term as opposed to PPC (Pay Per Click). SEO is a cheaper and long-term solution than any other search engine marketing strategy. =>Increase VisibilityOnce a website has been optimized, it will increase the visibility of…
Read More