Skip to main content

Posts

Showing posts from 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, ...

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"); ...

Magento add and update customer account by programmatically

$email = $customersdata['EmailAddress']; if(!empty($email)): $customerModel = Mage::getModel("customer/customer"); $customerModel->setWebsiteId($websiteId); $customerModel->loadByEmail($email); $customerModel = $customerModel->getData(); if(empty($customerModel)){ //echo '<pre>'; print_r($customerModel->getData()); exit; $customer = Mage::getModel("customer/customer"); $customer->setWebsiteId($websiteId)             ->setStore($store)             ->setGroupId($customersdata['PriceList'])             ->setFirstname($fname)             ->setLastname($lname)             ->setSapcustomerid($customersdata['Code'])             ->setCreditlimit($customersdata['CreditLimit'])             ->setBalance($customersdata['Bala...

Create Menu by array using recursion and save array in text file

Create Menu by array using recursion and save array in text file <?php $menuItems = array (     1 => array     (         'ItemText' => 'Home',         'ItemLink' => 'index.php',         'ParentID' => null,     ),     2 => array     (         'ItemText' => 'Home Sub 1',         'ItemLink' => 'somepage.php',         'ParentID' => 1,     ),     3 => array     (         'ItemText' => 'Home Sub 2',         'ItemLink' => 'somepage2.php',         'ParentID' => 1,     ),     4 => array     (         'ItemText' => 'Contact',         'ItemLink' => 'contact.php',         'Pare...

How To get customer details when add customer by using Observer in magento.

How To get customer details when add customer by using Observer in magento. Step 1 app\code\local\Redback\SapPostback\etc\config.xml <config> <global> <modules> <Redback_SapPostback> <version>0.1.0</version> </Redback_SapPostback> </modules> <models> <redback_sappostback> <class>Redback_SapPostback_Model</class> </redback_sappostback> </models> <events> <checkout_submit_all_after> <observers> <redback_sappostback_order_observer> <type>singleton</type> <class>Redback_SapPostback_Model_Order_Observer</class> <method>accept</method> </redback_sappostback_order_observer> </observers> </checkout_submit_all_after> <customer_register_success> <observers> <redback_sappostback_customer_observer> ...

How to Add customer by using soap.

How to Add customer by using soap. 1st create SOAP User and roles <?php $proxy = new SoapClient('http://phpserver:8090/magento-projects/demo/api/soap/?wsdl'); $sessionId = $proxy->login('samrat', 'samrat123'); // Create new customer $newCustomer = array(     'firstname'  => 'samrat',     'lastname'   => 'parida',     'email'      => 'samrat.ke.parida@gmail.com',     'password'   => 'password123',     'store_id'   => 1,     'website_id' => 1, 'group_id' => 3, ); $newCustomerId = $proxy->call($sessionId, 'customer.create', array($newCustomer)); //Create new customer address $newCustomerAddress = array(     'firstname'  => 'Ajay',     'lastname'   => 'Pogul',     'country_id' => 'USA',     'region_id'  => '43',     'region'     ...