I just wanted to thank this poster for helping me fix this. I added the code as suggested then refreshed my modifications cache and theme/sass cache and it worked beautifully. THANK YOU! Opencart version 3.0.2.0Johnathan wrote: ↑Thu Oct 26, 2017 9:48 pmThis is a 3.0 bug that you can fix by doing this:
Code: Select all
IN: /catalog/controller/checkout/cart.php AFTER: if ($this->cart->hasProducts() || !empty($this->session->data['vouchers'])) { ADD: $data['heading_title'] = $this->language->get('heading_title');
After encountering the same issue I also found that Johnathan's fix resolves the issue fine, but I wanted to find the root cause.Johnathan wrote: ↑Thu Oct 26, 2017 9:48 pmThis is a 3.0 bug that you can fix by doing this:
Code: Select all
IN: /catalog/controller/checkout/cart.php AFTER: if ($this->cart->hasProducts() || !empty($this->session->data['vouchers'])) { ADD: $data['heading_title'] = $this->language->get('heading_title');
After a bit of digging I think I have found the root cause as below.
Root cause - heading_title is overridden by additional total modules
The title of the main checkout cart page, taken from the corresponding language file (\catalog\language\en-gb\checkout\cart.php), is set on Line 6 of /catalog/controller/checkout/cart.php
Code: Select all
$this->document->setTitle($this->language->get('heading_title'));
Code: Select all
$data['modules'] = array();
$files = glob(DIR_APPLICATION . '/controller/extension/total/*.php');
if ($files) {
foreach ($files as $file) {
$result = $this->load->controller('extension/total/' . basename($file, '.php'));
if ($result) {
$data['modules'][] = $result;
}
}
}
Messy fix -> One way to avoid the title of the cart being overridden is to change the name heading_title in the language file and then change any references to it in cart.php and the cart.twig layout file, but that is messy.
Good fix -> Jonathan's fix works well as it saves the title in the main $data array so it can't be overridden when the language files of any total modules are loaded. The title is still initially set in Line 6 however so the only minor tweak I would suggest is to use HugoSega's approach (posting.php?mode=quote&f=202&t=198804&p=700549#pr709505) and just replace Line 6 with:
Code: Select all
$data['heading_title'] = $this->language->get('heading_title');
Who is online
Users browsing this forum: No registered users and 27 guests