Reset the user password in Magento from mysql

Replace NewPassword with the new secret key, and replace the two events of xxxxxxxx with any arbitrary character succession.

Magento 2:

UPDATE customer_entity SET password_hash = CONCAT(SHA2(‘xxxxxxxNewPassword’, 256), ‘:xxxxxxx:1′) WHERE email =’abc@gmail.com’

Magento 1.9:

UPDATE customer_entity SET password_hash = CONCAT(MD5(‘xxxxxxxNewPassword’), ‘:xxxxxxx’) WHERE email =’abc@gmail.com’

The xxxxxxx character succession is a cryptographic salt. It can be anything you need (and any length you need), yet ensure you utilize a similar value in the two sections of the SQL statement.

Advertisements

Smarty Global Variables in Prestashop

$base_dir { root folder of your shop }
$base_dir_ssl { root folder of your shop using HTTPS protocol }
$content_dir { root folder of your shop depending on the SSL settings }
$img_ps_dir { root folder containing images “/img/” }
$img_dir { images folder in your current theme directory }
$css_dir { css folder inside the current theme folder }
$js_dir { JavaScript inside the theme folder }
$tpl_dir { theme root folder }
$modules_dir { modules root folder }
$mail_dir { mail templates root folder }
$lang_iso { current language ISO code }
$come_from { previous page address [absolute] }
$shop_name { your specified shop name }
$cart_qties { total number of products in the cart }
$cart { shopping cart contents }
$currencies { pulls available currencies }
$id_currency_cookie { selected currency id [cookie dependent] }
$currency { active currency }
$cookie { active cookie }
$languages { grabs available languages }
$logged { checks whether users is logged in }
$page_name { current page’s name }
$customerName { customer name [session dependent] }
$priceDisplay { current price display settings [currency dependent] }

Custom helper class in cake php

You can create your own helper class.Follow given steps.

Step1:
First create a custom class in app/view/helper/
class TestClassHelper extends AppHelper
{
function test_function($name)
{
return “Welcome”.$name;
}
}

Step2:
Add TestClass in Controller.
class PostsController extends AppController
{
public $helpers = array(‘TestClass’);
// note: this will create object of your custom helper class
}

Step3:
Now you can use this custom helper class function directly in your view test.ctp file.
$this->TestClass->test_function(“Pushpendra Singh”);

Setting Up the CakePHP Console on Windows

First, we need to set Environment Variables so that Windows can run cake from the command console:

Open “Computer” under your Windows Start menu
Right-click the “Computer” window, and select “Properties”
You will be brought to the Control Panel’s System window. We’ll need to change our environment variables under “Advanced System Settings,” which you can select from the left column menu in this window
Select the “Advanced” tab on the System Properties window
Click the “Environment Variables…” button
In the System Variables box, find the “Path” variable and click “Edit…”

At the end of your Path variable add
;C:\xampp\php;C:\xampp\htdocs\testcake\app\console\;

Click “OK” to save your changes.

PHP

PHP: Hypertext Preprocessor is a server side scripting language, and is a powerful tool for making dynamic and interactive Web pages.

1)PHP runs on different platforms (Windows, Linux, Unix, Mac OS X, etc.)
2)PHP is compatible with almost all servers used today (Apache, IIS, etc.)
3)PHP has support for a wide range of databases.

Example:
Example