Posts

Showing posts from August, 2014

Scroll Top

<p id="back-top"><a href="#top"><span>Back to Top</span></a></p> <!-----scroll top---include the js file if its needed> <script> jQuery(document).ready(function(){     // hide #back-top first     jQuery("#back-top").hide();     // fade in #back-top     jQuery(function () {         jQuery(window).scroll(function () {             if (jQuery(this).scrollTop() > 300) {                 jQuery('#back-top').fadeIn();             } else {                 jQuery('#back-top').fadeOut();             }     ...

Ajax Post in Cross Sell

crosssell.php ----------------------------------------------------------------------------------------------------------------------------------  <?php $buttonTitle1 = $this->__('Add to Cart'); ?>  <?php $_helper = $this->helper('catalog/output'); ?> <?php $_product = $this->getProduct(); ?> <?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrl($_product); ?> <?php $_crossSellProducts = $_product->getCrossSellProducts(); if(count($_crossSellProducts) > 0) {       echo '<style>       #product_tabs_upsell_products_tabbed{         display:block;     }         </style>'; } else {     echo '<style>       #product_tabs_upsell_products_tabbed{         display:none;  ...

Detail Page Externally

<?php require_once('app/Mage.php'); //Path to Magento umask(0); Mage::app(); $val=$_POST['name']; $val1=$_POST['name_b']; $comp=$_POST['name_c']; $wish=$_POST['name_d']; ?> <?php $productID=$val; $_product = Mage::getModel('catalog/product')->load($productID); //echo '<pre>'; //print_r($_product); ?> <?php //$_url = Mage::helper('checkout/cart')->getAddUrl($_product); //echo $_url ; ?> <?php ?> <div class="border"></div> <div style="overflow:hidden;">     <div class="pop-up-image">         <?php                     if($_product->getSmallImage()=='no_selection') { ?>     <img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>catalog/productno_selection/noimage.jpg" width=100 height=100 /> <?php      ...

To Check the Disble/Enable Category in Magento Based on the Category ID

$_category = Mage::getModel('catalog/category')->load(4871);   echo $_category->getIsActive();

Run Magento Code Externally

<?php require_once ( 'app/Mage.php' ); //Path to Magento umask(0); Mage::app(); // Now you can run ANY Magento code you want // Change 12 to the ID of the product you want to load $_product = Mage::getModel( 'catalog/product' )->load(12); echo $_product ->getName();

To Get the Value From Ajax

--------------------------------------------------------------         <div class="divButtons">                 <a data-toggle="modal" href="#windowTitleDialog" class="product_id"><span><img src="<?php echo $this->getSkinUrl('images/cart_button2.png'); ?>" alt="" title="" /></span></a>                 <?php                     $_compareUrl = Mage::helper('catalog/product_compare')->getAddUrl($_item);                     $_wishlistUrl =Mage::helper("wishlist")->getAddUrl($_item);                 ?>              ...

To Get the Hidden Input Field Value Using Jquery

 <div class="divButtons">                 <a data-toggle="modal" href="#windowTitleDialog" class="product_id">Set Window Title</a>                                 <input type="hidden" id="h_v" class="hv" name="rahul" value="<?php echo $_item->getId(); ?>">                                 </div> <script> jQuery(document).ready(function()     {         jQuery(".product_id").click(function()         {             var key=jQuery(this).parent().find(".hv").val();           ...

Script to Make a Duplicate Category

<?php require_once('app/Mage.php'); umask(0); Mage::app('admin'); error_reporting(1); set_time_limit(0); ini_set('memory_limit', '2048M'); // COPY Products From => To // 5 => 10 if(isset($_REQUEST['from'])){     $from = $_REQUEST['from'];     $to = $_REQUEST['to'];     $category = Mage::getModel('catalog/category')->load($from);         $productCollection = $category->setStoreId(1)->getProductCollection();         foreach($productCollection as $_product) {      $product = Mage::getModel('catalog/product')->load($_product->getId());          $newCategories = $origCats = $product->getCategoryIds();      if(!in_array($to, $origCats)) {      $newCategories = array_merge($origCats, array($to));      $product->setCategor...