Page 1 of 2
Incorrect Cart heading Use Gift Certificate
Posted: Thu Oct 19, 2017 8:49 pm
by raptorheli
After a clean installation of OC 3020 the header of the cart page have changed to Use Gift Certificate instead of the Shopping cart
This occurs after you add something to the cart
After some investigations in OC files this is related to the total.php files in: .... /catalog/language/english/extensions/total.php
when disable the heading_title in the following files : coupon.php ,shipping.php ,voucher.php the header on the cart is correct, but then the functionality of this extension is missing.
Could there be any bug in the core of OC causing this problem?
Any suggestion to correct this will be appreciated
This can be viewed on the website
www.uniformsbutikken.net
Raptorheli
Re: Incorrect Cart heading Use Gift Certificate
Posted: Thu Oct 19, 2017 9:18 pm
by straightlight
This issue has now been addressed.
Re: Incorrect Cart heading Use Gift Certificate
Posted: Thu Oct 26, 2017 5:19 am
by raptorheli
HI,
I can´t manage solve this problem that the heading of the Shopping cart change to Gift certificate when you add some product to the cart.
This have something to do with the extension/total and the three files : coupon, Voucher, shipping, heading variable
Is there Anyone who know something to do and advice ?
Raptorheli
Re: Incorrect Cart heading Use Gift Certificate
Posted: Thu Oct 26, 2017 9:48 pm
by Johnathan
This 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');
Re: Incorrect Cart heading Use Gift Certificate
Posted: Fri Oct 27, 2017 7:36 pm
by raptorheli
I have added the line , but nothing have changed, please look at the page
https://www.uniformsbutikken.net/
Raptorheli
Re: Incorrect Cart heading Use Gift Certificate
Posted: Fri Oct 27, 2017 7:49 pm
by straightlight
We can't analyze a maintenance store. Can you provide the error logs that you see based on this event?
Re: Incorrect Cart heading Use Gift Certificate
Posted: Fri Oct 27, 2017 10:23 pm
by Johnathan
Make sure you clear all your caches. This includes (1) the ocMod cache, (2) the Twig cache, and (3) any caching extensions you have installed on your store.
Re: Incorrect Cart heading Use Gift Certificate
Posted: Fri Dec 22, 2017 11:22 am
by midsouthtrading
I have the same bug, fix did not fix...is there some other button to push to clear all the caches, or was clicking the "clear cache" button in Journal sufficient? Use Gift Certificate (25.12kg) is the heading now...changes weight when you change items in cart
Re: Incorrect Cart heading Use Gift Certificate
Posted: Fri Dec 22, 2017 1:49 pm
by callspirit
This is my code edited as Johnathan said but it not work. I post my code below, can you help me take a look at this to fix this bug.
Many thanks.
My site:
www.darkroom.vn/opencart/
OC 3.0.2.0
Code: Select all
$data['breadcrumbs'][] = array(
'href' => $this->url->link('checkout/cart'),
'text' => $this->language->get('heading_title')
);
if ($this->cart->hasProducts() || !empty($this->session->data['vouchers'])) {
$data['heading_title'] = $this->language->get('heading_title');
if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) {
$data['error_warning'] = $this->language->get('error_stock');
} elseif (isset($this->session->data['error'])) {
$data['error_warning'] = $this->session->data['error'];
unset($this->session->data['error']);
} else {
$data['error_warning'] = '';
}
Re: Incorrect Cart heading Use Gift Certificate
Posted: Fri Dec 22, 2017 9:50 pm
by straightlight
It may look like a cache issue you're experiencing. Let's troubleshoot this issue. Below this line:
Code: Select all
if ($this->cart->hasProducts() || !empty($this->session->data['vouchers'])) {
add:
Code: Select all
if (!empty($this->session->data['user_token'])) {
echo 'test123';
}
Save changes.
Then, login to your Opencart admin and go to your store from the header menu. Go back to your reported page where the heading_title has the issue and see on top of the page if you see:
test123 .
Re: Incorrect Cart heading Use Gift Certificate
Posted: Sat Dec 23, 2017 12:38 pm
by callspirit
Hi straightlight,
Thank you for your respond. I will describe what I did:
1/ I added the code as you said. So now, my code is like this
Code: Select all
if ($this->cart->hasProducts() || !empty($this->session->data['vouchers'])) {
if (!empty($this->session->data['user_token'])) {
echo 'test123';
}
$data['heading_title'] = $this->language->get('heading_title');
if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) {
$data['error_warning'] = $this->language->get('error_stock');
} elseif (isset($this->session->data['error'])) {
$data['error_warning'] = $this->session->data['error'];
2/ I login to admin page via mysite/admin
3/ I access my store through the the top right menu on the admin page.
4/ I added 1 item to the cart and I viewd my cart
5/ I don't see any "test123" so I Ctrl-F to find "test123" but there's no "test123". And the heading is still incorrect.
Am I experiencing the cache issue? If so. What can I do? I cleared the cache via the Admin Dashboard, cleared the Journal Theme cache also. I didn't edit any twig in Theme editor and I also delete all the cache file in the storage folder.
straightlight wrote: ↑Fri Dec 22, 2017 9:50 pm
It may look like a cache issue you're experiencing. Let's troubleshoot this issue. Below this line:
Code: Select all
if ($this->cart->hasProducts() || !empty($this->session->data['vouchers'])) {
add:
Code: Select all
if (!empty($this->session->data['user_token'])) {
echo 'test123';
}
Save changes.
Then, login to your Opencart admin and go to your store from the header menu. Go back to your reported page where the heading_title has the issue and see on top of the page if you see:
test123 .
Re: Incorrect Cart heading Use Gift Certificate
Posted: Sat Dec 23, 2017 10:26 pm
by straightlight
You are either using Journal2 and / or your storage folder is still inside your system folder while it should rather be located outside your public_html folder. The config.php and admin/config.php files storage path also needs to be adjusted accordingly including .htaccess file (if found in your .htaccess file as well). Then, clear out your cache in your Opencart admin dashboard as well as from your admin - > extensions - > modifications - > refresh button. Then, logout from your OC admin. Clear out your browser's cache - > close the browser - > re-open the browser. Relog back in your Opencart admin - > click back on your store from the header and see if you notice the test123 message on top of the page.
Re: Incorrect Cart heading Use Gift Certificate
Posted: Sun Dec 24, 2017 1:15 am
by callspirit
Hi straightlight,
Thank you so much. Finally it works but still I don't know how. I did use Journal 2 theme. My storage folder is outside the public_html (I checked the config.php a lot of times). Maybe the refresh button in the extensions - > modifications made it work.
By the way, I have last question: my .htaccess is not exist, I only have the .htaccess.txt. Should I rename it to .htaccess ??
Thank you so much for your help!
straightlight wrote: ↑Sat Dec 23, 2017 10:26 pm
You are either using Journal2 and / or your
storage folder is still inside your system folder while it should rather be located outside your public_html folder. The config.php and admin/config.php files storage path also needs to be adjusted accordingly including .htaccess file (if found in your .htaccess file as well). Then, clear out your cache in your Opencart admin dashboard as well as from your admin - > extensions - > modifications - > refresh button. Then, logout from your OC admin. Clear out your browser's cache - > close the browser - > re-open the browser. Relog back in your Opencart admin - > click back on your store from the header and see if you notice the
test123 message on top of the page.
Re: Incorrect Cart heading Use Gift Certificate
Posted: Sun Dec 24, 2017 1:25 am
by straightlight
By the way, I have last question: my .htaccess is not exist, I only have the .htaccess.txt. Should I rename it to .htaccess ??
Especially if you use SEO links or having your own SSL protocol throughout the store, it would be suggested to use it
but only from a followed documentation of a downloaded SEO extensions from the marketplace or, regarding SSL, by consulting the forum search or by contacting your host about it.
Otherwise, if everything is working, there's no need to modify anything else at the present time throughout your domain.
Re: Incorrect Cart heading Use Gift Certificate
Posted: Mon Dec 25, 2017 8:29 pm
by Sokonomi
Johnathan wrote: ↑Thu Oct 26, 2017 9:48 pm
This 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');
Worked for me, awesome.
Just remember to turn caching off when you are editing your site, folks.
(Go to main dashboard > Cog at top right)
Re: Incorrect Cart heading Use Gift Certificate
Posted: Fri Jan 05, 2018 7:56 am
by HugoSega
ALSO IN:
/catalog/controller/checkout/checkout.php
replace Line 28 with
$data['heading_title'] = $this->language->get('heading_title');
Re: Incorrect Cart heading Use Gift Certificate
Posted: Thu Feb 01, 2018 9:26 am
by mikegilmore81
Johnathan wrote: ↑Thu Oct 26, 2017 9:48 pm
This 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');
This worked for me as well, thanks!
Re: Incorrect Cart heading Use Gift Certificate
Posted: Tue May 01, 2018 5:49 am
by RaceVTA
Just installed open cart and this bug is still there ... easy enough to fix so why isn't it updated in the current download??
What other bugs need fixing in the current opencart download??
Re: Incorrect Cart heading Use Gift Certificate
Posted: Fri May 25, 2018 6:24 am
by emir.more
RaceVTA wrote: ↑Tue May 01, 2018 5:49 am
Just installed open cart and this bug is still there ... easy enough to fix so why isn't it updated in the current download??
What other bugs need fixing in the current opencart download??
Same here, just stumbled upon this bug, fixed it with a modification, using solution from this thread by Johnathan.
It was reported on GitHub couple of times, but issues closed without fixes applied.
I read here
https://github.com/opencart/opencart/issues/5922 – that it is fixed in OC 3.0.2.1b
Re: Incorrect Cart heading Use Gift Certificate
Posted: Fri Dec 21, 2018 6:38 am
by buzrocks
Johnathan wrote: ↑Thu Oct 26, 2017 9:48 pm
This 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');
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.0