Post by sean1123 » Tue Jan 31, 2017 4:36 pm

Hi All,

I am starting to learn opencart. I am looking at the code and am wondering how was the vouchur code passed from cart to checkout page. Can anyone enlighten me ?


Code: Select all

class ControllerCheckoutCheckout extends Controller {
	public function index() {
		// Validate cart has products and has stock.
		if ((!$this->cart->hasProducts() && empty($this->session->data['vouchers'])) || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) {


Mon Jan 30, 2017 11:33 pm

Post by knowband.plugins » Wed Feb 01, 2017 2:55 pm

When you apply a voucher code, it gets validated and then is saved in the session. Once it is saved in session, you can get it on all pages with following code.

Code: Select all


Knowband Plugins Team

Opencart Plugins: Knowband Store

User avatar


Thu Aug 04, 2016 2:56 pm

Who is online

Users browsing this forum: No registered users and 9 guests