Welcome Guest, Not a member yet? Register   Sign In
How to make pagination for shopping cart ?
#1

[eluser]Mario "St.Peter" Valentino[/eluser]
Dear all,

i have little problem. i have a shopping cart list using cart class. i success to show all list items using this code

Code:
$result = "";
foreach($this->cart->contents() as $items)
{  
$result .= "<div class=\"cartcontent\">";  
$result .= " &lt;input type=\"hidden\" class=\"item-id-".$no."\"  value=\"".$items['id']."\"&gt;";
$result .= " &lt;input type=\"hidden\" class=\"qty-id-".$no."\"   value=\"".$items['qty']."\"&gt;";
$result .= " &lt;input type=\"hidden\" name=\"rowid[]\" value=\"".$items['rowid']."\"&gt;";
$result .= " <span class=\"cc01\"><img ></span>";
$result .= " <span class=\"cc02\">".$items['name']."</span>";
$result .= " <span class=\"cc03\">&lt;input type=\"text\" class=\"qty-edit\" name=\"qty[]\" value=\"".$items['qty']."\" size=\"3\" id=\"".$no."\"&gt;&lt;/span>";
$result .= " <span class=\"cc04\">Rp ".number_format($items['price'],0,",",".")."</span>";
$result .= " <span class=\"cc05\">Rp ".number_format($items['subtotal'],0,",",".")."</span>";
$result .= " <span class=\"cc06\"><div class=\"cc06link\">Hapus</div></span>";
$result .= "</div>";
  
$no++;
}

i don't know how to make pagination using this data.

please help me.


thanks
#2

[eluser]skunkbad[/eluser]
CI's pagination class will not paginate data from the CI Cart. You're going to have to come up with your own custom pagination. Just search the internet for php pagination basics, and I'm sure you will find many tutorials.




Theme © iAndrew 2016 - Forum software by © MyBB