sandbudd Posted October 24, 2008 Share Posted October 24, 2008 Hey guys do you know if I can just use the shopping cart for oscommerce and if so what files I need? Thanks for all the previous help Link to comment https://forums.phpfreaks.com/topic/129919-solved-kind-of-a-general-question-on-os/ Share on other sites More sharing options...
sandbudd Posted October 24, 2008 Author Share Posted October 24, 2008 or if someone could point me to a good tutorial on how to do a shopping cart for an existing site would be great Link to comment https://forums.phpfreaks.com/topic/129919-solved-kind-of-a-general-question-on-os/#findComment-673524 Share on other sites More sharing options...
sandbudd Posted October 24, 2008 Author Share Posted October 24, 2008 You can see here that it already queries the database and send it to the page but I have tried several times to code it and keep getting something like an incompatible error? http://d882518.u36.rickettsweb.com/test/subcategory.php?sCatID=32 Pulling my hair out here...Here is what I think it should be so far? help please. <?php class cart { private $session=null; private $items=array(); private static $cartObj=null; private function __construct(&$session) { if(!self::$cartObj) self::$cartObj =& $this; $this->session =& $session; $this->session->registerSessionData($this); } public static function getInstance(&$session) { if(self::$cartObj) return self::$cartObj; return new cart($session); } public function addItem($id, $qty) { $this->items[$id] = $qty; } public function getItemList() { $ret = array(); foreach($this->items as $itemID => $itemQty) $ret[]=$itemID; return $ret; } public function getItemQty($itemID) { if(!isset($this->items[$itemID])) return 0; return $this->items[$itemID]; } public function numItems() { return count($this->items); } public function __sleep() { return array('items'); } public function __wakeup() { if(!self::$cartObj) self::$cartObj =& $this; } } ?> Link to comment https://forums.phpfreaks.com/topic/129919-solved-kind-of-a-general-question-on-os/#findComment-673585 Share on other sites More sharing options...
nadeemshafi9 Posted October 24, 2008 Share Posted October 24, 2008 wow this looks like very up to date coding, im impressed Link to comment https://forums.phpfreaks.com/topic/129919-solved-kind-of-a-general-question-on-os/#findComment-673587 Share on other sites More sharing options...
sandbudd Posted October 24, 2008 Author Share Posted October 24, 2008 nadeemshafi9 lol I know your making fun of me but do you have any suggestions? Link to comment https://forums.phpfreaks.com/topic/129919-solved-kind-of-a-general-question-on-os/#findComment-673588 Share on other sites More sharing options...
valtido Posted October 24, 2008 Share Posted October 24, 2008 there are alot of scripts out there for shopping carts including gateways for payments such as paypal if u have fantastico on you website control panel then use that and you will have free scripts there starting it from scratch u need a lot of time and good coding skills thats my suggestion lol Link to comment https://forums.phpfreaks.com/topic/129919-solved-kind-of-a-general-question-on-os/#findComment-673593 Share on other sites More sharing options...
sandbudd Posted October 24, 2008 Author Share Posted October 24, 2008 I don't have it Link to comment https://forums.phpfreaks.com/topic/129919-solved-kind-of-a-general-question-on-os/#findComment-673597 Share on other sites More sharing options...
valtido Posted October 24, 2008 Share Posted October 24, 2008 in that case i think you should find one and do it manually http://www.google.co.uk/search?source=ig&hl=en&rlz=&=&q=shopping+cart+script&btnG=Google+Search&meta= http://www.commerce-cgi.com/ hope it helps Link to comment https://forums.phpfreaks.com/topic/129919-solved-kind-of-a-general-question-on-os/#findComment-673600 Share on other sites More sharing options...
sandbudd Posted October 24, 2008 Author Share Posted October 24, 2008 got it working... Link to comment https://forums.phpfreaks.com/topic/129919-solved-kind-of-a-general-question-on-os/#findComment-673602 Share on other sites More sharing options...
nadeemshafi9 Posted October 24, 2008 Share Posted October 24, 2008 nadeemshafi9 lol I know your making fun of me but do you have any suggestions? im not making fun, i wont lie im a PHP pro but i work with PHP 4 not 5 so i dont get the chance to do pure oop with session controle in the class for its own instance like you do and it looks like its got soo much potential. Link to comment https://forums.phpfreaks.com/topic/129919-solved-kind-of-a-general-question-on-os/#findComment-673642 Share on other sites More sharing options...
nadeemshafi9 Posted October 24, 2008 Share Posted October 24, 2008 cos i was gona sugest to you use simple puts and shifts in an array and if you whant it oop then fine but use AJAX with it to pop stuff out on click and update the side basket. Link to comment https://forums.phpfreaks.com/topic/129919-solved-kind-of-a-general-question-on-os/#findComment-673644 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.