WM SANJAYA

Setup Shopify Store

  1. Create a new Shopify Account (14 day Trail)
  2. Add Billing and Store Details
  3. Add domain name
    Make sure you register your domain through Godaddy/External domain provider and point the domain A record to Shopify
  4. Setup emails
    1. I highly recommend using g-suite or Microsoft exchange to handle emails
  5. Configure General Information
  6. Add Refund Policy, Privacy policy, Terms of Service and Shipping Policy

Make your store fancy

  1. Create a logo

Magento 2 Get custom product attribute values array from product collection

Magento Collections are powerful. We can use this to get a custom product attribute value array from a product collection with a couple of lines of code.

protected $_productCollection;

/* Constructor */
public function __construct(
\Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection
) {
$this->_productCollection = $productCollection;
}

/* @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */
$collection = $this->_productCollectionFactory->create()
->addAttributeToSelect('custom_attribute', 'catalog_product_entity_text');
$collection->addCategoriesFilter(['eq' => $category]);
$collection->load();

if ($collection) {
$allCategoryCountries = $collection->getColumnValues('custom_attribute');
}

Learning Magento 2 From Scratch

I have experience in Magento 1 and I am trying to move to Magento 2. Magento 2 totally different from Magento 1. So, Magento 1 experience does not help much. The biggest challenge I am facing is lack of good tutorials in Magento 2 for beginners like me. I always find it easy to understand when I can see a working example. List of files needed to be added or edited makes it easy to debug and check if I have not missed anything. A brief explanation of why each block code or variable exists will help to understand the logic. So far, I could not find all these features in one Magento 2 tutorial. Do not get me wrong there are great tutorials out there. However for a beginner like me always need extra help.

What is my Magento 2 Solution

My solution is quite simple. I am going through Magento 2 tutorials and stack exchange to figure out adding Magento 2 features programmatically. I decided to document each task separately in a git repo and deploy it to Magento 2 instant. Also, give a brief description of my understanding. In that way, I can easily find them when I need it in the future and I think it will help you to learn Magento 2 fast.

How to Install Magento 2.2 In Digital Ocean

Let’s install Magento 2.2 on Digital Ocean droplet.  Basically, digital ocean droplet is clean OS only so, you will have to install LAMP (Linux, Apache, MySQL and PHP) stack. Based on the Magento 2.2 requirement I created an Ubuntu 16.04.3 x 64 droplet. The ideal droplet size for magento2.2 would be size would be 3GB 20GB and 3TB in terms of performances.

Megento 2.2 Requirments

#1 Install Apache 2

  • sudo apt-get update
  • sudo apt-get install apache2
  • sudo systemctl status apache2 to check the apache status

Now you should be able to visit http://server_domain_or_IP and it will show you Apache2 Ubuntu Default Page.

Install PHP 7.1

  • Install PHP7.1 – sudo apt-get install php7.1
  • Restart Apache – systemctl restart apache2
  • sudo apt-cache search php7.1

Install PHP7.1 Modules

  • sudo apt-cache search php7.1
  • sudo apt-get install php7.1 php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm
  • sudo apt-get install curl
  • Restart Apache – systemctl restart apache2
  • Then Install PHP5 CURL by typing sudo apt-get install php5-curl
  • sudo apt-get install php-xml
  • sudo apt-get install php7.1-intl
  • sudo apt-get install php7.1-gd
  • sudo apt-get install php7.1-intl
  • sudo apt-get install php7.1-xsl
  • sudo apt-get install php7.0-soap
  • sudo systemctl restart apache2.service
  • apt install composer

php –ini |grep Loaded
Loaded Configuration File: /etc/php/7.1/cli/php.ini

sudo nano /etc/php/7.1/cli/php.ini
cgi.fix_pathinfo=0

Change defaul page

sudo nano /etc/apache2/mods-enabled/dir.conf
Change: DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
To: DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

Restart the PHP-FPM service:
sudo systemctl restart php7.1-fpm.service

Find the Sever Public IP

  • ip addr show eth0 | grep inet | awk ‘{ print $2; }’ | sed ‘s/\/.*$//’
  • http://your.id.add.is/

Install Mysql5.7

  • sudo apt-get update && sudo apt-get upgrade
  • sudo apt-cache search mysql | grep mysql | more
  • sudo apt-get install mysql-server5.7 php7.1-mysql

Create MySql Database

  • mysql -u root -p
  • CREATE DATABASE magento;
  • CREATE USER magento_user@localhost IDENTIFIED BY ‘password’;
  • GRANT ALL PRIVILEGES ON magento.* TO magento_user@localhost IDENTIFIED BY ‘password’;
  • FLUSH PRIVILEGES;
  • exit

Install Magento 2.0

Composer install

[Composer\Downloader\TransportException]
Invalid credentials for ‘https://repo.magento.com/packages.json’, aborting.

[Composer\Downloader\TransportException]
Invalid credentials for ‘https://repo.magento.com/archives/shopialfb/facebook-module/shopialfb-facebook-module-2.0.0.0.zip’, aborting.

Use public and private keys from here to solve this issue.
https://developer.magento.com/customer/accessKeys/list/

sudo find . -type d -exec chmod 775 {} \; && sudo find . -type f -exec chmod 664 {} \; && sudo chmod u+x bin/magento

For security, remove write permissions from these directories: ‘/var/www/html/app/etc’ {} \; && sudo chmod u+x bin/magento

find app/code lib pub/static app/etc var/generation var/di var/view_preprocessed vendor \( -type d -or -type f \) -exec chmod g-w {} \; && chmod o-rwx app/etc/env.php

Referances

  • Magento 2.2 Requirments – http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements-tech.html
  • https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-magento-on-ubuntu-14-04
  • https://www.digitalocean.com/community/questions/magento-2-1-3-on-ubuntu-16-04-1
  • https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-magento-on-ubuntu-14-04
  • https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-magento-on-ubuntu-14-04

 

20 Plus Proven Habits That Will Uncover Dark Knowledge

Hello, friends, you might be wondering what is dark knowledge? Let me tell you a short story. For the past 35 years, I never knew nor google for a person called “Gary Halbert”. I am sure that he never existed in my list of people I admire. However, a question asked in a Facebook group that I love, shifted my knowledge. Since that movement, I start researching about Garry Halbert and start adding value to my life. Also, I noticed that many successful people I follow, look into his work and learnt from him. The biggest surprise is, that few of my friends knew about him. But, I did not know him. Who blocked my rights to know about this great guy? It was a dark knowledge well hidden from me for 35 years.

Now, let us find the ways to uncover dark knowledge. It is right in front of you and you only need to learn few habits. All my mentors and people I follow highlight these habits. Yes, if you need to live a successful life you must master these habits.

List Of Ways To Uncover Dark Knowledge

  • Read books
  • Join book clubs
  • Attend seminars/workshops
  • Spend time with like minded people
  • Spend time with people who you want to be in 20 years
  • Meet new people
  • Google – (something you know) VS
  • Watch interviews
  • Tedtalks
  • Join Facebook groups
  • Ask stupid questions
  • Ask good questions
  • Listening to podcasts
  • Use Mentors/Coaches
  • Join Webinars
  • Subscribe to newsletters
  • Welcome new ideas
  • Experiment/Study new ideas
  • Use imagination
  • Enjoys quite/relax time
  • Travel to places you never been
  • Learn to learn

 

P.S. Who is Gary Halbert? He is the best copyrighter who is famous for Gary Halbert letters. I will leave you here and if you are interested you can continue the research.

Installing Magento Patch SUPEE-9767

Magento released the latest security patch SUPEE-9767 patching various security issues. It is a straight forward installation but required to cover a couple of areas. This is quick step by step guide to cover the process and links I found really helpful and made the job easy.

  • Download the SUPEE 9767 patch file match for the current Magento installation
    >> https://magento.com/tech-resources/download
  • Upload the patch file to the root
  • In command line run the following command (It should match the patch file name)
    >> sh PATCH_SUPEE-9767_CE_1.7.0.2_v1.sh
  • If the download folder is removed (Which we did as a security measure) remove the
    download folder related code from the patch file
  • If you come across any other missing files check in this repo. It might be due to
    a previous patch could not generate a new file. Add the new file and apply STEP 2
    >> https://github.com/magecomp/Magento-Pre-Patched-Files
  • Apply the template level changes to the custom template files.
  • Add the script to the magento shell folder and run it
    >> https://github.com/experius/Magento-1-Experius-Patch-Helper#magento
  • Add getBlockHtml(‘formkey’) ?> to all the template files.
  • Apply the JS file changes to the over writes
    >> https://magento.stackexchange.com/questions/177035/supee-9767-patch-ce-1-9-3-3-one-page-checkout-customer-registration-issue?noredirect=1&lq=1
  • After applying the patch successfully check the following settings before testing
  • Enable Form Key Validation On Checkout
    >> Admin > System > Configuration > Advanced > Admin > Security
  • Test Login in and out in Admin User level
  • Placed a test order enabling create account
  • Upload image from the admin area.

Five Things To Do In November 2016

Cannot believe that it is already November and this is the best month to start planning. Yes, always today is the best day to start something. It is always important to organise things and prioritise tasks and focus on them. Why not using my blog to do that. Here are the awesome five things to do in November 2016.

10X Social Media Automation

I am starting to enjoy the 10X Rule. It is quite simple. You will have to pick a something you do or you have done successfully and do it ten times. The last post I have showed you how I successfully automate posting interesting posts to all my social media accounts at peak times. It is time to apply the same concept to 10 more accounts. As we have already simplified the process it is easy to apply to any number of accounts. This is the beauty of 10x rule. It challenges you to find better solutions every time.

Project WB

I cannot tell much details about this project. However, I am so excited about this project. I should release all the information about this project by end of November.

Add Most Recent Projects To TheWebByte

This has a long waited task and also an important task. We did so many interesting web projects but we haven’t put them on our profile page. Without a good profile, it is hard to convert visitors to leads. So, this is super important.

Finish the Total Recall Book By Arnold Schwarzenegger

I started reading the life story of Arnold and this is a must read book. He achieved his dreams one by one with so many difficulties and he always find a way around to get closer to his dream no matter what the situation is. Amazing life story.

Learn how to write effective articles

This is a really important factor for a successful website or blog. Writing original content is not enough for search engine optimisation. It has to be unique, well researched so, that post should not be a common article. So, there are more involve in that. So, this one hell of a big task to find a tool and system to create great articles.

I will update the progress of my five things to do in November as I progress through. Feel free to share any tips or links related to these five things. That will be a great help.

Learn How I Automate Social Media

I got this email saying “9,755 happy Twitter users, courtesy of 3 retweets. Way to go!”, just after automated social media accounts. Updating all my social media accounts consistently by myself was not easy. Some days I over update them and other time I rarely update them. There are so many social media platforms and it is impossible to update all of them manually. Let’s make the impossible possible.

happy-twitter-users

Making the long story short, I love social media but it was really hard to update all the Facebook, twitter, Google+, LinkedIn, Instagram and Pinterest accounts simultaneously. You know how hard it is. Some days I have time and freedom to do that but most of the days I am busy with work, business and my family.

I did not want to reinvent the wheel and I did not want to spend ages to experiment and learn things. The best way to learn something fast is from someone already doing it great. There are a lot of entrepreneurs and business doing social media to pass their message to the public like no others. Guy Kawasaki is an American marketing specialist, author, and Silicon Valley venture capitalist. He shows you effective methods that help you to maximise your social media presence effectively. He has a good team and tools behind it. That is the secret. Yes, I need a good team and awesome tools to build my social media campaigns.

I have many projects and businesses that have different budget levels. I have start-ups, growing projects and well-establishes projects. So, I needed a scalable solution. Here is the solution I found. I will show you how to set it up with a zero dollar budget. Yes, zero dollar budget. You can always upgrade it based on your requirements.

All the Social Media Accounts Updated From One Place

First, I need a tool to be able to schedule all the posts and deliver them to all the major social network platforms. In that way, I can spend fifteen to thirty minutes creating all the posts and schedule them for a week or month. How awesome is that? Create a Buffer account and it will let you achieve this instantly. On top of that, Buffer can identify the most effective time to post and it will schedule the post accordingly. You have full flexibility to schedule it. This makes a big difference.

I can already see the results. I can see more views and more interaction I have never seen before in my social media accounts. Another good feature is that browser plugin that will allow you to add amazing things straight to the Buffer schedule. Once you have a Buffer account you do not have to log in to different social media accounts and post individually. I am really excited to use this. No distraction and save a lot of time you can start with zero dollars.

Finds The Best Content For You

The second problem is that some weeks I do not get enough time to produce enough posts. I need a good team to produce hand-curated content. If you can outsource it to a good team then I can save that time. It is always time or money. Quuu is the perfect solution for this. They provide hand-curated content for your social media. You can select categories and it will provide content. Quuu works perfectly with Buffer. Did I mention that you can start this with zero dollars as well? Yes, it is free to start with.

This is the perfect combination. Quuu provides perfect content for Buffer account to schedule it and post it to multiple social media accounts as your preference. You can start this with zero dollars and scale up as you grow. Do not forget to add your own content to give a personal touch.

Take Action Time

Automate social media accounts today. And it is time to make them rock. If you have any question or better suggestions share it with me.

How I build a website under 15 minutes

For the last 15 years, I am helping individuals and businesses to build many websites. However, I did not have my own website. I was thinking and dreaming about building a perfect website for myself but it did not happen. Then it took me less than 15 minutes to build it. What is the secret? I managed to stop all the negative thoughts behind it. I totally ignored what others going to think about my website and stop thinking about the choices I have. Because I know the subject, I have too many choices. I focused or taking the first step. That’s it.

Are you an employee or a business owner? It does not matter. You have unique experiences that you can share with others and log everything you learn and refer to them and refresh your memory. If you can learn something out of your website there will be many other who will benefit from that. I should have started my website six years ago. Now it is too late. Now is the perfect time to start it. Are you with me?

Great, let me show exactly what I did. So, you will not be blown away by the choices you have. Are you with me? Great, then let us start building your website without wasting any more time.

Get the domain name and the server

First thing first, invests and secure your online real estate. That is the domain name and the web server. I am not going to explain what is a domain name web server in this post because I want to minimise the distraction. Follow these 3 simple rules to get your domain name.

  1. Get a .com website
  2. Use your first or the business name only. If it is not available, add initials.
  3. Keep it short as possible.

Let me show you exactly what I did. My name is Sanjaya. So, my preferred domain name is sanjaya.com. However, it is taken. So, I added my initials so my domain name is wmsanjaya.com. Isn’t it simple? Yes, it is so simple. There is no need to go for premium domain names or keyword based domain names.

I choose Bluehost for most of my websites and I highly recommend it. It is affordable, provide a free domain name with most plans and pretty good customer support. You can choose any web hosting solution that is compatible with WordPress.

Start building your website

This is going to be really exciting and simple process. I assume that you don’t have a bluehost account. If you have a bluehost account or any hosting account you are require to create new one. You should be able to utilize them. I am selecting bluehost as it is something I always use to build a website and it has oneclick installation facilities for all the common web application. So, you are not required technical knowledge.

Create the bluehost account

  • Go to bluehost.com and click get started now
  • Select your plan. For personal websites

Template

Content and Images

I will help you!

This is the second post of this blog and If you are having any trouble trying to setup your website, I am going to provide free help. Please leave a comment or contact me. I will provide 30 minutes of my time free for you.