Skip to main content

Posts

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

How to change Group product grid view to drop down view as like configurable product in magento.

How to change Group product grid view to drop down view as like configurable product in magento. step 1: add jquery file in head.phtml ex: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> step 2: got to \app\design\frontend\default\default\template\catalog\product\view\type\grouped.phtml in grouped.phtml replace below code <script type="text/javascript">  jQuery(function(){     jQuery("#selectthemeid").change(function(e){             var param = jQuery(this).val();            // alert(param); //this is giving me my selectbox value but i want the selectbox  ID i.e (listKey="id")  jQuery('#carnage').attr('name', 'super_group['+param+']');          });  }); </script> <?php $this->setPreconfiguredValue(); ?> <?php $_product = $this->getProduct(); ?> <?php $_associatedProducts = $this->getAssociatedProducts(); ?>

How do I create an observer in Magento?

How do I create an observer in Magento? my example below uses the sales_order_place_before event which is called just before the order is saved. Step 1) Create main module xml file We need to create a file called Samrat_Observerexample.xml in app/etc/modules. <?xml version="1.0"?> <config>     <modules>         <Samrat_Observerexample>             <codePool>local</codePool>             <active>true</active>         </Samrat_Observerexample>     </modules> </config> Step 2) Create folder structure for our module We need to create the folders where our modules code will live. To do this create the following directories: mkdir app/code/local/Samrat/ mkdir app/code/local/Samrat/Observerexample/ mkdir app/code/local/Samrat/Observerexample/etc mkdir app/code/local/Samrat/Observerexample/Model Quick explaination of the module folder structure. Samrat represents the company or group, then Ob

How to Add Custom Field in the Billing and Shipping Address of Onepage Checkout in Magento

Step: – 1 Add Custom Field into Billing Address tab of the Onepage Checkout in Frontend. app\design\frontend\[Package_name]\[Theme_name]\template\checkout\onepage\billing.phtml <li class="wide"> <label for="billing:jobtitle"><?php echo $this->__('Job Title') ?></label> <div class="input-box"> <input type="text" id="billing:jobtitle" name="billing[jobtitle]" value="<?php echo $this->htmlEscape($this->getAddress()->getJobtitle()) ?>" title="<?php echo $this->__('Job Title') ?>" class="input-text" /> </div> </li> Step: – 2 Add Custom Field into Shipping Address tab of the Onepage Checkout in Frontend. app\design\frontend\[Package_name]\[Theme_name]\template\checkout\onepage\shipping.phtml <li class="wide"> <label for="shipping:jobtitle"><?php echo $this->

Add new field customer registration form in magento.

Add new field customer registration form in magento. Step 1: Create file app/etc/modules/Samrat_Customer.xml Add this code <?xml version="1.0" encoding="UTF-8"?> <config>     <modules>         <Samrat_Customer>         <codePool>local</codePool>         <active>true</active>         </Samrat_Customer>     </modules> </config> Step 2: Create files and folder app/code/local/Samrat/Customer/etc/config.xml <?xml version="1.0"?> <config>     <modules>         <Samrat_Customer>             <version>1.7.0.0</version>         </Samrat_Customer>     </modules>     <global>         <fieldsets>             <customer_account>                 <occupation><create>1</create><update>1</update></occupation>                 <jobtitle><create>1</create><up