Get product attribute in phtml file

When creating custom themes in magento we are indeed to get the product attributes in the template files.In this post i am showing you how to get product attribute in phtml file

you can Access the product attribute in the .phtml file like…

<?php
$_product->getResource()->getAttribute('code')->getFrontend()->getValue($_product);
?>

Hope this helps you on how to get product attribute in phtml file

Adding new products in magento

In this post we are discussing on adding new products in magento

First log in to your admin and go to Catalog>Manage Products>Add product:

General tab

Product Name

Enter the full product name. For a simple product, there will be no way to customize the product in any way. If you have several similar products. you need to differentiate their product names: “Large boxes”, “Medium boxes” etc. If you sell the same product in different packages, you may want to include the quantity in the product name, e.g. “Large boxes, 10-pack”.

Description

Enter the long product description that is used in the detail section of the product page.

This field has some odd behaviors as it has a nl2br function that turns line endings to <br /> which can totally mess up things like table display. If you are using the WYSIWYG editor, you will probably edit the code to remove nl2br which will force re-edit of all your existing descriptions to use proper HTML for display.

Short Description

Enter the short product description that is used on the catalog page in list view, and as the Quick Overview on the product page.

SKU

In the SKU field (http://en.wikipedia.org/wiki/Stock_Keeping_Unit), enter the unique SKU for this product.

Weight

The Weight field is mandatory. If you don’t know the weight for this product, just enter 1.

Manufacturer

The manufacturer attribute is a drop-down selector.

You need to go into attribute management, pull up the Manufacturer attribute and add values to the list so the drop-down will be populated.

It’s done this way so you don’t end up with “tag spew”, that unenviable property of user produced tag clouds where you have a properly spelled manufacturer name surrounded by every possible misspelling and anyone trying to do a search on that attribute never gets a full search result because the one item they want to find is in one of the misspelled tag collections.

Status

Set the Status field to Enabled to ensure that the product is visible in the catalog. If a product runs out of stock, it will be assigned an Out-of-stock status until stock has been replenished. Use the Disabled status before introducing a new product, or after you’ve phased it out.

URL key

The URL key will be used in links to this product, if you’re not happy with just the product name. When sites are ranked in search results, it is considered an advantage to have as many keywords as possible in the URL. If your product is called “Large boxes”, you may want to set this field to “large-handmade-designer-boxes” to include two additional keywords in the link.

Visibility

The Visibility setting determines whether a visitor can find this product by browsing the catalog, by searching for the product, or both.

Click on “Save And Continue Edit”. Note that the product is not visible in the catalog until it has been assigned to at least one website and category.

Prices tab

Enter your ordinary selling price for the product.

You may also enter your cost for purchasing the product.

Assign the correct Tax Class.

Use the Tier Price list to specify volume discounts.

Use the Special Price setting for campaigns. The Special Price is insensitive to volume and is used within the dates set by Special Price From Date and Special Price To Date. The Promotions tab in the Admin tool provides additional, more advanced price management options.

Meta information tab

The Page Title is by default set to the name of the product. You may want to extend this to aid the user or a search engine, e.g. for a product called “Large boxes” you may want to use a title like “Large handmade designer boxes for bowling balls”.

The Meta Keywords and Meta Description are by default set to the site defaults, making them useless. You should at least copy the first 255 characters of the unique Description field for each product to its Meta Description field, since this helps search engines display a summary of the contents on the page. Many experts on search engine optimization consider Meta Keywords a thing of the past, and not worth a major effort. If you want to provide Meta Keywords, they should summarize each page by its most important keywords, separated by commas, e.g. “handmade boxes, large boxes, bowling ball boxes”. The Meta Keywords should be unique for each page.

Images tab

Specify the location of the thumbnail image, small image and main image for this product. In the demo template, these images have the following sizes:

  • thumbnail: 50 x 50 pixels
  • small image 135 x 135 pixels
  • main image 1100 x 1100 pixels

Any images you upload will be scaled to the correct size, so you can use the same image in all three fields. However, if the template requires a particular aspect ratio, you should convert your images to this aspect ratio before you upload them, since they may become distorted otherwise.

The aspect ratio used by the demo template is 1:1, i.e. your product images should be square.

For the main image, a cute zooming feature is used on the main product page. For this feature to work properly, your product images should not be smaller than the size of the main image for the template.

Press Browse to locate and select each of the image files for this product. Press Upload Files to upload the selected files to the Magento server. Select which image to use in each situation (Thumbnail, Small image, Base image). Give each image a label, which will also be used as the Alt text for the image.

Inventory tab

Magento inventory management is largely controlled by settings on the System > Configuration > (Catalog) Inventory tab. If you set Decrease Stock When Order is Placed to Yes, Magento keeps track of inventory by automatically maintaining the Quantity in Stock for each product.

In the Qty field for the product, enter the exact current quantity in stock, or a high value if you don’t keep track of inventory (System > Configuration > (Catalog) Inventory > Decrease Stock When Order is Placed is set to No).

Use the Minimum Qty for Item’s Status to be Out of Stock setting to define when the product enters an Out of Stock status and no longer can be ordered. If you sell the same products both online and in a regular store, you may want to set a certain threshold where online orders are no longer accepted even though you still have a minimal quantity in stock.

The Minimum and Maximum Qty Allowed in Shopping Cart setting prevents customers from ordering less than a designated minimum quantity, or more than a maximum quantity.

The Qty Uses Decimals setting determines whether decimals will be used in the quantity field for the product (e.g. “3.5 yards”) or not.

Enter Notify for Quantity Below. When a stock of any product goes below this level, Magento will automatically notify you viaRSS Feed. This ability works in conjunction with the Decrease Stock When Order is Placed drop-down above, because Magento cannot notify you of a low stock unless you also enable it to keep track of stock reduction. In this field, enter the quantity level at which Magento will send a notification. Note that the default of 0 disables out-of-stock RSS notifications. In order to subscribe to the RSS feed, navigate to Catalog > Manage Products, and click the Notify Low Stock RSS link at the top of the page. You will be prompted to enter your User Name and Password. These are the same that you use to access the Magento admin panel. You will be redirected to the RSS page, where you can select which reader you would like to use for receiving this feed.

The Stock Availability setting shows you whether Magento considers the product in stock or not. If the Qty value is higher than the Minimum Qty for Item’s Status to be Out of Stock, you should ensure that Stock Availability is set to “In Stock”.

Websites tab

Select in what websites you want this product to be visible. Note that you must assign the product to one or more categories in each website before it appears in the catalog for that website.

Categories tab

Select in what categories the product will appear. Note that the settings on the Websites tab also affects the appearance of the product in each website.

Click on “Save And Continue Edit”. The product should now be visible in the stores and catalogs you have selected.

Hope this will give you an idea on adding new products in magento

Managing CMS pages in magento

Here we are discussing about how managing CMS pages in magento is done

To create a new content page:

In the Admin Panel, choose CMS > Pages

Click [Add New Page] at the top right to create a new Page. The New Page configuration page appears on the Page Information panel by default as shown below.

In the Page Information panel, enter the following information:

Page Title – Name of the page you are building. This will be reference in the browser’s title page.

URL Key – Select the unique URL key for this page. This will be part of the page URL that customers will see, visit, or link to when accessing this page. In terms of search engine optimization, it is helpful to select a keyword-rich URL Key.

Status – Select whether you wish to Publish this page or keep it Disabled. Published pages will be publicly visible on your Magento Go store.

Click Content from the left panel to edit / publish Content for this page.

Set the Content Heading to a relevant, descriptive title for this page (i.e. About Us, or About Our Company).
In the large content block, fill in the page content. You may use the Editor tools at the top to format your content, create links, add media, and more.

Click Meta Data from the left panel to input Meta Data for this page. Meta Data is descriptive information about a page that search engines may use to index your store’s pages. This content is not visible directly on your website.

In Keywords, define keywords that are relevant to this content page. It is helpful to consider keywords that potential customers may search if they were searching for your products on the Web.

In Description, write a few sentences describing the content on the page. Though it is not visible on your page itself, some search engines will list this page’s search result using the Meta Description text.
When you are finished, click [Save Page] to save and publish your new page. This is how managing CMS pages in magento