Chce zrobic koszyk sklepu internetowego, znalazłem darmowy skrypt ale nie umiem go "ożywić".
Czy ktoś może napisać jak się go używa ? przykladowo jak dodac coś do koszyka, jak go wyświetlić itd.
<?php /* Basket class for e-commerce purpose Version : 0.5 Type:Class Category:Shopping Carts License: GNU General Public License Description: This class provides methods for add, remove, update and remove all
items from a basket. The basket works with a session cookie, saving the product ID and quantity in an array for simple accesing it. There's an example in this category... called "Basket example using basket class" */ class basket { var $items; var $empty; function basket() { { { $this->empty=false; } else $this->empty=true; } else $this->empty=true; } function additem($id, $name, $count, $prix) { if ($this->items[$id][1] > 0 ) { $this->items[$id][1]+=$count; } else { $this->items[$id][0]=$name; $this->items[$id][1]=$count; $this->items[$id][2]=$prix; } $this->empty=false; } function removeitem($id) { $tmp=""; // Don't forget to initialize ! if(!$this->empty) { if($x!=$id) $tmp[$x]=$y; }; }; $this->items=$tmp; // Or this will have no effect ! } function resetArray($basket) { } function countItems($basket) { if(!$basket->empty) { { $ant++; } } return $ant; } function sumItems($basket) { if(!$basket->empty) { { $ant = $ant + $y[1]; } } return $ant; } function printItems($b) { if(!$b->empty) { { } } } function updateitem($id,$count){ $this->items[$id][1]=$count; } function removeall(){ $this->empty=true; } } ?> </body> </html>
z góry dziękuje. Jeśli ktoś wie gdzie można sciągnać bardziej opisowy koszyk, wraż z plikami prosze o linka.