Thursday, August 28, 2014

How to customize a plugin in wordpress

We must not customize directly into the plugin's codebase. It will problematic during version upgrade and maintenance.

Ian Dunn showed a good approach wordpress plugin customization. He gave four different ways to do so:

  • Use hooks: First we will see if there is any hooks available to modify the plugin as we need.
  • Extend without modifying: We will write a separate plugin that runs along side the main plugin that we are customizing.
  • Adding custom hooks: Add some custom hooks in the plugin, and then write a separate plugin using the custom hook to modify the main plugin.
  • Overriding callbacks: We can replace a plugin's callbacks with our own callbacks. And in our callbacks, we will call functions of other plugins that will replace the main plugin.


  • wp_template project structure:
  • -- project
  • ----wp-admin
  • ----wp-content
  • --------cache
  • --------mu-plugins
  • -------------folder_containing_custom_must_use_plugin
  • --------plugins
  • --------themes
  • --------uploads
  • ----wp-includes




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Saturday, July 5, 2014

Pagination for data on multiple tables in Codeigniter

Codeigniter comes with a great pagination library. Here, you just need to define the start and limit number.But if you have data over multiple tables and you have know way to join those tables. Then how would be the scenario?

You can get the total data into an array. Then slice your array according to your pagination limit.
foreach ($group_all as $group) {
    $data_form_model[$a] = $this->admin_model->all_number_model($group->group_name);
    $data_form_model_group_name[$a] = $group->group_name;
    $a++;
}

$final_array = array();
foreach ($data_form_model as $val) {
    foreach ($val as $val2) {
        $final_array[] = $val2;
    }
}

$config = array();
$config["base_url"] = base_url() . "admin/all_number/";
$config["total_rows"] = count($final_array);
$config["per_page"] = 10;
$config["uri_segment"] = 3;
$config['num_links'] = 3;

$config['full_tag_open'] = '
    '; $config['full_tag_close'] = '
'; $config['first_link'] = '«'; $config['first_tag_open'] = ''; $config['last_link'] = '»'; $config['last_tag_open'] = ''; $config['next_link'] = '→'; $config['next_tag_open'] = ''; $config['prev_link'] = '←'; $config['prev_tag_open'] = ''; $config['cur_tag_open'] = '
  • '; $config['cur_tag_close'] = '
  • '; $config['num_tag_open'] = '
  • '; $config['num_tag_close'] = '
  • '; $this->pagination->initialize($config); $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0; $data_form_model = array_slice($final_array, $page , $config["per_page"]); $data["links"] = $this->pagination->create_links();




    List of my works:

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    Sunday, June 29, 2014

    Session in RESTful API

    REST web service is stateless. We need to transfer the state between calls. Hence, we couldn't store state of an entity on server side using sessions. Rather, we need to store the state on application level.

    as it is stateless, we need to pass parameters in our requests to server and process it accordingly. User authentication/authorization is done with sessions. For authentication, we can use HTTP Basic authentication and HTTP Digest authentication. Also, there is token based authentication.




    List of my works:

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    Saturday, May 3, 2014

    How to sort a 2 dimensional Array?

    I have an array like below:
        [0] => Array
            (
                [name] => product_id
                [sort_order] => 4
            )
    
        [1] => Array
            (
                [name] => sku
                [sort_order] => 2
            )
    
        [2] => Array
            (
                [name] => model
                [sort_order] => 1
            )
    
        [3] => Array
            (
                [name] => ean
                [sort_order] => 3
            )
    
        [4] => Array
            (
                [name] => jan
                [sort_order] => 6
            )
    
        [5] => Array
            (
                [name] => mpn
                [sort_order] => 5
            )
    

    I need to sort it on the basis of 'sort_order'. How can I do it? I have come across a solution using function usort. I can write a custom sort function to sort the array.
          usort($arr, function($a, $b) {
                        return $a["sort_order"] - $b["sort_order"];
          }
    




    List of my works:

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    Monday, March 31, 2014

    Advanced Contact Us Report

    This extension helps to see the list of queries from the contact us form in Opencart. Admin can also reply to specific queries from this admin interface.

      Features:
    • View list of all queries using the Contact Us form.
    • You can response each query from the admin panel.
    • It supports rich texts on the response message.
    • It updates the status from 'unanswered' to 'answered' when responding to a query.
    • Admin can filter queries on the basis of date range, status etc.
    • Admin can sort queries according to name, email.

    NOTE: FREE INSTALLATION SUPPORT IF NEEDED.

    * You can buy it $18 buy paying me directly on MoneyBookers.




    List of my works:

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    Friday, March 14, 2014

    OpenbKash: bKash with Opencart using API connector

    OpenbKash extension provides ways sale product and get payment through bKash worldwide. It fully uses the bKash API connector.



  • It uses the bKash API connector.

  • It provides transaction status on API response.

  • Simple, easy admin panel.

  • Standard verification of mobile number.

  • Only authorized mobile numbers can perform the transaction.

  • Highly secure.




  • Free Installation support.

    Save $10 by paying me directly through moneybookers( email me: tahsin352(at)yahoo(dot)com).




    List of my works:

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    Tuesday, January 7, 2014

    Formcaptcha - add captcha on the register page,

    Formcaptcha is an extension for Opencart to add captcha on the registration page, on the cart page for both the register section and guest checkout option.

    Opencart doesn't provide captcha to registration pages. This module adds captcha in the registration page, on the cart page for both register and guest checkout.

    • Simple, easy to use
    • Compatible with all themes
    • Multi-lingual
    • FREE INSTALLATION SUPPORT




    List of my works:

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    Monday, January 6, 2014

    Custom Field Product - add unlimited custom fields to the product form

    Custom Field Product is an extension for Opencart to add unlimited custom fields to the product form.

    You can add unlimited custom fields to the product form. Admin can add textbox, textarea, select, radio, checkbox into the form. Single admin panel interface is available for all the products. Add default value for new fields. Separate new tab for custom fields on product form. 100% compatible with any theme. Multilingual.

    • Unlimited custom products fields.
    • Multi-language supported.
    • 100% compatible with any theme.
    • Set fields required / not required.
    • Allow text field.
    • Allow file upload field.
    • Allow date field.
    • Allow date time field.
    • Allow textarea field.
    • Allow select field.
    • Allow checkbox field.
    • Allow radio field.
    • Neat layout for simple blending with custom theme.
    • Free installation if needed.
    • Set custom fields right from product form
    • Easy installation, no data loss
    • Proper documentation & guide

    FREE INSTALLATION SUPPORT.





    List of my works:

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    Opensweetcaptcha - An easy way to generate attractive captcha for your system!

    Opensweetcaptcha is an extension for attractive Sweetcaptcha implementation in Opencart.

    An easy way to generate attractive captcha for your system!

    This captcha is based on http://sweetcaptcha.com/. You need to create an account their first.

    This is a free captcha. It makes user experience easier while registering with a system.

    • Simple, easy to use
    • Compatible with all themes.
    • Multi-lingual
    • FREE INSTALLATION SUPPORT
    • Attractive outlook.
    • Remove boring feelings regarding captcha
    • It increases your conversion rates. Users will not being discouraged to complete the registration by traditional captcha systems, often too complicated and hard to read.

    FREE INSTALLATION SUPPORT.





    List of my works:

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide

    Saturday, November 30, 2013

    Fine Search v.1.0 - Improves Opencart search feature to find relevant

    Fine Search improves your opencart search and increase your product sales.

    You can easily find your relevant products on the search results.

    For instance, you have searched for ‘iphone 4S’. It will display ‘iphone 3’ on top of ‘iphone 4S’ on the result list. This is confusing. This module will bring you the appropriate search results relevant to your keyword. This will increase your sales and will satisfy your customers.

    This module supports partial word matching; like if you type keyword ‘App’, it will also bring ‘Apple’ in the search results with the proper order.

    You can even search with a minimum of a single character. If you type ‘A’, it will bring the results starting with ‘A’.

    You can control your search from the admin panel. This provides an admin interface to define the fields which will be matched against the typed keyword. You can also set the sort order from the admin panel.

    *  Easily find your relevant products on the search results.

    *  Supports partial word matching.

    *  Search with a minimum of a single character.

    *  Admin interface to define the fields to match keyword.

    *  Set the sort order from the admin panel.

    *  100% compatible with any theme.

    *  Multilingual support.

    *  Free installation if needed.

     

    You can view and download it from here





    List of my works:

    Opencart Extensions:

    1. Product Based Quantity Wise Shipping: Find it here.
    2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
    3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
    4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
    5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
    6. Formcaptcha - add captcha on the register page: Find it here.

    My Books:

    1. OpenCart 1.4 Template Design Cookbook.
    2. Joomla Mobile Development Beginners Guide