Hack your open cart pagination library to enable AJAX calls


Open cart pagination

Okay, I just faced and solved an very interesting problem and can’t wait to share with you all.

PROBLEM: I was trying to do pagination calls by ajax as my whole project  architecture is like that. But open cart’s pagination do not by default support ajax call.

I’ll go step by step through the solution.

Pagination class returns a string what we just echo in our page. Now what is the architecture actually of that generated code?

open cart  pagination class generated code

How this code is generated?

Untitled2

You need to change the followings:

Untitled2So, can you see what is the change? I am sending a new flag “isCustomized” and changed the url.

Now you have to change in pagination.php library.Untitled3

Now write your code in classAjax()(Actually it’d callAjax) method.

Advertisements

Using colorbox(a jquery plugin) ajax in a complex situation


Colorbox is a lightweight customizable lightbox plugin for jQuery.

I am using colorbox for another perpose: to show a (semi!) modal window to show information on ajax call.

You can get the plugin here .

Here I’ll give a simple example how to load ajax data and show through colorbox plugin. In second phase i’ll try to give the scenario of the complex situation and give the solution. Though the solution looks so obvious now, i had to go through lots of other solutions (Not worthy for that situation).

Continue reading

jQuery Ajax Tooltip


This is very much based on the Coda Popup Bubble example for jQuery that’s been going around with a few important differences:

  1. The information is requested via AJAX, so you don’t have to include all of this extra information in a hidden div. This keeps your markup smaller for grids with tons of names in it.
  2. When you mouse over another name, the previous one will disappear. If you tried this with the original Coda example, you’d end up with a weird streaking animation since there’s a delay before the div is hidden.
  3. Works in IE (just turned off the fade animation)

Image

Continue reading