• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need a little help with the Cart class

#1
[eluser]bdegier[/eluser]
Hello,

I'm spending my saturday finishing a simple shoppingcart i started building a while ago. I'm now trying to write some sort of an update cart function.

- Before I continue: I'm not so experienced in the PHP field Smile -

I want users to be able to change the value of the quantity text fields, then press a button and the cart updates the quantity of all products currently in the cart.

The User Guide has a short explanation about this: http://ellislab.com/codeigniter/user-gui.../cart.html

But i can't quite figure out how to get the rowID's for the products and use this to update the cart.

I wrote a very basic function to test the updating which works (hardcoded):
Code:
function updateCart() {
        $data = array(
               array(
                       'rowid'   => 'b99ccdf16028f015540f341130b6d8ec',
                       'qty'     => 3
                    ),
               array(
                       'rowid'   => 'xw82g9q3r495893iajdh473990rikw23',
                       'qty'     => 4
                    ),
               array(
                       'rowid'   => 'fh4kdkkkaoe30njgoe92rkdkkobec333',
                       'qty'     => 2
                    )
      );

$this->cart->update($data);
    }

All help will be GREATLY appreciated!

Thanks,

Bento

#2
[eluser]bdegier[/eluser]
Got PMed this tutorial which somehow i was unable to Google Smile
http://nuazul.net/php/shopping-cart-usin...art-2.html

Cheers.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.