Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
  • Hello! Here I want to show my code with which I made my first web fuel application.
    Maybe for someone it will be helpful.
    It is e-shop. WARNING! This is raw code!
    With that code you can just to understand how to use any function and how they work. That application extremely NOT safe!!! Pagination,
    Sesson,
    Registration,
    Router,
    Cookie,
    Database,
    Asset,
    Html,
    Form
    If you will any question just write here.
    Do not forget I rookie too. http://dl.dropbox.com/u/31878727/fuel.zip
  • Thanks for the code, it should come in handy learning the ins and outs or Fuel... I have few edits for others in case they try it out...
    Edit to the controllers (welcome, item, category, account etc.)
    if(Cookie::get('user_id'))
            {
                $user_id = Cookie::get('user_id');
                $query_count = DB::query('SELECT item_id FROM carts WHERE cookie_user_id = "'. $user_id .'"')->execute();
                $query2 = DB::query('SELECT sum(item_price) FROM carts WHERE cookie_user_id = "'. $user_id .'"')->execute()->as_array();
                $data = $query_count->as_array();
                $datasum = $query2;
                $data_count = $query_count->count();
            }else
            {
                $unique_id = Str::random('sha1');
                Cookie::set('user_id',$unique_id,time()+3600,'/','abba.com');
                $datasum = '';
                $data_count = 0;
            }
    
    In fuel/app/views/welcome/cart.php remove this code:
    <?php foreach($datacart as $datacart1 => $key); ?>
    
  • Thanks for you share!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion