Blogz

Recent Blogz

Document and window click event not works in iPhone and iPad as expected

$(document).click(function (e) {}); or $(window).click(function (e) {}); will work perfectly on IE, Firefox and Chrome. But it won't work in iPhone and iPad Safari except some elements. Since by default "DIVs" are not "clickable" elements we have to makes iOS treat it as clickable. The problem is iPhones dont raise click events. They raise "touch" events. A small work around is to make the element clickable using CSS. So you need to add

Drupal 7: PopUp By Ctools Automodal Module

  • Ctools Automodal will help you to create popup in your site. It is an easiest way to create a popup without any burden. To Create a popup form please follow the below instruction:-

  • Download and install the ctools Automodal(module) in your drupal instance.

    • Description : By using this module You can create your own custom form in popup.

Drupal 7: Programatically place a Commerce Orders with sample code

In Drupal 7 using the core functions of commerce, we can place orders programmatically. Using the function "commerce_product_line_item_new()" and "commerce_line_item_save()" we can add item to cart. The function "commerce_order_save()" will place all line items into order. The below is the sample code which demonstrates.

Drupal 7: Check given user Cart have items or not

We will add the product to the cart to checkout. The below is the code which used to check current user cart have the product or not. The function "commerce_line_items_quantity()" will returns the total quantity and "commerce_line_items_total()" will return cart total. These functions are taking the order line item array. This code will return an array of product that user have been added to his/her cart.