1: | <?php
2: | namespace Opencart\Catalog\Controller\Checkout;
3: | /**
4: | * Class Success
5: | *
6: | * @package Opencart\Catalog\Controller\Checkout
7: | */
8: | class Success extends \Opencart\System\Engine\Controller {
9: | /**
10: | * @return void
11: | */
12: | public function index(): void {
13: | $this->load->language('checkout/success');
14: |
15: | if (isset($this->session->data['order_id'])) {
16: | $this->cart->clear();
17: |
18: | unset($this->session->data['order_id']);
19: | unset($this->session->data['payment_method']);
20: | unset($this->session->data['payment_methods']);
21: | unset($this->session->data['shipping_method']);
22: | unset($this->session->data['shipping_methods']);
23: | unset($this->session->data['comment']);
24: | unset($this->session->data['agree']);
25: | unset($this->session->data['coupon']);
26: | unset($this->session->data['reward']);
27: | unset($this->session->data['voucher']);
28: | unset($this->session->data['vouchers']);
29: | }
30: |
31: | $this->document->setTitle($this->language->get('heading_title'));
32: |
33: | $data['breadcrumbs'] = [];
34: |
35: | $data['breadcrumbs'][] = [
36: | 'text' => $this->language->get('text_home'),
37: | 'href' => $this->url->link('common/home', 'language=' . $this->config->get('config_language'))
38: | ];
39: |
40: | $data['breadcrumbs'][] = [
41: | 'text' => $this->language->get('text_basket'),
42: | 'href' => $this->url->link('checkout/cart', 'language=' . $this->config->get('config_language'))
43: | ];
44: |
45: | $data['breadcrumbs'][] = [
46: | 'text' => $this->language->get('text_checkout'),
47: | 'href' => $this->url->link('checkout/checkout', 'language=' . $this->config->get('config_language'))
48: | ];
49: |
50: | $data['breadcrumbs'][] = [
51: | 'text' => $this->language->get('text_success'),
52: | 'href' => $this->url->link('checkout/success', 'language=' . $this->config->get('config_language'))
53: | ];
54: |
55: | if ($this->customer->isLogged()) {
56: | $data['text_message'] = sprintf($this->language->get('text_customer'), $this->url->link('account/account', 'language=' . $this->config->get('config_language') . '&customer_token=' . $this->session->data['customer_token']), $this->url->link('account/order', 'language=' . $this->config->get('config_language') . '&customer_token=' . $this->session->data['customer_token']), $this->url->link('account/download', 'language=' . $this->config->get('config_language') . '&customer_token=' . $this->session->data['customer_token']), $this->url->link('information/contact', 'language=' . $this->config->get('config_language')));
57: | } else {
58: | $data['text_message'] = sprintf($this->language->get('text_guest'), $this->url->link('information/contact', 'language=' . $this->config->get('config_language')));
59: | }
60: |
61: | $data['continue'] = $this->url->link('common/home', 'language=' . $this->config->get('config_language'));
62: |
63: | $data['column_left'] = $this->load->controller('common/column_left');
64: | $data['column_right'] = $this->load->controller('common/column_right');
65: | $data['content_top'] = $this->load->controller('common/content_top');
66: | $data['content_bottom'] = $this->load->controller('common/content_bottom');
67: | $data['footer'] = $this->load->controller('common/footer');
68: | $data['header'] = $this->load->controller('common/header');
69: |
70: | $this->response->setOutput($this->load->view('common/success', $data));
71: | }
72: | }
73: |

OpenCart API API documentation generated by ApiGen dev-master