How to set default product in cart

Sometimes you would like to have a default product show up in your customer’s cart. For example, that is a freegift product or just a product you would like to sell.
For doing that, you can use my small script bellow. Remember to put it before the closed body tag and change the ID of variant product to valid ID. You can choose auto reloading page after product has been added or redirecting it to specified page (cart page) if you want.

<script> Shopify = Shopify || {};
    Shopify.cart = {{ cart | json }};
    if(Shopify.cart !=='undefined'
      && Shopify.cart.items.length === 0){
      jQuery.post('/cart/add.js', {
        quantity: 1,
        id: 1152084600,	//put your varian id here (should valid id, if not your site will be reload with nonstop loop)
      }).always(function(data){
        //window.location.reload(); //uncomment if you want to reload page
        window.location.href="cart?backurl="+window.location.href;  //if you want redirect to cart page
      });
    }
  </script> 
</body>

Top 5 Premium Shopify themes

Now the number of themes on shopify theme store grow very fast. It brings a lot of money for these provider. In this article I list top 5 themes.
1. Responsive Theme
A Nice Responsive theme from OutofSandbox. This theme is designed for cakes, chocolates.. site. However It also nice for funuture site.
san

Demo
2. Retina Theme
Nice, brilliantly crafted theme for exceptional shops.Easy to use with many settings that help shop owner can customize easily.
retina

3. Atlantic theme
A beatiful theme with sliders, multi level menu, and flexibles.
atlantic'

Demo

4. Clean theme
A responsive theme, works all most of devices, many settings.
clean

Demo
5. Blockshop theme
Blockshop is a unique theme, with flat design. You can use this theme to sell any things.
block

Demo

How to change shopify theme slider.

This article instructs you to change slider on the home page.
1. Hide/Show slider from theme admin
Some theme have slideshow at frontpage and provide setting to change slideshow. It this article i use React theme
To manage slideshow you goto Shopify Admin -> Themes (left menu) -> Customize theme (button) -> Home Page slider (tab). From there you can disable or enable slider
When you finish click on button Publish change on top right.
2. Customize flexslider from liquild
If theme admin don’t provide enough settings to control slider you can made change directly in liquid file.
To open liquild file goto Shopify Admin > Themes (left menu) > … (button) > Edit Html/CSS (drop down)
Search for a lliquild file which contains flexslider code like this one. In React theme it is in file shopify.js.liquild

$slider.flexslider({
        animation: '{{ settings.slider_home_transition }}',
        animationSpeed: 500,
        pauseOnHover: true,
        keyboard: false,
        slideshow: {{ settings.slider_home_auto }},
        slideshowSpeed: {{ settings.slider_home_rate }},
        smoothHeight: true
});

In above code some parameters is controlled from theme admin. some is not for example
animationSpeed: Set the speed of animations, in milliseconds
You can have more control over this slider by using more parameter from here https://github.com/woothemes/FlexSlider/wiki/FlexSlider-Properties
3. Using Banner Slider
If you don’t want to change in liquild file or read flexslider property you can use Banner Slider app. You can easily customise many things from admin and update to your homepage with just one click. You can also use many type of slider (40+ sliders templates).

4 ways to give your customer gifts

4 ways to give your customer gifts

1. Buy One get One (BOGO Sales)
Buy one, get one free is a marketing technique which is used by retailers to boost their sale. This is used very effectively. For example many customers will not need a certain item but after seeing buy one, get one free deals they will decide to purchase it because they believe it is good value. This way customers end up purchasing products which they did not need or have the intention of buying in the first place
2. Buy X get Y free
There is a native “buy X get Y” sales rule in promotions. This free gift program is attractive enough for your customers to come and buy something from your store. An extends of this rule, Buy X get a free product from some category. Or buy a product from a category and get free a product from another category.
3. Buy X Items get Y free (X is number of products)
This Gift rule is set up based on shopping cart quantity. For example: if you buy 3 items, you can get a specific product as free gift. Your customers will receive a free gift as long as their purchase is more than 3 products. This rule is believed to be extremely convenient because its flexibility. Your clients will get a freebie when they buy more 3 items without considering whether what they buy are the same or not. They can buy 3 kinds of products and then get a free gift instead of buying 3 products A and then get 1 product A again which isn’t necessary for them anymore.
An extends of this rule: Buy 3 items get a free item in some category, or some brand or some type.
4. Spend more $1000, get a free gift
Aside from giving free gifts based on the quantity, you can reward gifts for customers based on the order.For example: If your customers purchase more than $1000, they can get a free gift. Customers want to get more freebie, they will have to buy more to reach the number of $1000. Even, when the customer’s need is only $900, they will try to find and buy more product to equal $1000 and get free gift. This enables your sales to increase and as a result, your revenue will significantly be improved.
An extend of this rule: Spend more $1000 get a free item in some category, or some brand or some type.

Mapping Shopify timezone with PHP timezone

You’re PHP developer and you’re developing apps for Shopify but you have trouble with Shopify Tiemzone then this post for you.
We’re Secomapp develop team and we faced above problem , then we made a mapping array from Shopify timezone to PHP timezone

public static $TIMEZONE = array (
                       "(GMT-11:00) Midway Island" => 'Pacific/Midway',
                       "(GMT-11:00) American Samoa" => 'US/Samoa',
                       "(GMT-10:00) Hawaii" => 'US/Hawaii',
                       "(GMT-09:00) Alaska" => 'US/Alaska',
                       "(GMT-08:00) Pacific Time (US & Canada)" => 'US/Pacific',
                       "(GMT-08:00) Tijuana" => 'America/Tijuana',
                       "(GMT-07:00) Arizona" => 'US/Arizona',
                       "(GMT-07:00) Mountain Time (US & Canada)" => 'US/Mountain',
                       "(GMT-07:00) Chihuahua" => 'America/Chihuahua',
                       "(GMT-07:00) Mazatlan" => 'America/Mazatlan',
                       "(GMT-06:00) Mexico City" => 'America/Mexico_City',
                       "(GMT-06:00) Monterrey" => 'America/Monterrey',
                       "(GMT-06:00) Saskatchewan" => 'Canada/Saskatchewan',
                       "(GMT-06:00) Central Time (US & Canada)" => 'US/Central',
                       "(GMT-05:00) Eastern Time (US & Canada)" => 'US/Eastern',
                       "(GMT-05:00) Indiana (East)" => 'US/East-Indiana',
                       "(GMT-05:00) Bogota" => 'America/Bogota',
                       "(GMT-05:00) Lima" => 'America/Lima',
                       "(GMT-04:30) Caracas" => 'America/Caracas',
                       "(GMT-04:00) Atlantic Time (Canada)" => 'Canada/Atlantic',
                       "(GMT-04:00) La Paz" => 'America/La_Paz',
                       "(GMT-04:00) Santiago" => 'America/Santiago',
                       "(GMT-03:30) Newfoundland" => 'Canada/Newfoundland',
                       "(GMT-03:00) Buenos Aires" => 'America/Buenos_Aires',
                       "(GMT-03:00) Greenland" => 'Greenland',
                       "(GMT-01:00) Azores" => 'Atlantic/Azores',
                       "(GMT-01:00) Cape Verde Is." => 'Atlantic/Cape_Verde',
                       "(GMT+00:00) Casablanca" => 'Africa/Casablanca',
                       "(GMT+00:00) Dublin" => 'Europe/Dublin',
                       "(GMT+00:00) Lisbon" => 'Europe/Lisbon',
                       "(GMT+00:00) London" => 'Europe/London',
                       "(GMT+00:00) Monrovia" => 'Africa/Monrovia',
                       "(GMT+01:00) Amsterdam" => 'Europe/Amsterdam',
                       "(GMT+01:00) Belgrade" => 'Europe/Belgrade',
                       "(GMT+01:00) Berlin" => 'Europe/Berlin',
                       "(GMT+01:00) Bratislava" => 'Europe/Bratislava',
                       "(GMT+01:00) Brussels" => 'Europe/Brussels',
                       "(GMT+01:00) Budapest" => 'Europe/Budapest',
                       "(GMT+01:00) Copenhagen" => 'Europe/Copenhagen',
                       "(GMT+01:00) Ljubljana" => 'Europe/Ljubljana',
                       "(GMT+01:00) Madrid" => 'Europe/Madrid',
                       "(GMT+01:00) Paris" => 'Europe/Paris',
                       "(GMT+01:00) Prague" => 'Europe/Prague',
                       "(GMT+01:00) Rome" => 'Europe/Rome',
                       "(GMT+01:00) Sarajevo" => 'Europe/Sarajevo',
                       "(GMT+01:00) Skopje" => 'Europe/Skopje',
                       "(GMT+01:00) Stockholm" => 'Europe/Stockholm',
                       "(GMT+01:00) Vienna" => 'Europe/Vienna',
                       "(GMT+01:00) Warsaw" => 'Europe/Warsaw',
                       "(GMT+01:00) Zagreb" => 'Europe/Zagreb',
                       "(GMT+02:00) Athens" => 'Europe/Athens',
                       "(GMT+02:00) Bucharest" => 'Europe/Bucharest',
                       "(GMT+02:00) Cairo" => 'Africa/Cairo',
                       "(GMT+02:00) Harare" => 'Africa/Harare',
                       "(GMT+02:00) Helsinki" => 'Europe/Helsinki',
                       "(GMT+02:00) Istanbul" => 'Europe/Istanbul',
                       "(GMT+02:00) Jerusalem" => 'Asia/Jerusalem',
                       "(GMT+02:00) Kyiv" => 'Europe/Kiev',
                       "(GMT+03:00) Minsk" => 'Europe/Minsk',
                       "(GMT+02:00) Riga" => 'Europe/Riga',
                       "(GMT+02:00) Sofia" => 'Europe/Sofia',
                       "(GMT+02:00) Tallinn" => 'Europe/Tallinn',
                       "(GMT+02:00) Vilnius" => 'Europe/Vilnius',
                       "(GMT+03:00) Baghdad" => 'Asia/Baghdad',
                       "(GMT+03:00) Kuwait" => 'Asia/Kuwait',
                       "(GMT+03:00) Nairobi" => 'Africa/Nairobi',
                       "(GMT+03:00) Riyadh" => 'Asia/Riyadh',
                       "(GMT+03:30) Tehran" => 'Asia/Tehran',
                       "(GMT+04:00) Moscow" => 'Europe/Moscow',
                       "(GMT+04:00) Baku" => 'Asia/Baku',
                       "(GMT+04:00) Volgograd" => 'Europe/Volgograd',
                       "(GMT+04:00) Muscat" => 'Asia/Muscat',
                       "(GMT+04:00) Tbilisi" => 'Asia/Tbilisi',
                       "(GMT+04:00) Yerevan" => 'Asia/Yerevan',
                       "(GMT+04:30) Kabul" => 'Asia/Kabul',
                       "(GMT+05:00) Karachi" => 'Asia/Karachi',
                       "(GMT+05:00) Tashkent" => 'Asia/Tashkent',
                       "(GMT+05:30) Kolkata" => 'Asia/Kolkata',
                       "(GMT+05:45) Kathmandu" => 'Asia/Kathmandu',
                       "(GMT+06:00) Ekaterinburg" => 'Asia/Yekaterinburg',
                       "(GMT+06:00) Almaty" => 'Asia/Almaty',
                       "(GMT+06:00) Dhaka" => 'Asia/Dhaka',
                       "(GMT+07:00) Novosibirsk" => 'Asia/Novosibirsk',
                       "(GMT+07:00) Bangkok" => 'Asia/Bangkok',
                       "(GMT+07:00) Jakarta" => 'Asia/Jakarta',
                       "(GMT+08:00) Krasnoyarsk" => 'Asia/Krasnoyarsk',
                       "(GMT+08:00) Chongqing" => 'Asia/Chongqing',
                       "(GMT+08:00) Hong Kong" => 'Asia/Hong_Kong',
                       "(GMT+08:00) Kuala Lumpur" => 'Asia/Kuala_Lumpur',
                       "(GMT+08:00) Perth" => 'Australia/Perth',
                       "(GMT+08:00) Singapore" => 'Asia/Singapore',
                       "(GMT+08:00) Taipei" => 'Asia/Taipei',
                       "(GMT+08:00) Ulaanbaatar" => 'Asia/Ulaanbaatar',
                       "(GMT+08:00) Urumqi" => 'Asia/Urumqi',
                       "(GMT+09:00) Irkutsk" => 'Asia/Irkutsk',
                       "(GMT+09:00) Seoul" => 'Asia/Seoul',
                       "(GMT+09:00) Tokyo" => 'Asia/Tokyo',
                       "(GMT+09:30) Adelaide" => 'Australia/Adelaide',
                       "(GMT+09:30) Darwin" => 'Australia/Darwin',
                       "(GMT+10:00) Yakutsk" => 'Asia/Yakutsk',
                       "(GMT+10:00) Brisbane" => 'Australia/Brisbane',
                       "(GMT+10:00) Canberra" => 'Australia/Canberra',
                       "(GMT+10:00) Guam" => 'Pacific/Guam',
                       "(GMT+10:00) Hobart" => 'Australia/Hobart',
                       "(GMT+10:00) Melbourne" => 'Australia/Melbourne',
                       "(GMT+10:00) Port Moresby" => 'Pacific/Port_Moresby',
                       "(GMT+10:00) Sydney" => 'Australia/Sydney',
                       "(GMT+11:00) Vladivostok" => 'Asia/Vladivostok',
                       "(GMT+12:00) Magadan" => 'Asia/Magadan',
                       "(GMT+12:00) Auckland" => 'Pacific/Auckland',
                       "(GMT+12:00) Fiji" => 'Pacific/Fiji' ,
                       "(GMT+07:00) Hanoi" => 'Asia/Ho_Chi_Minh',
                       "(GMT-11:00) International Date Line West"=>'Kwajalein',
                       "(GMT-06:00) Guadalajara"=>'America/Chicago',
                       "(GMT-06:00) Central America"=>'America/Chicago',
                       "(GMT-05:00) Quito"=>'EST',
                       "(GMT-03:00) Brasilia"=>'America/Araguaina',
                       "(GMT-03:00) Montevideo"=>'America/Montevideo',
                       "(GMT-04:00) Georgetown"=>'America/Araguaina',
                       "(GMT-02:00) Mid-Atlantic"=>'Atlantic/South_Georgia',
                       "(GMT+00:00) Edinburgh"=>'GMT',
                       "(GMT+00:00) UTC"=>'UTC',
                       "(GMT+01:00) Bern"=>'ECT',
                       "(GMT+01:00) West Central Africa"=>'ECT',
                       "(GMT+02:00) Pretoria"=>'Africa/Johannesburg',
                       "(GMT+04:00) St. Petersburg"=>'Europe/Moscow',
                       "(GMT+04:00) Abu Dhabi"=>'Asia/Dubai',
                       "(GMT+05:00) Islamabad"=>'PLT',
                       "(GMT+05:30) Chennai"=>'IST',
                       "(GMT+05:30) Mumbai"=>'IST',
                       "(GMT+05:30) New Delhi"=>'IST',
                       "(GMT+06:00) Astana"=>'Asia/Dacca',
                       "(GMT+05:30) Sri Jayawardenepura"=>'Asia/Colombo',
                       "(GMT+06:30) Rangoon"=>'Asia/Rangoon',
                       "(GMT+08:00) Beijing"=>'Asia/Chongqing',
                       "(GMT+09:00) Osaka"=>'Asia/Tokyo',
                       "(GMT+09:00) Sapporo"=>'Asia/Tokyo',
                       "(GMT+11:00) Solomon Is."=>'Pacific/Noumea',
                       "(GMT+11:00) New Caledonia"=>'Pacific/Noumea',
                       "(GMT+12:00) Kamchatka"=>'Pacific/Fiji',
                       "(GMT+12:00) Marshall Is."=>'Pacific/Fiji',
                       "(GMT+12:00) Wellington"=>'NST',
                       "(GMT+13:00) Nuku'alofa"=>'Pacific/Tongatapu',
                       "(GMT+13:00) Tokelau Is."=>'Pacific/Tongatapu',
                       "(GMT+12:45) Chatham Is."=>'Pacific/Tongatapu',
                       "(GMT+13:00) Samoa"=>'Pacific/Samoa'
        );

Create Sub Collection in Shopify

Shopify don’t support nested Collection, But some time you want to organize/show products in 2 or more level of categories of product. We would create a sub collection using product tag and need some more works to show data in sub category.
Define your categories and subcategories
For example you want to have this hierarchy of categories/collections
Pants
Summer
Spring
Create a collection for each top category (“Pants” this case)
Assign Product tag to each product corresponds to each sub category/collection. Use the category name (such as Summer, Spring) as product tag name.

Show sub category/collection in storefront
To show sub category in shop menu we will use Navigation. Create Navigation/Link lists for each top category that point to top collections. In think links lists we add link to each sub category. Sub category link is link with correspond product tag (using “Filter with tags” feature)

Auto switch currency base on customer location

How to make your Shopify store auto switch currency based on your customer location?
If your site is currently showing multiple currencies in a drop-down list feature by following this guide:
http://docs.shopify.com/manual/configuration/store-customization/currencies-and-translations/currencies/how-to-show-multiple-currencies
Copy and paste my piece of code bellow before the code of body tag for saving customers time and helping them easier to make decisions

<script>// <![CDATA[
  var currmap = {"BD": "BDT", "BE": "EUR", "BF": "XOF", "BG": "BGN", "BA": "BAM", "BB": "BBD", "WF": "XPF", "BL": "EUR", "BM": "BMD", "BN": "BND", "BO": "BOB", "BH": "BHD", "BI": "BIF", "BJ": "XOF", "BT": "BTN", "JM": "JMD", "BV": "NOK", "BW": "BWP", "WS": "WST", "BQ": "USD", "BR": "BRL", "BS": "BSD", "JE": "GBP", "BY": "BYR", "BZ": "BZD", "RU": "RUB", "RW": "RWF", "RS": "RSD", "TL": "USD", "RE": "EUR", "TM": "TMT", "TJ": "TJS", "RO": "RON", "TK": "NZD", "GW": "XOF", "GU": "USD", "GT": "GTQ", "GS": "GBP", "GR": "EUR", "GQ": "XAF", "GP": "EUR", "JP": "JPY", "GY": "GYD", "GG": "GBP", "GF": "EUR", "GE": "GEL", "GD": "XCD", "GB": "GBP", "GA": "XAF", "SV": "USD", "GN": "GNF", "GM": "GMD", "GL": "DKK", "GI": "GIP", "GH": "GHS", "OM": "OMR", "TN": "TND", "JO": "JOD", "HR": "HRK", "HT": "HTG", "HU": "HUF", "HK": "HKD", "HN": "HNL", "HM": "AUD", "VE": "VEF", "PR": "USD", "PS": "ILS", "PW": "USD", "PT": "EUR", "SJ": "NOK", "PY": "PYG", "IQ": "IQD", "PA": "PAB", "PF": "XPF", "PG": "PGK", "PE": "PEN", "PK": "PKR", "PH": "PHP", "PN": "NZD", "PL": "PLN", "PM": "EUR", "ZM": "ZMK", "EH": "MAD", "EE": "EUR", "EG": "EGP", "ZA": "ZAR", "EC": "USD", "IT": "EUR", "VN": "VND", "SB": "SBD", "ET": "ETB", "SO": "SOS", "ZW": "ZWL", "SA": "SAR", "ES": "EUR", "ER": "ERN", "ME": "EUR", "MD": "MDL", "MG": "MGA", "MF": "EUR", "MA": "MAD", "MC": "EUR", "UZ": "UZS", "MM": "MMK", "ML": "XOF", "MO": "MOP", "MN": "MNT", "MH": "USD", "MK": "MKD", "MU": "MUR", "MT": "EUR", "MW": "MWK", "MV": "MVR", "MQ": "EUR", "MP": "USD", "MS": "XCD", "MR": "MRO", "IM": "GBP", "UG": "UGX", "TZ": "TZS", "MY": "MYR", "MX": "MXN", "IL": "ILS", "FR": "EUR", "IO": "USD", "SH": "SHP", "FI": "EUR", "FJ": "FJD", "FK": "FKP", "FM": "USD", "FO": "DKK", "NI": "NIO", "NL": "EUR", "NO": "NOK", "NA": "NAD", "VU": "VUV", "NC": "XPF", "NE": "XOF", "NF": "AUD", "NG": "NGN", "NZ": "NZD", "NP": "NPR", "NR": "AUD", "NU": "NZD", "CK": "NZD", "XK": "EUR", "CI": "XOF", "CH": "CHF", "CO": "COP", "CN": "CNY", "CM": "XAF", "CL": "CLP", "CC": "AUD", "CA": "CAD", "CG": "XAF", "CF": "XAF", "CD": "CDF", "CZ": "CZK", "CY": "EUR", "CX": "AUD", "CR": "CRC", "CW": "ANG", "CV": "CVE", "CU": "CUP", "SZ": "SZL", "SY": "SYP", "SX": "ANG", "KG": "KGS", "KE": "KES", "SS": "SSP", "SR": "SRD", "KI": "AUD", "KH": "KHR", "KN": "XCD", "KM": "KMF", "ST": "STD", "SK": "EUR", "KR": "KRW", "SI": "EUR", "KP": "KPW", "KW": "KWD", "SN": "XOF", "SM": "EUR", "SL": "SLL", "SC": "SCR", "KZ": "KZT", "KY": "KYD", "SG": "SGD", "SE": "SEK", "SD": "SDG", "DO": "DOP", "DM": "XCD", "DJ": "DJF", "DK": "DKK", "VG": "USD", "DE": "EUR", "YE": "YER", "DZ": "DZD", "US": "USD", "UY": "UYU", "YT": "EUR", "UM": "USD", "LB": "LBP", "LC": "XCD", "LA": "LAK", "TV": "AUD", "TW": "TWD", "TT": "TTD", "TR": "TRY", "LK": "LKR", "LI": "CHF", "LV": "EUR", "TO": "TOP", "LT": "LTL", "LU": "EUR", "LR": "LRD", "LS": "LSL", "TH": "THB", "TF": "EUR", "TG": "XOF", "TD": "XAF", "TC": "USD", "LY": "LYD", "VA": "EUR", "VC": "XCD", "AE": "AED", "AD": "EUR", "AG": "XCD", "AF": "AFN", "AI": "XCD", "VI": "USD", "IS": "ISK", "IR": "IRR", "AM": "AMD", "AL": "ALL", "AO": "AOA", "AQ": "", "AS": "USD", "AR": "ARS", "AU": "AUD", "AT": "EUR", "AW": "AWG", "IN": "INR", "AX": "EUR", "AZ": "AZN", "IE": "EUR", "ID": "IDR", "UA": "UAH", "QA": "QAR", "MZ": "MZN"};
  jQuery.getJSON('http://freegeoip.net/json/', function(location) {
    if(location.country_code){
      var mycurrency = currmap[location.country_code];
      if(mycurrency){
        $("#currencies").val(mycurrency);
        $("#currencies").change();
      }
    }
  });
// ]]></script>

Remember to make sure that you added the currency supported in the theme settings so it can be changed based on the customer location, otherwise just the default currency is selected as you specified.

Grab The Attention In Every Opportunity with Shopify Promotion Popup

Promotion Popup is an awesome app that helps you increase the conversion rate, get more subcribers and get more sales. With this app you can reduce abandoned carts and promote all significant events of the store to customers
By equipping your store with such a combination of tools you’ll be able to create catchy promotions and timely inform customers about all the deals you offer. Why not make promotions visually attractive and much more effective?

Promotion Popup

Highlight features:

1. Increase customers engagement: Promote all significant events of the store to customers
2. Increases up to 200-300% your subscribers, get more customers, increase your sales
3. Create multiple popups with different conditions: New Product launching, holiday promotions, cross-sell, up-sell products popups
4. Fully customize the popups: Customize content, background, size, display of popups.

FOR YOUR CUSTOMERS:
Allow customers to view all significant events of your stores

FOR STORE OWNERS:

1. Grab customer attention by multiple popups with different conditions
2. Create and manage popups easily with various settings
3. Easy to customize popups
4. Able to choose one of many popup templates