Redirect to previous page after login

  1. Save URL referer in login page

2. Check saved URI after login successfully and redirect

Convert youtube URL to embed code



Woocommerce thank you page

Variable $order in thankyou.php will be created by order key from URL. e.g. key=wc_order_593a3d1583f2e

So, it’s important to make sure return URLs of payment gateways include this param or thank you page won’t display order info and purchase event of Facebook pixel will not work neither.


  1. How to get order key:

Create Virtual host on EC2 (ubuntu)


  1. sudo mkdir -p /var/www/
  2. sudo chown -R ubuntu:www-data /var/www/
  3. sudo chmod -R 755 /var/www/
  4. cd /etc/apache2/sites-available/
    sudo cp 000-default.conf
    sudo nano
  5. sudo a2ensite
  6. sudo service apache2 restart



Woocommerce Checkout page customization


  1. Official Tutorials
  2. Sorting for checkout fields
  3. Woocommerce Hooks
  4. Other tutorial:

session_start() permission issue

This is because the “Local value” overwrite “Master value” and point to a folder that users don’t have permission to write session related files.

  1. Change session.save_path value or uncomment the line in php.ini
  2. Find and edit the config file
  3. Restart apache