Magento2 how to reindex

Here is how to reindex magento 2 from command line.You can not reindex from admin web. Goto command Line (SSH or Terminal) Goto Root directory of your magento 2 installation To reindex all magento 2 index fire following commandphp bin/magento indexer:reindex   To reindex specific indexing use following catalog_category_product catalog_product_category catalog_product_price catalog_product_attribute cataloginventory_stock catalogrule_rule catalogrule_product catalogsearch_fulltext For specific re-indexing for

Read more

Ubuntu magento cron setup

Check whether crontab is installed or not ? –> you can check same by fire command to command line crontab -e if you see result of crontab -e command then it is working otherwise you have to install cron service. –> If cron service is not installed you can install it by command sudo apt-get install cron Now we need

Read more

xcopy equivalent ubuntu – linux find command between date

Xcopy is windows command, using xcopy you can find files between date.Using xcopy you can coppy move files with physical paths to destination. In ubuntu(Linux) you can find files equivalent to xcopy using find command.In find command you have to pass source directory , from date, upto date and destination.This will simply copy files to given destination directory that is

Read more

jquery show hide element

There is many way to show hide elements using jQuery. 1.$(“#yourElement”).show(); $(“#yourElement”).hide(); 2.$(“#yourElement”).toggle(); 3.$(“#yourElement”).css(“display”, “none”); $(“#yourElement”).css(“display”, “block”);

Read more

php check valid username

You can check username is valid or not using regular expression.Regular expression is strong part of php.You can also use perl style of regular expression in php.The bellow given php function will allow only alpha numeric and underscore character.You can free to use this function in your project or scripts. Function function validate_username($username) { return preg_match(‘/^[A-Za-z][A-Za-z0-9]*(?:_[A-Za-z0-9]+)*$/’,$username); }

Read more

ajax username availability

How to check username availability in php jquery ?.You can check username availability using jquery ajax post request.You can also use ajax start,ajax stop and other ajax function.When ajax start you can show loading and when ajax request complete you can hide it.You can free to use this script and modify also. Jquery username check function <script type=”text/javascript”> $(document).ready(function() {

Read more

php remove newline from string

You can remove new line character any where in string using regex preg_replace.preg_replace is function which work on regex to search and replace in string.Regular express is strong part of php.You can also search replace html tags.Here I have used regex string feature to search and replace new line character. Here is example how you can remove new line anywhere

Read more

php submit form to self

Submitting form to self page is easy.Just what you have to do is set form action method to blank.Leaving form action blank will submit form to itself. For submitting php form itself keep your php code to top of php page and php html form code to bellow your php code.In your php code a top please use isset($_POST) condition

Read more

php remove from array

This is very simple in php.There is function called “unset()”.Which You can use to remove array element.what you have to do is pass array name and element key to which you want to remove. here is just simple example $arr=array(0=>’string1′,1=>’string2′,3=>’string3′); unset($arr[1]); //will remove second element from array

Read more

php remove space inside string

You can remove space any where in string using regex preg_replace.preg_replace is function which work on regex to search and replace in string.Regular express is strong part of php.You can also search replace html tags.Here I have used regex string feature to search and replace space. Here is example how you can remove space anywhere in php $str = ‘nik

Read more
1 2 3 4 5 6