Categories
Hosting Magento

Best Magento Hosting Company

When choosing the best Magento Hosting or Magento 2 hosting to host a small/medium sized Magento store, I always try to find out which company offers customers the most value. In my opinion, there are 4 things that make up a best Magento hosting.

  • Hosting performance, including Load speed, uptime, and capability to handle concurrent requests.
  • Magento specialized tool
  • Support: Knowledge, speed, and reliability of support on hosting problems and common Magento problem
  • Pricing: Price/value, Cheap and Affordable Magento with decent power.

SiteGround

Features 1-Click Install Magento
*Free Backup tool
Magento Optimized
24/24 support
Livechat + Ticket for common Magento issues
FREE SuperCaching + CDNFree Magento theme
Price – $3.95/month

Categories
Career and Success

Why startups fail, according to their founders

Before you build a website. Before you write a business plan. Before you even tell your parents what you’re doing. Ask yourself one question: Are you solving a problem people actually have?

Beyond the idea, there are more practical reasons startups fail. Polled founders also cited a lack of sufficient capital (29%), the assembly of the wrong team for the project (23%), and superior competition (19%) as top reasons for failure.

Why startups fail

According to market research firm CB Insights 47% of all startups fail because there’s no market need for what they’re making.

Source – https://crew.co/blog/validate-solve-problems

Categories
PHP

PHP – Array Functions

Sort a numeric array having custom index values.
Suppose you are having a array like below.

<?php
	$array['ab']	=	'abc';
	$array['xy']	=	'xyz';
	$array['lm']	=	'lmn';
	
	$array['45']	=	'456';
	$array['78']	=	'789';
	$array['12']	=	'123';

//	Then you can use below solution to sort above array.

	echo '<pre>';print_r($array);
	//preserve arrays keys for later use
	$ar1	= array_keys($array);
	
	//preserve array's values for later use
	$ar2	= array_values($array);
	
	//perform sorting by value and then by key
	array_multisort($ar2, SORT_ASC, $ar1, SORT_ASC);
	
	//combine sorted values and keys arrays to new array
	$sorted_array = array_combine($ar1, $ar2);
	
	echo '<pre>';print_r($sorted_array);
?>

Output will be 
Array
(
    [12] => 123
    [45] => 456
    [78] => 789
    [ab] => abc
    [lm] => lmn
    [xy] => xyz
)
Categories
Magento

Magento Ebay Feeds

I have created a custom magento code (Magento Ebay Feeds) which can export magento products to csv and that csv can be easily imported to eBay.  My extension allows to import products, pricing, description, images and more data from your “Magento Store” to your eBay. The Extension can export simple and configurable products transforms them into eBay compatible csv format. Imported products start showing on your eBay store instantly. You need to simply import that csv to your eBay store.

This extension is similar to
Ebay2Magento – http://magegaga.com/ebay2magento.html
eBay Integration    –    https://www.magentocommerce.com/magento-connect/ebay-integration.html

Please let me know if you are looking for Amazon Integration for Magento like –    https://www.mag-manager.com/magento-amazon-integration/

Categories
PHP

Compiled vs. Interpreted Languages

What is compiler
A compiler is a computer program that transforms source code (programming language/source language) to another computer language (the target language). The most common reason for converting source code is to create an executable program.

The name “compiler” is used for programs that translate source code from a high-level programming language to a lower level language (e.g., assembly language or machine code).

Compiler v/s Interpreter

Compiled language v/s Interpreted language
A compiled language is one where you have to compile the code before it can be executed. The compilation process, for those that don’t know it, transforms the source code into object code; the later can be directly executed by the microprocessor (as it’s formed by opcodes), while the former can’t. So, more generically, a compiled language can be executed, after compilation, without any helper utility. Examples of these include C, C++ and assembler.

An interpreted language is one where you can execute the code without compilation, by means of an interpreter. An interpreter reads the code from the source file and executes it, without converting it to machine code (forget about JIT compilers for now). The way this is done depends on the specific interpreter you are using; but to get an idea, they often construct a parse tree – an in-memory representation of the code structure – from the source file and then evaluate it. Examples of these include Perl, Python, PHP, Basic and POSIX shell scripting.

Sources
https://www.quora.com/What-is-the-difference-between-compiled-and-interpreted-programming-languages

Difference between Compiler and Interpreter

Categories
Career and Success World of Inspiration

5 Lessons from The Bhagvad Gita

The Bhagvad Gita offers ample lessons in life about handling crises situations, managing people and paving the path to success.

5 lessons the Bhagvad Gita teaches you. We often run a Google search on the top industrial honchos to learn from their words of wisdom.

However, we seem to have lost touch with our own rich intellectual heritage.

Why not go back to our own roots, and learn from words of wisdom that are truly eternal?

Our great epics (religious or not), surely have quotes that stand true to the modern times, even better than ever before.

I am sure many of us must have explored or heard some great treasures hidden in ancient scripture Bhagvad Gita.

Below are a few shloks which I tried to decode.

I hope it will help entrepreneurs take away something from them.

#1. Do your karma

“KarmanyeVadhikaraste Ma PhaleshuKadachana,

Ma Karma PhalaHeturBhurmaTeySangostvaAkarmani”

Translation: Do your duty and be detached from its outcome, do not be driven by the end product, enjoy the process of getting there.

A lot has been said and heard about ‘karma’, but the true essence lies in these two simple lines.

Every entrepreneur should focus on their work i.e. karma without anticipating the result or outcome.

You should not concentrate so much on the final product and just enjoy the process of reaching there.

We get swayed by our vision and rely on its success too much.

We forget it is pivotal to enjoy the whole process rather than just hoping for something that you know is anyway uncertain.

Remember, having hopes or being optimistic is not wrong, but without actions, your path will be dreadful.

The art lies in walking the tightrope and enjoy doing it.

If the guy who walks the literal tightrope is scared or too excited, he will certainly fall.

The trick to his success is that he enjoys it while he walks in order to reach the other end successfully.

#2. Master the art of adaptation

“vasamsi jirnani yatha vihaya

navani grhnati naro ’parani

tatha sarirani vihaya jirnany

anyani samyati navani dehi”

Translation: As a man shedding worn out garments, takes other new ones, likewise, the embodied soul, casting off worn-out bodies, enters into others that are new.

It is easy to say versatility and adaptation are the keys to success. But the biggest lesson for any entrepreneur is learning to adapt to changes quickly.

Do not get stuck with your initial vision.

Learn to adapt, innovate and implore new opportunities.

Pave your journey like a traveller, who is not attached to the city he visits or the hotel he stays in but enjoys the experience of it all.

Do not be adamant; be innovative, open minded and ready to absorb experiences like a sponge.

The faster you adapt to a change, the better it is.

Remember, change is the only constant.

#3. Manage your anger

“krodhaadbhavatisammohahsammohaatsmritivibhramah ‘

smritibhramshaadbuddhinaashobuddhinaashaatpranashyati ””

Translation: From anger comes delusion; from delusion, confused memory; from confused memory the ruin of reason; from ruin of reason, man finally perishes.

It is imperative for all entrepreneurs to have control over their anger.

With anger goes away our ability to reason and we tend to become delusional.

The confusion and chaos generated by anger leads to memory loss.

The individual is moved away from his purpose and goals.

Anybody who seems to have forgotten their goals or lost their clarity of thought cannot succeed. Therefore, it is important for people to free themselves from anger.

A simple solution to this problem is focus.

Never lose your focus and never underestimate the virtue of patience.

#4. Detach yourselves

“tasmad asaktah satatam karyam karma samacara

asakto hy acaran karma param apnoti purushah”

Translation: Go on efficiently doing your duty at all times without attachment. Doing work without attachment man attains the supreme.

Inculcate the habit of being open to everything and being attached to nothing.

Attachment does give strength to work and love beyond ourselves, but it also limits us and makes our journey and growth difficult, especially if the object of our desire is taken away from us.

Too much desire can be bad, as it turns into greed.

Greed takes you away from your true calling and dream, be it to achieve, create or innovate.

Do not be super attached to your work, as it makes your journey as an entrepreneur difficult and closed.

You cannot wear binoculars and run the rat race.

You have to keep an open mind about the ever-evolving market changes, adapt to them.

Keep a close eye on your goals but do not get obsessive.

#5. Do not be misled

“dhumenavriyate vahnir yathadarso malena ca

yatholbenavrto garbhas tatha tenedam avrtam”

Translation: As fire is covered by smoke, mirror by dust and embryo by the amnion, so is knowledge covered by desire.

This simple shlok has the deepest meaning.

It is like a dissuading curse — as everything pure has a covering that can often be misleading.

For example, fire is covered with smoke, which prevents us from nearing it and if a mirror is covered in sheen, we cannot see what it is reflecting before removing the sheen.

Similarly knowledge is covered with desire that we must ignore or get rid of.

We must ignore the curtain of desire in order to imbibe knowledge that will help us grow.

This isn’t as easy as it looks but wise man is one who knows what to avoid and what to select.

Categories
Magento PHP Security

Magento : How to apply SUPEE-5344 and SUPEE-1533 from the Magento Community Edition

Urgent: Immediately install Magento critical security patches.

It is critical for you to download and install 2 previously-released security patches (SUPEE-5344 and SUPEE-1533) from the Magento Community Edition download page (https://www.magentocommerce.com/products/downloads/magento/).

1. Go to https://www.magentocommerce.com/products/downloads/magento/ and download the right version of patches.

2. Upload your files into Magento root directory. It is important to place patch files directly into Magento root directory and execute it also directly in Magento root directory.

3. Run the patches like this
# bash ./PATCH_SUPEE-1533_EE_1.12.x_v1-2015-02-10-08-19-16.sh
Checking if patch can be applied/reverted successfully…
Patch was applied/reverted successfully.

# bash ./PATCH_SUPEE-5345_CE_1.7.0.2_v1-2015-02-10-08-11-22.sh
Checking if patch can be applied/reverted successfully…
Patch was applied/reverted successfully.

4. Verify if the patch is added successfully
Test that your store is working fine. Login to admin and clear all the cache from cache management and flush other PHP opcode caches(APC/XCache/eAccelerator) if you are using, otherwise code will continue to run from caches.

Verify that your store have green SAFE status at https://shoplift.byte.nl

Please read below if you get errors while running the above bash command.

Note – While running the bash commands mentioned in step 3, if you get errors like below-:
Error! Some required system tools, that are utilized in this sh script, are not installed:
Tool(s) “patch” is(are) missed, please install it(them).
Then you need to first install patch like this

# yum install patch

4. Once you install the patch then follow the step 3.

Source

If you are using a shared hosting or don’t have ssh access to install the security patches then please follow this link – How to apply SUPEE-5344 and SUPEE-1533 without SSH

Categories
Magento PHP

Magento : How to Convert Price from Current Currency to Base Currency

If in some case you want to convert the price to base corrency in Magento then there is a very simple function available ‘currencyConvert()’ but this function is NOT WORKING in magento community 1.7 version.

<?php
$from 		= 'USD';
$to 		= 'NPR';
$price 		= 10;
$newPrice 	= Mage::helper('directory')->currencyConvert($price, $from, $to);
?>

Source

magento convert price in base currency
I tried another way to solve this. You can use the below working code to get the price in base currency.

<?php
//	Convert price to base currency from current currency
$totals 	= 	Mage::getSingleton('checkout/cart')->getQuote()->getTotals();
$subtotal 	= 	$totals["subtotal"]->getValue();
// Base Currency
$baseCurrencyCode 		= 	Mage::app()->getStore()->getBaseCurrencyCode();
// Current Currency
$currentCurrencyCode 	= 	Mage::app()->getStore()->getCurrentCurrencyCode();
if( $baseCurrencyCode != $currentCurrencyCode ){
	// Allowed currencies
	$allowedCurrencies 	= 	Mage::getModel('directory/currency')->getConfigAllowCurrencies();
	$rates 				= 	Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));
	$convertedSubtotal	=	$subtotal / $rates[$currentCurrencyCode];	
}else{
	$convertedSubtotal	=	$subtotal;
}
?>

Source

Categories
PHP

PHP : How to check Browser on Server Side using HTTP_USER_AGENT

While dealing with jQuery and JavaScript i sometime need to check the browser version and then code accordingly. The following simple php code will let you know the correct browser version 🙂

<?php	//	Added by Vaseem to check the IE Browser Version on Server Side using HTTP_USER_AGENT
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE){
	echo 'Internet explorer';
	if (stristr($_SERVER['HTTP_USER_AGENT'], "msie 10")){	//	Use msie 8, msie 9 to check if browser is IE8 or IE9
		echo 'IE 10';
	}
}elseif (preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']) || (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false)) {
	echo 'IE 11';
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== FALSE){
	echo 'Mozilla Firefox';
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE){
	echo 'Google Chrome'; 
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== FALSE){
	echo "Opera Mini"; 
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== FALSE){
	echo "Opera"; 
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== FALSE){
	echo "Safari"; 
}else{
	echo 'Something else';
}
?>
Categories
Magento

Magento : How to get Product Reviews posted during a time period

Customer reviews for your products and services always play a vital role in the success of your business. As magento have inbuilt functionality of reviews for products and when a customer write a review for product then the approved reviews will show on the product pages. If you are using service of Google Merchant Review Feeds then you need to submit the reviews posted between a specific dates. The following code snippet will be useful for you to get the magento product reviews.

How Magento Reviews are useful for growth of your business

<?php		// Added by Vaseem to get the product reviews posted during a time period
$fromDate	=	'2014-04-01 00:00:00';
$toDate		=	'2014-04-01 23:59:59';
$_reviews 	= 	Mage::getModel('review/review')
                ->getCollection()
                ->addStoreFilter(Mage::app()->getStore()->getId())
                ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
                ->addFieldToFilter('created_at', array('from'=>$fromDate, 'to'=>$toDate))
                ->setDateOrder()
                ->load();
foreach($_reviews as $review){
    $product 			= 	Mage::getModel('catalog/product')->load($review->getData('entity_pk_value'));
    $review_id			=	$review->getData('review_id');
    $created_at			=	$review->getData('created_at');
    $entity_id			=	$review->getData('entity_id');
    $entity_pk_value	=	$review->getData('entity_pk_value');
    $status_id			=	$review->getData('status_id');
    $detail_id			=	$review->getData('detail_id');
    $title				=	$review->getData('title');
    $detail				=	$review->getData('detail');
    $nickname			=	$review->getData('nickname');
    $customer_id		=	$review->getData('customer_id');
}
?>

I hope the above code will be useful for you 🙂