Page 1 of 1

How to add continue shopping and checkout button

Posted: Sun Apr 01, 2018 8:39 pm
by dani888
Hello
I installed this module
https://www.opencart.com/index.php?rout ... load_id=55
Versiune opencart 3.0.2.0
very well but I do not know how to give two continue shopping and checkout buttons
Maybe someone can help me
Thanks

Re: How to add continue shopping and checkout button

Posted: Sun Apr 01, 2018 10:07 pm
by straightlight

Re: How to add continue shopping and checkout button

Posted: Sun Apr 01, 2018 10:54 pm
by dani888
Hello
We have modified the following code as in the example
I installed modules this one
https://www.opencart.com/index.php?rout ... load_id=55
Nothing has changed
the module works without the two buttons
Maybe something needs to be modified
Thank you

No OC version posted. However, it can be done. Followed is for v3.0.2.0 release:

In catalog/controller/checkout/cart.php file,

find:

Code: Select all

$product_id = (int)$this->request->post['product_id'];

add below:

Code: Select all

$this->session->data['product_id'] = (int)$product_id;

Then, find:

Code: Select all

$data['continue'] = $this->url->link('common/home');

replace with:

Code: Select all

if (!empty($this->session->data['product_id'])) {
$data['continue'] = $this->url->link('product/product', 'product_id=' . (int)$this->session->data['product_id']);
} else {
$data['continue'] = $this->url->link('common/home');
}

Then, in catalog/controller/product/product.php file, find:

Code: Select all

$this->load->model('catalog/manufacturer');

add below:

Code: Select all

if (!empty($this->session->data['product_id'])) {
unset ($this->session->data['product_id']);
}

This should resolved the issue.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight

Re: How to add continue shopping and checkout button

Posted: Sun Apr 01, 2018 11:45 pm
by straightlight
Since you're using an extension, contact the extension developer to integrate what you need. You can also clear your OC cache from the OC admin by following this post noticing the changes after implementing the steps from the above post: viewtopic.php?f=176&p=718325#p718325

Re: How to add continue shopping and checkout button

Posted: Mon Apr 02, 2018 12:19 am
by dani888
I turned off the module I updated and it works
Still have to add style to have buttons
Thanks for the change I'm glad someone is helping us