Category: Magento

  • Magento add to cart product with custom options by Ajax

    Add to Cart Add product to cart from any page of magento by Ajax get the custom option ids from admin panel by inspecting html elements // load product by id jQuery(“#buy_now”).click(function(){ var urls = ”; // radio custom options var txt = jQuery(‘.color_pro:checked’).val(); var cov = jQuery(‘.cover_pro:checked’).val(); if (txt !== ”) { jQuery(‘#pro_pop’).html(‘Loading… Please…

  • Magento collection pagination

    $pager = 1; if (isset($_GET[‘page’])) { $pager = $_GET[‘page’]; } $collection = Mage::getModel(‘customer/customer’) ->getCollection() ->setPageSize(9) ->setCurPage($pager) ->addAttributeToSelect(‘*’); /*->addFieldToFilter(‘group_id’, 4);*/ $count = Mage::getModel(‘customer/customer’)->getCollection()->getSize(); $page_num = ceil($count / 9);

  • Magento change category list and product details page template

    Create category and add Custom Layout Update catalog/product/adlist.phtml catalog/product/adview.phtml Select “Yes” in “apply to products” drop-down.