Skip to main content

Posts

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, ...

WordPress admin CRUD Operation

WordPress admin CRUD Operation //for adding testimonials post type add_action( 'init', 'testimonials' ); function testimonials() {   register_post_type( 'Testimonials',     array(       'labels' => array(         'name' => __( 'Testimonials' ),         'singular_name' => __( 'Testimonials' )       ),       'public' => true,       'has_archive' => true,  'supports' => array('title', 'editor', 'thumbnail', 'excerpt'),     )   ); } //for adding js and create ajax object function admin_scripts() {             wp_register_style('main_admin', get_bloginfo('stylesheet_directory') . '/css/main_admin.css');             wp_register_style('jquery_ui_css', get_bloginfo('stylesheet_directory') . '/css/jquery-ui.css');             wp_regi...

jQuery Form Validation

jQuery Form Validation <script> function validate() { var name= jQuery("#user_name").val(); var title= jQuery("#title").val(); var email= jQuery("#email").val(); var letters = /[A-Za-z]+$/; var emailPattern1 = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;   if(name=='')   {     jQuery('#user_name').val(''); jQuery('input[name$="user_name"]').attr('placeholder', 'Enter Your Full Name:'); jQuery('#user_name').css('border-color', 'red'); jQuery( "#user_name" ).focus(); return false;   }     else  if(!name.match(letters))   { jQuery('#user_name').val(''); jQuery('input[name$="user_name"]').attr('placeholder', 'Enter the Valid Full Name'); jQuery('#user_name').css('border-color', 'red'); jQuery( "#user_name" ).focus(); return false;   }    ...

How to add new and sale price in magento

 1. How to add new and sale price     <?php     // Get the Special Price     $specialprice = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialPrice();     // Get the Special Price FROM date    $specialPriceFromDate = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialFromDate();     // Get the Special Price TO date    $specialPriceToDate = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialToDate();      $newToDate = Mage::getModel('catalog/product')->load($_product->getId())->getNewsToDate();     // Get Current date     $today =  time();     if ($specialprice){                 if($today >= strtotime( $specialPriceFromDate) && $today <= strtotime($specialPriceToDate) || $today >= strtotime( $...

Show all category in tree structure in magento

Show all category in tree structure in magento class XmlCreateCategoryTree {     function __construct()     {             $this->createCategoryTree();     }     public function createCategoryTree()     {         echo "<ul>";        echo '<li  class="menu0"><a href="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'"  category">Home</a>';         $id = 2;         $categories = $this->getCategories($id);         if($categories[0]['name'] != ''){             $b=0;             foreach($categories as $category){                 $b++;                  echo '<li class="menu'.$b.'"><a href="'.$categ...

Slider

Slider jquery <div class="home-top">      <link rel="stylesheet" type="text/css" media="all" href="http://www.foppiez.nl/skin/frontend/default/foppiez/unibanner/css/custom.css" /> <script type="text/javascript" src="http://192.168.1.8:8090/gemz/js/marketplace/fancybox/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="http://www.foppiez.nl/skin/frontend/default/foppiez/unibanner/js/ajaxtabs.js"></script> <style type="text/css">     .bannerline{width:640px;}     .slider{width: 645px; height: 325px;; }     .slider .slide-show{width: 645px; height: 325px;; }     .slider .slide-show .slider-images{width: 645px; height: 325px;; }     .slider .tabcontent{width: 640px; height: 320px;;}     .slider .tabcontent img{width: 640px; height: 320px;} </style> <div class="slider">     <div class="slid...

How to add custom links to my account navigation menu in magento

How to add custom links to my account navigation menu in magento Step1. add xml file in modules/etc/Mymodule_Customerpage.xml <?xml version="1.0" encoding="UTF-8"?> <config>      <modules>             <Mymodule_Customerpage>                    <active>true</active>                    <codePool>community</codePool>             </Mymodule_Customerpage>      </modules> </config> Step 2: Define your module config file for all actions  like below : app\code\community\Mymodule\Customerpage\etc\config.xml <config>  <modules>  <Mymodule_Customerpage>  <version>1.0.0</version>  </Mymodule_Customerpage>  </modules>     <frontend> ...

Add Another Customer Registration form in Magento

Add Another Customer Registration form in Magento 1.\app\code\community\Esitee\Club\controllers\IndexController.php <?php class Esitee_Club_IndexController extends Mage_Core_Controller_Front_Action {     public function indexAction(){         $this->loadLayout()->renderLayout();     }         public function submitAction() {         // Check the email is exists or not         $post = $this->getRequest()->getPost();         $user = Mage::getModel("customer/customer")                 ->setWebsiteId(Mage::app()->getWebsite()->getId())                 ->loadByEmail($post["email"]);         if($user->getId() > 0) {             Mage::getSingleton('core/session')->addError("The User Exists"); ...