Tuesday, 21 June 2011
Magento Single Page Checkout Extension
Display Featured Product Radomly on Magento HomePage
Create new file homepage.phtml and copy content from list.phtml to homepage.phtml, log in to your magento admin go to cms pages click home page
paste step1 to contect area. click save.
strp 1.
{{block type="catalog/product_list" category_id="93" template="catalog/product/homepage.phtml"}}
now open hopepage.phtml use the code below to randomly display 4 product at once
step 2.
<?php
$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');
if ($_productCollection->count()):
$_productCollection = $_productCollection->getItems();
shuffle($_productCollection);
$i = 0;
foreach ($_productCollection as $_product):
if ($i < 4):
// Product Data With CSS
endif;
$i++;
endforeach;
endif;
?>
Monday, 20 June 2011
Get All Products Reviews On CMS Page In Magento
Create on phtml file in catalog/product/review.phtml, Place the code below in review.phtml
{{block type="core/template" name="review" template="catalog/product/review.phtml"}}
and you are done just check it http://yoursite/review.html
$collection = Mage::getModel('catalog/product')->getCollection();
foreach ($collection as $product)
{
//var_dump($product);
$storeId = Mage::app()->getStore()->getId();
$summaryData = Mage::getModel('review/review_summary')
->setStoreId($storeId)
->load($product->getData('entity_id'));
}
Now create CMS Page in mageto backend and call it as shown below in content section of your CMS page{{block type="core/template" name="review" template="catalog/product/review.phtml"}}
and you are done just check it http://yoursite/review.html
Speedup Your Magento Site
its possible to make your magento site fast by following steps below
1. first we need to update .htaccess file on root. this code below activate Gzip compression.
## http://developer.yahoo.com/performance/rules.html#gzip
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems_
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
# Don’t compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary
# enable resulting html compression
php_flag zlib.output_compression on
2. secoundly we need to save all products and category as 'FLAT RESOURCE'
a. go to system->configration->catalog->frontend
b. Use Flat Catalog Category, Use Flat Catalog Product you will see these 2 option at the end, Select Both to Yes.
c. reindex all data from Index Management.
1. first we need to update .htaccess file on root. this code below activate Gzip compression.
## http://developer.yahoo.com/performance/rules.html#gzip
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems_
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
# Don’t compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary
# enable resulting html compression
php_flag zlib.output_compression on
2. secoundly we need to save all products and category as 'FLAT RESOURCE'
a. go to system->configration->catalog->frontend
b. Use Flat Catalog Category, Use Flat Catalog Product you will see these 2 option at the end, Select Both to Yes.
c. reindex all data from Index Management.
Display Magento Available Quantity in DropDown on list.phtml
<select name="qty">
<?php $i = 1 ?>
<?php do { ?>
<option value="<?php echo $i?>">
<?php echo $i?>
<?php $i++ ?>
</option>
<?php } while ($i <= (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty()) ?>
</select>
Or try this
Set min_sale_qty of a product in backend, go to product inventory tab and find 'Minimum Qty Allowed in Shopping Cart' put desarable quantity there, we have to do this because we have to give equal interval between quantity in dropdow.
note: path can differ according to templete
app\design\frontend\base\default\template\checkout\cart\item\default.phtml
found quantity text box in that file and replace it with code below.
<?php $min_sale_qty = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($this->getProduct())->getData('min_sale_qty');
$total_qyt = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($this->getProduct())->getQty();
?>
<select name="cart[<?php echo $_item->getId() ?>][qty]">
<?php for($i = $min_sale_qty; $i <= $total_qyt; $i = $i + $min_sale_qty)
{
?>
<option value="<?php echo $i?>">
<?php echo $i?>
</option>
<?php }?>
</select>
<?php $i = 1 ?>
<?php do { ?>
<option value="<?php echo $i?>">
<?php echo $i?>
<?php $i++ ?>
</option>
<?php } while ($i <= (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty()) ?>
</select>
Or try this
Set min_sale_qty of a product in backend, go to product inventory tab and find 'Minimum Qty Allowed in Shopping Cart' put desarable quantity there, we have to do this because we have to give equal interval between quantity in dropdow.
note: path can differ according to templete
app\design\frontend\base\default\template\checkout\cart\item\default.phtml
found quantity text box in that file and replace it with code below.
<?php $min_sale_qty = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($this->getProduct())->getData('min_sale_qty');
$total_qyt = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($this->getProduct())->getQty();
?>
<select name="cart[<?php echo $_item->getId() ?>][qty]">
<?php for($i = $min_sale_qty; $i <= $total_qyt; $i = $i + $min_sale_qty)
{
?>
<option value="<?php echo $i?>">
<?php echo $i?>
</option>
<?php }?>
</select>
Sunday, 19 June 2011
Magento Flat Table Option Of Saving Products
Magento stores product data in EAV model i.e. entity attribute value model, This make the magento site slow as in EAV model single table is divided in parts which makes data fetching slow, now in magento 'Magento ver. 1.5.0.1' we have option to save product as Flat resource.
Magento Advance Layer Navigation
Magento Extension to convert magento layerd navigation to ajax layer navigation, download it from the link below, this is free version.
Features:
1. multiple select filter with ajax layer navigation
2. SEO link .
3. Back end Configuration
4. three option to display price
Installation:
1. copy app and skin folder and paste it to you magento folder it will ask to overwrite all file select ok, it will not replace your existing file but it will create requried files for AdvLay extension.
2. remove all cache from var folder.
and you are done with it.
https://rapidshare.com/files/817619639/AdvLay.rar
Features:
1. multiple select filter with ajax layer navigation
2. SEO link .
3. Back end Configuration
4. three option to display price
Installation:
1. copy app and skin folder and paste it to you magento folder it will ask to overwrite all file select ok, it will not replace your existing file but it will create requried files for AdvLay extension.
2. remove all cache from var folder.
and you are done with it.
https://rapidshare.com/files/817619639/AdvLay.rar
Subscribe to:
Posts (Atom)
