Add code

Wednesday 13 January 2016

Magento Files and Folders Structure

Learn more about the different files and folders Magento needs to operate :

This part of the Magento tutorial will provide detailed information regarding the Magento's default files and folders structure.

The files and folders included in the main directory are as follows:
  • .htaccess - contains mod_rewrite rules, which are essential for the Search Engine Friendly URLs. There you can also find standard web server and php directives that can improve your web site performance;
  • .htaccess.sample - this is a backup of the .htaccess file. If you modify .htaccess it can be used in order to get the default settings;
  • 404 (directory) - The folder stores the default 404 template and skin for Magento;
  • app (directory) - This folder contains the modules, themes, configuration and translation files. Also there are the template files for the default administrationtheme and the installation;
  • cron.php - a Cron Job should be set for this file. Executing of the file on a defined time period will ensure that the complicated Magento caching system will not affect the web site performance;
  • downloader (directory) - This is the storage of the web downloader files. They are used for the installation and upgrade of Magento through your browser;
  • favicon.ico - the default favicon for Magento. A small icon that is shown in the browser's tool bar once your web site is loaded;
  • index.php - the main index file for Magento;
  • index.php.sample - A backup of the default index file. It can be used to revert the changes in a case of a index.php modification;
  • js (directory) - Contains the pre-compiled libraries of the JavaScript code included in Magento;
  • lib (directory) - The Magento core code is located in this folder. It contains the software's PHP libraries;
  • LICENSE_AFL.txt - The Academic Free License under which the Magento software is distributed;
  • LICENSE.txt - The Open Software License under which the Magento software is distributed;
  • media (directory) - This is the storage of the Magento media files - images out of the box, generated thumbnails, uploaded products images. It is also used as a container for importing images through the mass import/export tools;
  • mage (in versions older than 1.4.2.0 this tool was called pear) - The file controls the automatic update through the downloader script and SSH It handles the update of each individual Magento module;
  • php.ini.sample - This file contains sample php directives that can be used in order to modify your PHP setup. If you want to alter the default setup edit the file and then rename it to php.ini;
  • pkginfo (directory) - Contains files with information regarding the modules upgrades' changes;
  • report (directory) - This folder contains the skin of the Magento errors reports;
  • skin (directory) - There are located the themes files - images, JavaScript files, CSS files, Flash files. Also there can be found the skin files for the installation of skins and administration templates;
  • var (directory) - Cache, sessions, database backups, data exports and cached error reports can be found in this directory;
If you want to modify an existing template or set a new one you should know that the template files are separated in 3 folders : /app/design/frontend/default/YOUR_TEMPLATE_NAME/layout/ - Contains the .xml files that define which modules should be called by the template files and loaded in defined areas on the site
  • /app/design/frontend/default/YOUR_TEMPLATE_NAME/template/ - Contains files and subfolders that structure the final output for the users using the functions located in the layout/ folder
  • /skin/frontend/default/YOUR_TEMPLATE_NAME/ - Contains the CSS, images, JavaScript and Flash files related to the template

How To Configure Magento with SSL

Find out the easiest way to setup Magento with SSL

The private SSL certificate is an important upgrade to your website. The basic function of an SSL is to encrypt all communication between the browser and the server, ensuring that all data goes through a secure (HTTPS) connection. An SSL certificate is a necessity when you want to operate an online shop and process the sensitive customers data through your software. It helps you gain your clients' trust and increase your web site's search engines rank. You can purchase a private SSL from the  
SiteGround SSL Certificate page.

To configure Magento to work with your SSL certificate, first you need to login to your admin area and go to System -> Configuration.




Next, click on the Web link under the General tab in your left menu.


On this page, you will see many options that you can configure. However, focus only on the Secure tab. In it, make sure that you've set the Use Secure URLs in Frontend and Use Secure URLs in Admin to yes. Doing this will make your Magento application work with SSL for those parts of your site.

 That's it, your Magento store is now configured to work over SSL!

How To Magento CMS Tutorial

How to create and manage pages in Magento

In order to manage your web site pages you need to navigate to the CMS section in the Magento admin area. Click on the Manage Pages link in order to proceed with the pages modification.

You can edit a page by clicking on it. The Edit Page will open the window below:


You can modify this page to your preference.

Tuesday 12 January 2016

How To Reset Admin Password in Magento

You can reset your Magento administrative password directly through the database related to your website application. You can access the database through cPanel -> phpMyAdmin tool.
Once you have opened the phpMyAdmin tool choose the corresponding database* from the dropdown menu on the left side. After that click on the SQL tab in order to be able to execute the following MySQL query:


UPDATE `admin_user` SET `password` = MD5('NEWPASSWORD') WHERE `username` = 'ADMINUSERNAME';
 
Execute the query and your new password will be set.
 
*If you are not sure exactly which database is related to your website you can find its name inside the following file:
~/app/etc/local.xml
You can open the file through cPanel -> File manager and search for the following line:
1
<dbname><![CDATA[user_magedatabase]]></dbname>
 
 

Wednesday 6 January 2016

Import Products in Magento




Learn how to import products in Magento using CSV files

It is rather inconvenient to manually add a large number of products at once to a Magento installation. Inserting products one by one will take a long time especially when you have hundreds or thousands of products.In such cases you need an automatic way to add all those products to your Magento online store. We will address all steps you need to take in order to achieve a successful import.
First, access your Magento administrator backend and go to Catalog -> Manage Categories.



Create all product categories you will need. You can do so by filling the form displayed below:
 
 

When you fill the form with all the information you like click the Save Category button.
 
 
Bear in mind that at this point you should make note of the newly created category ids. It would be best to save them in a simple text file as you will need them for the import. The category ID will be displayed upon saving the category. It is recommended to make notes as shown below
 
 
If you plan to have additional attributes for the products you are importing you will need to create those via Catalog ->Attributes ->Manage Attributes -> Add new Attribute. You can use this functionality to add all custom attributes that are not present by default in a standard Magento installation. Note also that you can add additional attributes later at the moment you are creating a sample product. It is up to you whether to create the attributes before that or at the point you are creating the first product.
The next step is to manually add a product to your Magento installation. You will later export this product and use it as a template for importing the large batch. Make sure you include all attributes you will use for the products you are going to import in the sample product. You might want to delete all default products that might be present as you will not need them and then create the new product you will use as a template for the import.
Once you create the new product and save it it will appear in the products list for your Magento store.


You are now ready to make the sample export that you will use as a template. In the Magento administrator area go to System -> Import/Export -> Dataflow - Profiles -> Export All Products. Under Profile Information -> Store choose the desired store where you will be importing the products. This should also match the store where you have previously created a sample product. Under Data Transfer drop down menu choose Local/Remote Server. Under Data Format make sure CSV / Tab Separated is selected for type and click Save Profile. Then click export all products again and click Run Profile in Popup.
  
 
This will save a file named “export_all_products.csv” under the var/export/ directory for your Magento installation. The export success screen will look like this and will specify the file name where the products were exported.
Using an FTP client download this file to your local computer. The file will include columns for each of the attributes you have defined for your products. Open it in a spreadsheet program (MS Excel, Open Office Spreadsheet) and add the products you would like to import. Make sure you are copy/pasting the corresponding attributes in the correct columns. Also here is when you will have to add the category IDs. Use the IDs from the text file you saved earlier and put the corresponding category ID for the products you are adding.
Once you have accomplished the above go back to the Magento administrator area and choose System -> Import/Export -> Dataflow - Profiles -> Import All Products. Then choose Upload file and browse for the .csv file that you have updated with the products that need to be imported. Once you have uploaded it click Import All Products again, then Run Profile, select the .csv file you have just uploaded from the drop down menu and click Run Profile in Popup. A status screen will open and the products will start importing
 

When the import completes you will get an export success message.
You can now go to the products section of the Magento administrator backend and check the imported products. They will be present there and assigned to the corresponding categories with the attributes you have added for them.
 

Magento CMS Tutorial

How to create and manage pages in Magento

In order to manage your web site pages you need to navigate to the CMS section in the Magento admin area. Click on the Manage Pages link in order to proceed with the pages modification.



 

You can edit a page by clicking on it. The Edit Page will open the window below:


 
 
You can modify this page to your preference. Static blocks is another useful option. For example, you can edit the footer block which contains the links located at the bottom of your main page:
 The Polls section allows you to create and edit polls:
Actually, magento has a fully-featured CMS system integrated in it. Browse through the pages to see the different elements you can add to your site.
 
 

Magento Payment Methods

How to configure Magento Payment methods :

Magento provides different payment methods in order to allow you to accept payments using different payment processors like Paypal, Authorize.net and many more. The clients can also pay through regular credit cards like Visa, Master Card, American Express, Discover, Switch/Solo, check/money orders and other payment solutions.
To configure you payment methods in Magento, first you need to login to your Admin area. Then, go to System -> Configuration -> Sales -> Payment Methods.


For the purpose of this tutorial we will enable the credit card payment method. This method can be configured through the Saved CC section:


Enable the method, enter its title, set the new order status, pick the supported credit cards, decide whether the credit card verification is required, define from which countries to accept payments and the range of the accepted payments.

In the Sort order field you should enter the position of this payment method compared to the other payment methods offered to the customers. That's it, you have just enabled this payment method for your customers. Since all payment methods have different configurations, we cannot explain in details how to configure each one of them. Simply follow the instructions on their specific pages and they should work.

How to manage products in magento

To manage products in magento, you need to follow these following rules:

1) Add Products in Magento
2) Add Images to Your Products
3) Manage Product Attributes


4) Manage Product Tags

How to Add Products in Magento : 

You can add products from the Magento Admin area -> Catalog -> Manage Products -> Add Product (located at the top right of the page).

 

 You need to select the product's settings (Attribute Set and Product Type) and click Continue.


On the next page you will have to fill in the product options (Name, SKU (Stock Keeping Unit), Weight, Status (Enabled/Disabled), Tax Class, etc). You can also add custom attributes to the product using the Create New Attribute button


When ready, click Save and Continue Edit to go to the next step. Here you will have to fill in the price for your product. You can also add additional price options such as Tier Price and Special Price.


Click Save and Continue Edit to go to the next screen where you will be asked to enter some description for your product.


Click Save and Continue Edit and the product will be saved. You can further customize the product from the Product Information menu on the left. In order for the product to show up on your front page, make sure you set it as In Stock from the Inventory option in the left menu.


How to Add Images to Your Products : 

Adding an image to a product in Magento is simple. All you need to do is select the product which you want to add an image to from the product list available in the Magento admin area -> Catalog -> Manage Products.
Once the product is selected, click the Images option available in the Product Information menu on the left.
Click Browse Files and locate the file on your computer which you want to use as a product image. Then click Upload Files to upload the image to your shop. Finally, label your image and choose where it should appear using the radio buttons on the right. Click Save to save your product's image.


 

How to Manage Product Attributes :

Clicking on the [Create New Attribute] button will allow you to add attributes to your products:


 Once you are ready with the attribute, click on the [Save Attribute] button. Then you can click on the [Save] button in order to store your product information. Finally, you need to assign the new product to a chosen category: 

 

How to Manage Product Tags :


By default Magento includes the option to allow customers to tag your products. When a customer tags a certain product, the tag appears as pending and must be approved before it can show up on the product page.
Let's add a tag to our product, approve it and see how it then shows up on the product page. To add a tag to a product, simply write the tag word in the Add Your Tags: field available on the product page and click Add Tags. We'll add "Great" as a tag. A confirmation message will show up saying that the tag has been accepted for moderation:


Now go to your Magento admin area -> Catalog -> Tags -> Pending Tags to view all your pending tags. In our case, there will be only one pending tag for the word "Great":

 Click it and you will be taken to a page where you can change the status of the tag. It will appear as "Pending", so le't change it to "Approved" and click Save Tag.


Now that the tag has been approved, all other customers will see it on the product page.
You can also manage tags on a per-product basis. Go to your Magento admin area -> Catalog -> Manage Products and click the product the tags of which you want to check. Then from the left menu click Product Tags and you will see all the tags for that product.

How to Install Magento Manually

Magento Installation Tutorial :







 Next, enter the database details: Database Name, User Name and User Password. You can leave the other options intact. Make sure that you place a check on the "Skip Base URL validation before next step" option. Then, click the Continue button to proceed.


At this point you should enter the personal information and the admin login details which you want to use. You can leave the Encryption Key field empty and the script will generate one for you. Once more, click the Continue button.

Finally, Write down your encryption key; it will be used by Magento to encrypt passwords, credit cards and other confidential information.

 

Your Magento installation was successfully completed. Now you can navigate to its Frontend or Backend.

Change all short_description field as empty for product in magento

Go to
Admin > catalog > products
select all products
select action as update attributes
you have to check short description checkbox with empty text there.
save.

Please select short description as not required attribute.
re-index and clear cache after remove.

How to enable template path hints in magento admin panel? (Without Extension)

1. Admin > System > Configuration
2. Switch your "Current Configuration Scope" to your store (’Main Website’ on a stock build)
3. Click on the Developer Tab (bottom left) and find the Debug area
4. Template Path Hints: Yes (also might want to add Block Names to hints)

How to Remove Add to Compare link in magento product view page?

Edit your theme's "templae/catalog/product/view/addto.phtml" file. Find and Comment the below lines.


<?php
    $_compareUrl = $this->helper('catalog/product_compare')->getAddUrl($_product);
?>
<?php if($_compareUrl) : ?>
    <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
<?php endif; ?>

How to remove the Estimate Shipping and Tax box in Magento My cart page?

Solution 1:

Edit your theme's "/layout/checkout.xml" file. Find and Comment the below lines.

<block as="shipping" name="checkout.cart.shipping" template="checkout/cart/shipping.phtml" type="checkout/cart_shipping"></block>


Solution 2:

Add new "local.xml" file under your theme's layout folder.

<layout>
   <default>
      <remove name="checkout.cart.shipping"></remove>
   </default>
</layout>

Here, You no need to search for any template or layout file. This code will do the trick. After making changes dont forget to refresh the cache. That's it. You are done.

Magento : 404 error is showing admin page

Hello, Sometimes we may get the error on admin page once done with the Magento installation. In that scenario, we have to do the following: ...