Skip to content Skip to sidebar Skip to footer

Tutorial on Creating an Online Store Using Codeigniter: Order Member [Bagian 3]

Order is the process of ordering goods or requests for goods from buyers to sellers. In the past we often heard the term order when we were going to buy goods, but now we know it better with order.

Process order what happens in use website this is order by on line. Order goods through media on line will be very easy and fast. Buyers can see the product directly, then select the item and then fill in the amount of the desired item until finally doing it order or ordering goods.

Also Read:


1. Create files Order.php in the folder C:\xampp\htdocs\online-shop\application\controllers.

session->userdata('username'))		{			redirect('login');		}		$this->load->model('model_orders');	}		public function index()	{		$is_processed = $this->model_orders->process();		if($is_processed){			$this->cart->destroy();			redirect('order/success');		} else {			$this->session->set_flashdata('error','Failed to processed your order, please try again!');			redirect('welcome/cart');		}	}	public function success()	{		$this->load->view('order_success');	}}

Program Logic:

  • public function __construct() is a function that is always executed when the file is executed, by defining username and also model_orders.
  • public function index() function to call default from file Order.php to process data cart who entered. If the data entry has been successful, a success message will appear inside function successwhereas if it fails then a message will appear error.
  • public function success() serves to display the order_success file contained in the view folder.

2. Create files order_success.php in the folder C:\xampp\htdocs\online-shop\application\views.

			Toko Online | Inwepo										load->view('layout/top_menu') ?>				

Thank you, your order is being processed..

Program Logic:

  • When the member has selected the desired item and then the next step is to verify the product by pressing the Check Out button. Then a message will appear Thank you, your order is being processed..

Here’s a view of member orders:

After member choose the desired product, then they can do the next step, namely ordering goods by pressing the green button, namely Check Out. If you want to delete list shopping list, member can press button clear cart. Likewise if member still want to add list groceries, they can press the button Continue Shopping.

Well, when the data is successfully processed by the system and has entered the databases, then a message like the following will appear:

That was making member orders found on the store’s website on line. At the next meeting, the author will discuss the making of logout function in member dashboard.

Therefore, make sure Inwepo’s loyal friends continue to follow the development of this online store website.


Order.php (Controllers)

Order_success.php (Views)