Wednesday 30 October 2013

Codeigniter Pagination problem to locate the current page (if using CI default Library), AJAX Pagination Calls

If you are using default CI Pagination library then it would be chances of displaying the current page active although results status is displaying correctly.

In particular, when you are using config/routes.php to rewrite the URLs.

Well, if that case, you can resolve that issue by adding the uri_segment's value while initializing the pagination as below;

PS:  First find which segment of URI carries the page value, then add the segment value (not page value coz once you provide segment value then, it will use it to pull out the page value)
// Locate the uri_segment to locate the current page value.
$pagination['uri_segment'] = 3; 
Also, if you are wondering how to find the uri_segment value, then use below code to print all uri_segments array
$segments = $this->uri->segment_array();
print_r($segments);
Please find the sample pagination code as below;
$pagination = array();
$pagination['start']  = $start+1;
$pagination['limit']  = $limit;
$pagination['per_page'] = $limit;
$pagination['ipage']  = $ipage;
$pagination['total_rows'] = $this->m_yourmodel->function_result_count($where=array()); // only pull the approved ones.
$pagination['anchor_class'] = 'class="loadAjaxPage" '; // This class is added to make a AJAX Call if you want to load the pages via AJAX
$pagination['offset']  = ($start+$limit); // This is just for the View;

$pagination['uri_segment'] = 3; // Locate the uri_segment to locate the current page value.

$this->load->library('pagination');
$this->pagination->initialize($pagination);
a$pagination['page_links'] = $this->pagination->create_links();

To Load the Page from AJAX Call
Also I have added the loadAjaxPage class name on anchor_class pagination variable to load the page from AJAX calls.
// This class is added to make a AJAX Call if you want to load the pages via 
$pagination['anchor_class'] = 'class="loadAjaxPage" ';

Friday 25 October 2013

How to configure WorldPay Payment System with WooCommerce

To configure WorldPay Payment System with WooCommerce
Please configure the WorldPay setting as per below image.

The Pay Back Response URL should the URL of the website where you want to revert/redirect back once the Payment is Successful or Failure.

Also, on that response page, you can use $_POST / $_REQUEST variables to collect the payment response data and manipulate it as per your needs.

Tuesday 1 October 2013

How to change the Folder/File permissions from Plesk Control Panel for Windows Server

To change the Folder/File permissions from Plesk Control Panel for Windows Server

For users on Plesk for Windows:
  1. Login to Plesk control panel using the URL  https://webX.3essentials.com:8443 X=10,12,14,16,18 (Refer welcome email for credentials)
  2. Click on the domain name for which you want to change the permission.
  3. Click on the File Manager icon, You will see a few folders like private,httpdocs,httpsdocs These are base folders and if you need to give permissions to any of these as a whole, you need to submit a support request.
  4. Click on the httpdocs folder.You will mostly need to set permission for the files/folders inside the httpdocs folder, which is the root folder of your domain
  5. Decide the file/folder you want to set permission,and towards the right side of that you will see a 'lock' symbol  ,Click on that
  6. You'll see a list of Group or user names (like those listed in the follow bullets) and towards the right side of that you'll see permissions for that user:
    • Administrators
    • SYSTEM
    • Plesk Domain User (number)
    • FPSE_number
    • Plesk IIS User (IUSR_number)
    • Plesk IIS WP User (IWPD_number(number))
  7. This is where you need to set permissions.
    • For php scripts add MODIFY to your IUSR account
    • For asp: add MODIFY to your IWPD account
    • For asp.net: It  will run under your IWPD account by default unless you have impersonation enabled in your web.config (which you should use if using asp.net), in which case it will impersonate the IUSR account - add MODIFY to the appropriate account.
    • For access databases(.mdb files), you might need to give write/modify permission to the file/folder depending on the scripting technology that you're using as given above.
  8. Setting up Access Permissions
    • Allow inheritable permissions from the parent to propagate to this object and all child objects. Include these with entries explicitly defined here --> This check  box will allow you to inherit the permission to child objects from the parent folder.
    • Replace permission entries on all child objects with entries shown here that apply to child objects. -> This will propagate the permission from the current folder to the child folders
  9. Click on  Advanced Options for changing the permissions to allow/deny a user.(For advanced users only)
  10. Click OK to save the change after every action.