Skip to main content

Posts

Showing posts from April, 2014

Get Google Calendar Event List in WordPress

<a href="https://console.cloud.google.com/apis/credentials">Get Your Api Credentials Here</a> <a href="https://calendar.google.com/calendar">Get your Calender ID</a> <?php include_once("wp-load.php"); function  get_calender_events() { $params = array(); /*Get current date*/ $current_date  = date('Y-m-d H:i:s'); /*Convert it to google calendar's rfc_format */ $rfc_format = date("c", strtotime($current_date)); $params[] = 'orderBy=startTime'; $params[] ='maxResults=100'; $params[] = 'timeMin='.urlencode($rfc_format); $url_param = ''; foreach($params as $param) { $url_param.= '&'.$param; } $calender_id = "calender_id"; $client_key =  "client_key"; $url = "https://www.googleapis.com/calendar/v3/calendars/".$calender_id."/events?key=".$client_key."&singleEvents=true".$url_param; $list_events = wp_remote_post($url,

Magento: Get store information

Get store data     Mage::app()->getStore();     Store Id     Mage::app()->getStore()->getStoreId();     Store code     Mage::app()->getStore()->getCode();     Website Id     Mage::app()->getStore()->getWebsiteId();     Store Name     Mage::app()->getStore()->getName();     Is Active     Mage::app()->getStore()->getIsActive();     Store Home Url     Mage::app()->getStore()->getHomeUrl();

Text Slider with animation in jquery

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script><br /> <script src="http://artifexonline.dyndns.biz:8081/projects/wp_yourrighthand/code/wp-content/themes/yourrighthand/js/jquery.bxslider.min.js" type="text/javascript"></script> <script> jQuery(document).ready(function() {      $('.testimonials-slider').bxSlider({        mode: 'fade', slideWidth: 400, minSlides: 1, maxSlides: 1, slideMargin: 100, pause: 9000, auto: false, stopAuto: false,  }); }); </script> <script src="jquery.easing.1.3.min.js"></script> <script> $(document).ready(function() {   $("#text-slidein")                     .animate({                         width:500,                         marginLeft:20                 }, 2000, function() {                    $("#text-

Magento get review view.phtml

<?php /**  * Magento  *  * NOTICE OF LICENSE  *  * This source file is subject to the Academic Free License (AFL 3.0)  * that is bundled with this package in the file LICENSE_AFL.txt.  * It is also available through the world-wide-web at this URL:  * http://opensource.org/licenses/afl-3.0.php  * If you did not receive a copy of the license and are unable to  * obtain it through the world-wide-web, please send an email  * to license@magentocommerce.com so we can send you a copy immediately.  *  * DISCLAIMER  *  * Do not edit or add to this file if you wish to upgrade Magento to newer  * versions in the future. If you wish to customize Magento for your  * needs please refer to http://www.magentocommerce.com for more information.  *  * @category    design  * @package     base_default  * @copyright   Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)  * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)  */ /*

Smarty Pagination with php mysql

Smarty Pagination with php mysql ------------------------------------------------------------- --------------------------------------------------------------  <?php  Pagination using PHP,Smarty And MySql $sql="SELECT * FROM `fieldname1` WHERE is_active='Y' ORDER BY fieldmame2"; $rs=mysql_query($sql); $num=mysql_num_rows($rs); $i=0; /*while ($row = mysql_fetch_array($rs)) { $arr1[$j] = $row; $j++; }*/ //////////////////////////////////////////// if (!(isset($pagenum))) { $pagenum = 1; } //Here we count the number of results //Edit $data to be your query $rows = $num; //This is the number of results displayed per page $page_rows = 2; //This tells us the page number of our last page $last = ceil($rows/$page_rows); //this makes sure the page number isn't below one, or more than our maximum pages if ($pagenum < 1) { $pagenum = 1; } elseif ($pagenum > $last) { $pagenum = $last; } //This sets the range to display in our query $max = 'LIMIT ' .($pagen

choosen jquery select box

choosen jquery: http://harvesthq.github.io/chosen/ ------------------------------------------------------------------------------------------------------------------- <?php // Connect to the DB $link = mysqli_connect("localhost","root","","products") or die("Error " . mysqli_error($link)); // store in the DB if(!empty($_POST['ok'])) {        // first delete the records marked for deletion. Why? Because we don't want to process them in the code below     if( !empty($_POST['delete_ids']) and is_array($_POST['delete_ids'])) {         // you can optimize below into a single query, but let's keep it simple and clear for now:         foreach($_POST['delete_ids'] as $id) {             $sql = "DELETE FROM products WHERE id=$id";             $link->query($sql);         }     }     // now, to edit the existing data, we have to select all the records in a variable.     $s

JQuery show 5 item

  <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <div class="demo"> <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> <li>6</li> <li>7</li> <li>8</li> <li>9</li> <li>10</li> <li>11</li> <li>12</li> <li>13</li> <li>14</li> <li>15</li> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> <li>6</li> <li>7</li> <li>8</li> <li>9</li> <li>10</li> <li>11</li> <li>12</li> <li>13</li> <li>14</li> <li>15</li> </ul> </div> <a class="prev">prev</a> | <a class="next">next</a>

Magneto Get all product image

<?php $_images = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages(); ?> <?php if($_images){?>               <?php $i=0; foreach($_images as $_image){ $i++; ?>         <img src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail', $_image->getFile())->resize(108,90); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel());?>" title="<?php $this->htmlEscape($_image->getLabel());?>" /><?php } ?>     <?php } ?>

Magento Get Product bY categoryid

<div class="freeProducts voucher code">     <?php     $categoryid = 10;     $category = new Mage_Catalog_Model_Category();     $category->load($categoryid);     $collection = $category->getProductCollection();     $collection->addAttributeToSelect('*');     foreach ($collection as $_product) { ?>     <a href="<?php echo $_product->getProductUrl() ?>"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(200); ?>" width="200" height="200" alt="" /></a> <a href="<?php echo $_product->getProductUrl(); ?>"><?php echo $_product->getName(); ?></a>     <?php } ?> </div>

Magento Home Page Condition

<!--Header  Start here--> <?php if ($this->getUrl('') == $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true)) ) {     $_is_home_page = true; ?> //home Page Content Here <?php }else {     $_is_home_page = false; ?> //Another Page Content Here <?php } ?> <!--Header  End here here-->

Magento product search by name

<form action="" method="post"> <input class="postcode" name="postcode" type="text" id="" placeholder="Plaatsnaam + Postcode" /> <input class="aantal" name="name" type="text" id="" placeholder="Aantal m2"/> <input type="submit" name="searchdata" value="submit" > </form> <?php function getProductIdsBySearch($searchstring, $storeId) {      $ids = array();        // Code to Search Product by $searchstring and get Product IDs      $product_collection = Mage::getResourceModel('catalog/product_collection')                   ->addAttributeToSelect('*')                   ->addAttributeToFilter('postcode', array('like' => '%'.$searchstring.'%'))  ->addAttributeToFilter('name', array('like' => '%'.$storeId.'%&

nn

http://inchoo.net/ecommerce/magento/how-to-add-custom-product-relations-in-magento/ http://fishpig.co.uk/magento/tutorials/custom-tabs-magento-product-admin/ http://connect20.magentocommerce.com/community/Anais_Accessories http://connect20.magentocommerce.com/community/CommerceStack_Recommender http://connect20.magentocommerce.com/community/Brainvire_Featured_Products http://inchoo.net/ecommerce/magento/featured-products-on-magento-frontpage/ http://connect20.magentocommerce.com/community/VS_Ajaxscrolling http://www.magentocommerce.com/magento-connect/strategery-infinitescroll.html https://github.com/Strategery-Inc/Magento-InfiniteScroll  http://www.magentocommerce.com/magento-connect/creative-layered-navigation-pro.html http://www.magentocommerce.com/magento-connect/layered-navigation-seo.html http://www.magentocommerce.com/magento-connect/view360.html