Search blog

Sunday, November 26, 2017

>> Inventory

It is global across all the websites and stores. Either the product is IN STOCK or Not! If you need different inventories, you will have to use third party modules.

>> Fundamental Concept

A single installation of Magento can have multiple stores that share the same Admin. Multiple stores can share the same domain, be set up as subdomains of the same domain, or have entirely different domains. Stores that have the same IP address and domain, use the same security certificate, and share a single checkout process. If you want each store to have a dedicated checkout process under its own domain, each store must have a distinct IP address with a separate security certificate. Here are some examples of how URLs can be configured for multiple stores:

yourdomain.com/store1 - Each store has a different path, but shares the same domain.

yourdomain.com/store

store1.yourdomain.com - Each store has a different subdomain of the primary domain.

store2.yourdomain.com

store1.com - Each store has a dedicated domain.

store2.com

The important thing to understand is that the stores uses the same Magento code, shares the same Admin, and catalog. They can, however, have different identities, product selections, and themes.

The multi-store feature is one of the most important and powerful feature of Magento. (Multi store is also known as multi site.) It allows growing businesses to manage multiple websites and stores through one Magento installation under a single admin panel.

The primary purpose behind the Magento Store layer is the ability to sell various different products, structured within different categories to the same user base with the same checkout parameters.

Because the Magento Store Layer requires that you create a new Magento Store View you will have all of the functionality of the aforementioned, plus some additional functionality.

Magento uses the terminology of GWS (Global, Website, Store) to explain the ability to create multiple websites and stores through one installation. There is one more part called Store View that is added to each Magento installation automatically.

The three components of GWS are explained below:

Global refers to the complete installation of Magento

Website is the domain you are utilizing. Each domain or website can have multiple stores, while you can also have multiple domains on a single installation

Stores are your actual product catalogue. Multiple stores can be created on a single domain or more than one domains

And while we are at it, I think it would be wise to explain the Store Views term too. Store Views can be defined as the multiple presentation of your front-end data. Most e-Commerce stores use this feature to have stores in multiple languages.

Click on image to enlarge

The only use of Magento Store View is for multi- language or different theme design. You will typically have one Store View per language.

>> Magento Multi Store

>>> Features that CANNOT be implemented in a multi-store:

Payment Method: You will not be able to have specific payment methods for each Store

Shipping Method: You will not be able to have separate shipping methods for each Store

Products:

You cannot change the tax structures within Stores

You cannot manage a separate inventory with Stores

Configuration Settings: You will not be able to manage ANY configuration settings between Stores

>>> Features that CAN be implemented in a multi-store:

Products: You will be able to manage a completely different catalog between Store

Categories: You will be able to manage a completely different category structure for each Store

Stores are ‘children’ of websites. They are your actual product catalog. Products and Categories are managed on the store level. A root category is configured for each store. They are your actual product catalog. Products and Categories are managed on the store level.

>> Multiple Magento Websites

The primary purpose behind the Magento Website layer is the ability to change every aspect of the customer experience, including the ability to manage a completely different set of customers for each Website.

In mutli-website — From one administration you can manage a few shops.

There’s essentially nothing that you cannot do with multiple Magento Websites. From the reporting and orders to the customer base and checkout configurations, you can manage everything with different parameters. Basically Multiple Magento Website is just like Multi-site in Drupal.

>> When to use Magento Multiple Website?

If you want to sell your products in several stores and have to change one of the following criteria in these shops, then you have to go for different websites:

different price

different tax classes

different (base) currencies

different payment options

different shipping options

>> If you just create store groups, your customers will be able to log in to all shops with the same credentials whether you like it or not.

>> If you create websites, it's up to you whether your customers can log in to all shops with the same credentials.

>> Conceptual Example

Imagine that you sell electronics, software and DVDs. For that you want to create 3 websites. You would like them on separate subdomains, so we have companyname.com/electornics, companyname.com/software and companyname.com/dvds.

In companyname.com/electornics store you would like to sell mobile devices and computers, thus you create 2 separate stores for them - Mobiles and Computers. Each of them has lots of categories and subcategories, so it makes sense to create separate category tree with own root category for each. From one website your clients can switch between the stores.

Additionally, Mobile phones you you need to be available in English and Spanish and Computers in English, Spanish and French. Thus, for ‘Mobiles’ you create 2 store views and for ‘Computers’ 3 Magento store views.

The following scheme illustrates the mentioned above:

Click on image to enlarge

WARNING!!!

When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third party services (e.g. PayPal etc.). – Setting s can be found at: Store >> Config >> General >> Web

Wednesday, November 15, 2017

In some cases, you might have two PHP configuration files: one for the PHP command line and for the web server. If so, make the change in both php.ini files.

1. To Edit web server's php.ini file

Open any text editor of you choice like Gedit and Copy/Paste the following PHP code and Save the file as 'info.php' inside the Document Root folder of your Web Server. Usually the path to your Document Root should be something like '/var/www/html/'. Make sure to save your file under the 'html' folder.

<?php
phpinfo();
?>

Now access this file from a browser using the following URL: http://localhost/info.php

You should be seeing a page open as shown in the image below. The path to your 'php.ini' file will be under Loaded Configuration File. In my case the path was as follows: Loaded Configuration File/etc/php/5.6/apache2/php.ini

Click on image to enlarge

2. To Edit CLI's 'php.ini' file

Open your Terminal (CTRL+ALT+T) and enter the following command:

php --ini

You should get output as shown in the image below. Here too you should be looking for the Loaded Configuration File path. In my case it was /etc/php/5.6/cli/php.ini.

Sunday, November 12, 2017

Type juggling and type casting can be used to change a value's type. While programming, it's important to know the type of the value and use type casting or juggling to convert it to compatible types.

Type Juggling:

When PHP converts a value from one type of value to another, it is called type juggling. PHP does not require (or support) explicit type definition in variable declaration; a variable's type is determined by the context in which the variable is used. That is to say, if a string value is assigned to variable $var, $var becomes a string. If an integer value is then assigned to $var, it becomes an integer.

Type Casting:

When you explicitly set a type to change the value into another type, it is called type casting. PHP is a loosely typed language and assigns types to variables depending what is assigned to it. Variables coming from get/post and cookies etc are generally cast as strings rather than other types and there are often other times when you need to specifically cast a type in PHP as e.g. an integer.

An example of this in action is as follows, where $foo starts off as a string value and is then cast into an integer:

Email Subscription:

Support/Donate:

Drupal Association Member

eV@gabond - The Meaning

" I want to be an educated vagabond, not a vagabond out of weakness. I don't want to do anything in my life out of weakness - because I could not be anything else, that's why I am a Vagabond - that is not my way. First I want to prove to the world that I can be anything that I want to be, but still I choose to be a vagabond - out of strength. Then there is respectability even if you are a Vagabond, because respectability has nothing to do with your vocation, your profession; respectability has something to do with acting our of strength, clarity, intelligence. "