Magento Themes and Magento Extensions

Displaying New Products in Magento with Pagination

Posted on September 13th, 2011 | Posted by admin

Just recently we ran into an issue where we wanted to display all new products added to a specific category in our Magento site with pagination. To make things more complicated, we wanted to display this by using a CMS page. The default functionality that Magento provides for new products just didn’t cut it in our case. We had to come up with something different and I am documenting it here for everyone’s benefit. This method will allow you to add new products to a Magento CMS page and pull up new products for any category you choose, or for the entire site. Whether you want to add new products to your CMS page by category or for the entire site, it’s up to you.

Adding New Products with Built in Magento Tools

First, let’s set the record straight. It is possible to display a list of new products in Magento using a default block. You can do this without any coding changes or modifications to Magento itself. This code will allow you to bring up a list of new products on one of your CMS pages. It is also possible to use this to bring new products up within a template file or on your homepage, though we are not covering that here.

1 {{block type="catalog/product_new" column_count="6" products_count="400" name="" alias="product_homepage" template="catalog/product/new.phtml"}}

The above code will bring up your 400 newest products in 6 columns. You can change thecolumn_count and products_count variable so that any number of columns or products is shown. You can display all of your newest products by changing the products_count variable to zero. OK, so this is all good, but it’s not what we want. We want to display an entire page of our new products with the pagination toolbar, and we want to display the products with a Magento CMS page. It’s quite simple to accomplish this, and here is how you can do it.

Flat tables in Magento and product collection

Posted on September 8th, 2011 | Posted by admin

You probaly know that Magento uses EAV database structure for categories, products. In some cases this solution is not the best or fastest.

I will get you here example how to speed up product collection. Magento has config option: “Use Flat Catalog Product”. In order to see this option, go to Magento admin section and click on: System -> Config -> Catalog and Frontend.

If you enable this option, you will adjust Magento to use “Flat resource” for product collection. Take a look at product collection class “Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection” you will see a method “_construct“.

Symfony2 Forms – Entity field type

Posted on September 8th, 2011 | Posted by admin

NOTE: Tested on Symfony2 Beta3. Might not work on later releases!

Symfony2 offers many prebuilt field types for using when creating forms. The one of them I found interesting is ‘EntityType’.

I had one case recently that I had to use Entity field type for creating form, but except using it in simple way like documented I wanted to use it on little more advanced way.I have table in database called statuses that have basic filelds like:

id (int11), status_name (varchar 50), status_type (varchar 20). I defined 3 basic statuses that will be used for all items I have to describe their state:

draft, live, deleted

but, also I have more statuses defined that is for other purposes.

How can I transfer my Magento store from another provider?

Posted on September 6th, 2011 | Posted by admin

If your store is currently hosted on another server, you may transfer it to us following these simple steps. If you have not yet signed up, please check out our Magento optimized hosting services.

Step 1 – Create a Database

First, you need to create a new MySQL database for your store. Log in to cPanel by following the instructions given in your Account Information email. Then click on the MySQL® Database Wizard icon. Type in a name for your new database (e.g. mystore) and click Next Step (see Figure 1). Now you need to assign a new user to your database. Type in a username and password then click Next Step. Finally, check the All Privileges checkbox and click Next Step to complete the database wizard.

You can now log out of cPanel and continue with the next step.

How to use category to show static pages

Posted on August 18th, 2011 | Posted by admin

Some days ago, I worked on a project which has many URLs linked to static content page. These URLs are shown in main menu. As you know, in main menu are categories. Normally, almost developers add these URLs directly to the phtml file. But I will show you how to do it by another way which is using category .Therefore, you can use each category for one static content page.
First of all, create a static block (instead of static page) by going to CMS > Static Blocks.
After that, going to Catalog > Manage Categories to add new category. To make the category show static block, navigate to ‘Display settings’ tab and select ‘Static block only’ in display mode drop down field.

Page 20 of 22« First...10«1819202122»