Saturday, August 18, 2012

Magento get store config


$strFbLink = Mage::getStoreConfig('banner/socialnetworking/banner_facebook_url');
$strTwLink = Mage::getStoreConfig('banner/socialnetworking/banner_twitter_url');
$strLiLink = Mage::getStoreConfig('banner/socialnetworking/banner_linkedin_url');

Tuesday, August 14, 2012

Magento display date format

<?php
                            $strReviewDate = $_review->getCreatedAt();
                            $arrReviewDate = explode(' ',$strReviewDate);
                            $intReviewDate = strtotime($arrReviewDate[0]);
                            $dtReviewDate = date('d F, Y',$intReviewDate);
                            echo " - ".$dtReviewDate;
                            ?>

Monday, August 13, 2012

How to display manufacturer attributes on product listing page in magento?

Mage::getModel('catalog/product')->load($_product->getId())->getAttributeText('manufacturer');

Thursday, August 9, 2012

magento custom add to cart link

getLayout()->createBlock('catalog/product_list')->getAddToCartUrl($_product) ?>

How to display final price on listing page in magento?

                            $_coreHelper = $this->helper('core'); 
                            $_taxHelper = $this->helper("tax"); 
                            $_finalPriceInclTax = $_taxHelper->getPrice($_product, $_product->getFinalPrice(), true); 
                            $_finalPriceFormated = $_coreHelper->currency($_finalPriceInclTax,true,false); 
                            echo $_finalPriceFormated;
                            //echo $this->getPriceHtml($_product, true) ?>

Tuesday, August 7, 2012

Magento solve enable cookies

http://ka.lpe.sh/2011/07/09/magento-cant-loginadd-items-in-chrome-and-ie/

Remove Price from Custom Options

catalog.xml


Comment following line
<reference name="content">
    <
remove name="product.clone_prices"/>
reference>

Friday, July 20, 2012

To Be implement in magento?

http://www.rapidcommerce.eu/blog/2012/05/magento-product-list-ajax-scroll/
http://bluezeal.in/ccavenue4magento/ccavenue-payment-module-for-magento
http://keertikiran.blogspot.in/2012/05/display-date-in-specified-format-in.html
product question extension....
http://www.magentocommerce.com/magento-connect/cueblocks-zoom.html
Mturbo cache management
http://www.tonecruisers.com/OurMusic.html (to create playlist)
http://www.magentocommerce.com/magento-connect/cueblocks-zoom.html
http://www.magentocommerce.com/magento-connect/gala-color-swatches-free-9787.html
http://www.uniformadvantage.com/

magento base url without index.php (relative url)?

<?php echo Mage::getStoreConfig('web/unsecure/base_url');?>

Wednesday, July 18, 2012

How to play youtube videos in magento website?

Youtube Videos

social networking links to count likes

<div class="social_share">
    <ul>
        <li>
            <iframe src="//www.facebook.com/plugins/like.php?href=<?php echo $strEncodedProductUrl; ?>&amp;send=false&amp;layout=button_count&amp;width=100&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
        </li>
        <li>
            <a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php echo $strProductUrl ?>">Tweet</a>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
        </li>
        <li>
            <!-- Place this tag in your head or just before your close body tag. -->
            <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
            <!-- Place this tag where you want the +1 button to render. -->
            <div class="g-plusone" data-href="<?php echo $strProductUrl ?>"></div>
        </li>
        <li>
            <a href="http://pinterest.com/pin/create/button/?url=<?php echo $strEncodedProductUrl; ?>&media=<?php echo $strProductImage; ?>&description=<?php echo $strProductDescription; ?>" class="pin-it-button" count-layout="horizontal">
                <img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" />
            </a>
        </li>
    </ul>
</div>

Tuesday, July 17, 2012

How to get Subtotal of current cart in magento?

$objCheckout = $this->getLayout()->createBlock('checkout/cart_sidebar');
        $intTotal = $objCheckout->getSubtotal();

Saturday, July 14, 2012

How to get attribute details from attribute in magento?

$intAttributeId = '672';
$intAttributeLabel = 'color';
$objAttributeInfo = Mage::getModel('eav/entity_attribute')->load($intAttributeId);           
$strFrontendLabel = $objAttributeInfo->getFrontendLabel();

Friday, July 13, 2012

How to display mysql query in magento?

$objCategoryProducts = Mage::getModel('catalog/category')->load($intCategoryId)->getProductCollection()->addAttributeToFilter(array(array('attribute' => 'product_status','eq' => '126'),array('attribute' => 'product_stock_status','eq' => '486')))->setPageSize(1);

//echo $objCategoryProducts->printLogQuery(true);die;

Monday, July 9, 2012

in_array example

$arrDefaultArray = Array ( [0] => 64 [1] => 66 [2] => 62 [3] => 61 [4] => 60 )
$intProductCategoryId = 66;
if(in_array($intProductCategoryId,$arrDefaultArray))
{}

How to get prarent category id from current category in magento?

$objParentCat = 20;
$objCurrCat = Mage::getModel('catalog/category')->load($objParentCat->getParentId());

How to fetch all categories of product in magento (on product details page)?

$product_model = Mage::getModel('catalog/product');
    $_product = $product_model->load($intCurrentProductId);
    $arrAllCurrentProductCategories = $product_model->getCategoryIds($_product);

How to fetch all root categories and its subcategories in magento?

Fetch Records Magento