Tuesday, 30 April 2013

Useful Free Magento Extension


All free Magento Extension

http://www.magentocommerce.com/magento-connect/product-sold-count-9033.html

http://www.mage-shop.com/product-video-extension.html
demo url:-http://demo.mage-shop.com/blackberry-8100-pearl.html


http://www.magentocommerce.com/magento-connect/product-video-8703.html
http://www.magentocommerce.com/magento-connect/product-sold-count-9033.html
http://www.indieswebs.com/magento-product-video.html

http://www.magentocommerce.com/magento-connect/ajax-add-to-cart-2992.html

http://www.magentocommerce.com/magento-connect/vs-ajax-add-to-cart-add-to-wishlist-add-to-compare-paging-toolbar.html

http://ecommerce.aheadworks.com/free-stuff/video-module-community-edition.html

http://www.magentocommerce.com/magento-connect/search-autocomplete-and-suggest-widget-free-by-searchanise.html
http://www.magentocommerce.com/magento-connect/m-turbo-e-commerce-accelerator-6027.html

***********************manage Price format extension********************************
***********************easy tabing extension************************************
***********************Quick login extension************************************* **
***********************Free shop by brand******************* **********************
***********************customer-activation extension*********************************
***********************product out of stock subscription extension**********************

*********************best seller extension****************** ***********************

***********************exact search extension******************************

*******************advance compare extension****************** *****************

***********************login only extension****************** **********************

*********************add custom field in checkout extension****************** ********

***********************facebook like button extension****************** **************
*******************Pintrest button extension****************** *******************
***********************Customer order comment extension****************** **********
***********************Easy PDF Invoice***************************** *************

***********************Side banner extension***************************** **********

***********************Quick contact extension********************************

http://www.magentocommerce.com/magento-connect/catalog/product/view/id/16142/s/quick-contact-form-3533/

***********************Cart Dropdown extension********************************

http://www.magentocommerce.com/magento-connect/sharplogicians-cart-drop-down-3832.html

***********************Zoom image extension******************************

http://www.magentocommerce.com/magento-connect/vs-featurezoom.html

***********************Related product slider******************************

http://www.magentocommerce.com/magento-connect/catalog/product/view/id/16454/s/related-product-slider-5017/

***********************Featured product slider******************************

http://www.magentocommerce.com/magento-connect/catalog/product/view/id/16535/s/featured-products-4253/

***********************Featured product extension******************************

http://www.magentocommerce.com/magento-connect/magefeaturedproduct.html

*********************** product slider extension******************************

*********************** product slider extension******************************

*********************** facebook login******************************

*********************** Offline maintenance msg extension******************************

*************************** ****************************
*********This extension disables the default Customer registration in your Magento store.****

Upgrade mageto version to latest version:-

*************************************testimonial*********************

Paid Extension
***********************Quick login extension************************************* **

***********************Product slider extension****************** *******************

*******************************Now not Available************************************

Important Blog Link
**************forget password xml chnages****************************
http://www.magentocommerce.com/boards/viewthread/267435/

***********************Go daddy solution link******************************


How to remove decimal from price in magento


Hello Magento Developer,

To change the price from $100.00 to $100 for example.
For this, you need to edit code/core/Mage/Directory/Model/Currency.php
  • Open code/core/Mage/Directory/Model/Currency.php
  • Find the following :-
public function format($price, $options=array(), $includeContainer = true, $addBrackets = false)
{
return $this->formatPrecision($price, 2, $options, $includeContainer, $addBrackets);
}
on line no 195

change this code to:-
public function format($price, $options=array(), $includeContainer = true, $addBrackets = false)
{
return $this->formatPrecision($price, 0, $options, $includeContainer, $addBrackets);
}

0 – Denotes the digit after decimal point in price..
Now Clear the cache properly.
For Clear the Cache.
- Go to System –> Cache Management
- Refreh Cache.

Saturday, 13 April 2013

show brand on list page

<?php
    $product = Mage::getModel('catalog/product');
    $attributes = Mage::getResourceModel('eav/entity_attribute_collection')
    ->setEntityTypeFilter($product->getResource()->getTypeId())
    ->addFieldToFilter('attribute_code', 'manufacturer');
    $attribute = $attributes->getFirstItem()->setEntity($product->getResource());
    $manufacturers = $attribute->getSource()->getAllOptions(false);
?>


<ul>

  <?php foreach ($manufacturers as $manufacturer): ?>
  <?php  $bid = $manufacturer['value']; ?>
<?php /*?><li><a href="<?php echo $currentUrl ?>?manufacturer=<?php echo $manufacturer['value'] ?>"><?php echo $manufacturer['label'] ?><?php echo $manufacturer['value'] ?></a></li><?php */?>

<?php
$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToFilter('manufacturer', array('in' => array($bid)));
$products->addAttributeToSelect('*');
$products->load(); ?>

<li><?php echo $manufacturer['label'] ?>(<?php echo $products->count() ?>) </li>   
  

<ul class="brand-products">
<?php
$i = 0;
foreach($products as $_prod)
{       
    echo $_cat_name = $_prod->getCategory(); ?>
   
    <li>
    <a href="<?php echo $_prod->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_prod, 'small_image'), null, true) ?>" class="product_img_link"><img src="<?php echo $this->helper('catalog/image')->init($_prod, 'small_image')->resize(200); ?>" width="200" height="200" alt="<?php echo $this->stripTags($this->getImageLabel($_prod, 'small_image'), null, true) ?>" />
    <a href="<?php echo $_prod->getUrlPath() ?>"><?php echo $_prod->getName()?>
     <?php echo $_cat_name; ?></a>       
   <span class="price"><?php echo $_prod->getFormatedPrice()?></span>
  
   </li>  
<?php } ?>
</ul>


  <?php endforeach; ?>
</ul>



<?php /*?><select class="choose-sel" name="computer_manufacturers" id="brand_name" onchange="submit();">
  <option value="select">choose your brand</option>
  <?php foreach ($manufacturers as $manufacturer): ?>
      <option value="<?php echo $manufacturer['value'] ?>"><a href="<?php echo $currentUrl ?>?manufacturer=<?php echo $manufacturer['value'] ?>"><?php echo $manufacturer['label'] ?></a></option>
  <?php endforeach; ?>
</select><?php */?>

<?php /*?><?php
$bid = 5; // the brand / manufacturer ID


$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToFilter('manufacturer', array('in' => array($bid)));
$products->addAttributeToSelect('*');
$products->load();    
    echo $products->count() ?>

<ul class="brand-products">
<?php
$i = 0;
foreach($products as $_prod)
{       
    echo $_cat_name = $_prod->getCategory(); ?>
   
    <li>
    <a href="<?php echo $_prod->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_prod, 'small_image'), null, true) ?>" class="product_img_link"><img src="<?php echo $this->helper('catalog/image')->init($_prod, 'small_image')->resize(200); ?>" width="200" height="200" alt="<?php echo $this->stripTags($this->getImageLabel($_prod, 'small_image'), null, true) ?>" />
    <a href="<?php echo $_prod->getUrlPath() ?>"><?php echo $_prod->getName()?>
     <?php echo $_cat_name; ?></a>       
   <span class="price"><?php echo $_prod->getFormatedPrice()?></span>
  
   </li>  
<?php } ?>
</ul><?php */?>

showproduct on conditional bsae

<?php $cats = Mage::getModel('catalog/category')->load(2)->getChildrenCategories(); ?>

<ul>
  <?php foreach($cats as $category): ?>
  <?php $category_id = $category->getId() ?>
  <?php $count = Mage::getModel('catalog/category')->load($category_id)->getProductCount(); ?>
 
 
  <?php if($count > 0): ?>
 
  <li><a href="<?php echo $category->getUrl() ?>"><?php echo $category->getName() ?> </a>
    <?php $category_id = $category->getId() ?>
    (<?php echo $count = Mage::getModel('catalog/category')->load($category_id)->getProductCount(); ?>)
    <?php $catagory_model = Mage::getModel('catalog/category')->load($category_id); //where $category_id is the id of the category ?>
    <?php 
    $collection = Mage::getResourceModel('catalog/product_collection');
    $collection->addCategoryFilter($catagory_model); //category filter
    $collection->addAttributeToFilter('status',1); //only enabled product
    $collection->addAttributeToSelect(array('name','url','small_image','price','special_price','description','short_description')); //add product attribute to be fetched
    //$collection->getSelect()->order('rand()'); //uncomment to get products in random order   
    $collection->addStoreFilter();    
   
    if($count > 0)
    { ?>
    <table>
      <tr>
     
      <?php
    $z=1;
    foreach ($collection as $_product): ?>
      <td><table>
          <tr>
            <td><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product_img_link"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(200); ?>" width="200" height="200" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a></td>
          </tr>
          <tr>
            <td><a href="<?php echo $_product->getProductUrl() ?>"><?php echo $_product->getName(); ?></a></td>
          </tr>
          <tr>
          <tr>
            <td><?php $_pci = $this->htmlEscape($_product->getPrice());
    echo number_format($_pci,2); ?>
            </td>
          </tr>
          <td><?php $_splprice = $_product->getSpecialPrice(); //get Product's Special price
    if(!$_splprice==''){
    echo number_format($_splprice,2); } ?></td>
          </tr>
          <tr>
            <td><?php echo $_product->getShortDescription(); //get product's short description ?></td>
          </tr>
          <tr>
            <td><?php echo $_product->getDescription(); //get Product's Long Description ?></td>
          </tr>
          </tr>
        </table>
        <?php /*?><?php echo $_product->getId(); ?><?php */?>
        <?php //echo Mage::getBaseUrl(); ?>
        <?php if($_product->isSaleable()): ?>
        <?php /*?><p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p><?php */?>
        <p>
          <button onclick="setLocation('<?php echo Mage::getBaseUrl(); ?>checkout/cart/add?product=<?php echo $_product->getId(); ?>&qty;=1')" class="button btn-cart"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
        </p>
        <?php else: ?>
        <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
        <?php endif; ?>
      </td>
      <?php if($z%3==0){?>
      </tr>
     
      <tr>
        <?php } $z++; ?>
        <?php endforeach; ?>
      </tr>
    </table>
    <?php } else { ?>
    <table>
      <tr>
        <td><?php echo 'No products Assigned in this Category'; ?> </td>
      </tr>
    </table>
    <?php } ?>
  </li>
  <?php endif; ?>
  <?php endforeach; ?>
</ul>

show product according to category in cms page

<?php $cats = Mage::getModel('catalog/category')->load(2)->getChildrenCategories(); ?>

<ul>
<?php foreach($cats as $category): ?>
    <li><a href="<?php echo $category->getUrl() ?>"><?php echo $category->getName() ?> </a>
    <?php $category_id = $category->getId() ?>
   
    (<?php echo $count = Mage::getModel('catalog/category')->load($category_id)->getProductCount(); ?>)
   
    <?php $catagory_model = Mage::getModel('catalog/category')->load($category_id); //where $category_id is the id of the category ?>   
   
<?php 
    $collection = Mage::getResourceModel('catalog/product_collection');
    $collection->addCategoryFilter($catagory_model); //category filter
    $collection->addAttributeToFilter('status',1); //only enabled product
    $collection->addAttributeToSelect(array('name','url','small_image','price','special_price','description','short_description')); //add product attribute to be fetched
    //$collection->getSelect()->order('rand()'); //uncomment to get products in random order   
    $collection->addStoreFilter();    
   
    if($count > 0)
    { ?>
<table>
    <tr>
   
    <?php
    $z=1;
    foreach ($collection as $_product): ?>
   
    <td>
   
   
    <table>
    <tr>
    <td><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product_img_link"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(200); ?>" width="200" height="200" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a></td>
    </tr>
    <tr>
    <td><a href="<?php echo $_product->getProductUrl() ?>"><?php echo $_product->getName(); ?></a></td>
    </tr>
    <tr>
    <tr>
    <td><?php $_pci = $this->htmlEscape($_product->getPrice());
    echo number_format($_pci,2); ?>
    </td>
    </tr>
    <td><?php $_splprice = $_product->getSpecialPrice(); //get Product's Special price
    if(!$_splprice==''){
    echo number_format($_splprice,2); } ?></td>
    </tr>
    <tr>
    <td><?php echo $_product->getShortDescription(); //get product's short description ?></td>
    </tr>
    <tr>
    <td><?php echo $_product->getDescription(); //get Product's Long Description ?></td>
    </tr>
    </tr></table>
    <?php /*?><?php echo $_product->getId(); ?><?php */?>
    <?php //echo Mage::getBaseUrl(); ?>
   
    <?php if($_product->isSaleable()): ?>
   
    <?php /*?><p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p><?php */?>
   
   
    <p><button onclick="setLocation('<?php echo Mage::getBaseUrl(); ?>checkout/cart/add?product=<?php echo $_product->getId(); ?>&qty;=1')" class="button btn-cart"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
                    <?php else: ?>
                        <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
                    <?php endif; ?>
   
   
   
    <?php /*?><?php //echo $_product->getFinalPrice(); ?>
    <?php //echo $_product->getSpecialPrice(); ?>   
    <?php //echo $_product->getPrice(); ?>
    <?php //echo $this->htmlEscape($_product->getName()); ?>
    <?php echo $this->htmlEscape($_product->getPrice()); ?>
    <?php echo $this->htmlEscape($_product->getSpecialPrice()); ?>
   
   
    <?php
   
//echo $_product->getName();  // get Product's name

echo $_product->getShortDescription(); //get product's short description

echo $_product->getDescription(); //get Product's Long Description

//echo $_product->getPrice();  //get Product's Regular Price

echo $_product->getSpecialPrice(); //get Product's Special price

//echo $_product->getProductUrl(); //get Product's Url

//echo $_product->getImageUrl(); //get Product's image Url
       
    ?><?php */?>
   
    </td>
    <?php if($z%3==0){?>
    </tr>
    <tr>
      <?php } $z++; ?>
    <?php endforeach; ?>
    </tr>
</table>
       
       
        <?php } else { ?>
        <table>
    <tr><td>
   
    <?php echo 'No products Assigned in this Category'; ?>
   
    </td></tr></table>
       
        <?php } ?>
       
    </li>
<?php endforeach; ?>
</ul>


 <?php /*?>****************************************

<?php 
$product = Mage::getModel('catalog/product');
$attributes = Mage::getResourceModel('eav/entity_attribute_collection')
->setEntityTypeFilter($product->getResource()->getTypeId())
->addFieldToFilter('attribute_code', 'manufacturer');
$attribute = $attributes->getFirstItem()->setEntity($product->getResource());
$manufacturers = $attribute->getSource()->getAllOptions(false);
?>


<?php foreach ($manufacturers as $manufacturer)

{ ?>

<?php echo Mage::getBaseUrl(); ?>catalogsearch/advanced/result/?manufacturer[]=$manufacturer['value'];



<?php echo Mage::getBaseUrl(); ?>catalogsearch/advanced/result/?manufacturer[]=$manufacturer['label'];

<?php } ?>

 ****************************************

<?php


    $product = Mage::getModel('catalog/product');
    
    $attributes = Mage::getResourceModel('eav/entity_attribute_collection')
        ->setEntityTypeFilter($product->getResource()->getTypeId())
        ->addFieldToFilter('attribute_code', 'manufacturer') // This can be changed to any attribute code
        ->load(false);
    
    $attribute = $attributes->getFirstItem()->setEntity($product->getResource());
    
   
    $manufacturers = $attribute->getSource()->getAllOptions(false);
    foreach ($manufacturers as $manufacturer)
    {
    echo $manufacturer;
    }

 ?>
  ****************************************


<?php
 $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'manufacturer');

foreach ( $attribute->getSource()->getAllOptions(true, true) as $option)
{
     $attributeArray[$option['value']] = $option['label'];


    foreach($attributeArray as $key=>$val)
    {
    echo $val;
   
    } ?>
   
     ****************************************
   
    <?php
    $attribute = Mage::getModel('eav/entity_attribute')
                ->loadByCode('catalog_product', 'manufacturer');

$valuesCollection = Mage::getResourceModel('eav/entity_attribute_option_collection')
            ->setAttributeFilter($attribute->getData('attribute_id'))
            ->setStoreFilter(0, false);

$preparedManufacturers = array();           
foreach($valuesCollection as $value) {
    $preparedManufacturers[$value->getOptionId()] = $value->getValue();
}  


if (count($preparedManufacturers)) {
    echo "<h2>Manufacturers</h2><ul>";
    foreach($preparedManufacturers as $optionId => $value)
    {
        echo "<li>" . $value . " - (" . $optionId . ")</li>";
       
    }
    echo "</ul>";
}


 ?>

 ****************************************




<?php

$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'manufacturer');
foreach ( $attribute->getSource()->getAllOptions(true, true) as $option)
{
$attributeArray[$option['value']] = $option['label'];
}


$attributes = Mage::getModel('catalogsearch/advanced')->getAttributes();
$attributeArray=array();
foreach($attributes as $a)
{
if($a->getAttributeCode() == 'manufacturer')
    { ?>
    <table><tr>
    <?php foreach($a->getSource()->getAllOptions(false) as $option)
        { ?>
        <td><?php echo $attributeArray[$option['value']] = $option['label']; ?></td>
       
    <?php     } ?>
   
    </tr></table>
    <?php }
}

 ?>
 <?php */?>

  <?php /*?><?php foreach ($manufacturers as $manufacturer): ?>
    <a href="<?php echo $manufacturer->getUrl() ?>"><?php echo $this->htmlEscape($manufacturer->getManufacturer()) ?></a><br />
    <?php endforeach ?>
    </div>
    <?php if ($this->getTotal() > count($manufacturers)): ?>
    <div class="actions"><a href="<?php echo Mage::helper('aitmanufacturers')->getManufacturersUrl() ?>" title="<?php echo $this->__('Full list of Brands')?>"><?php echo $this->__('More...')?></a></div>
    <?php endif ?> <?php */?>