Post by Seraph77 » Wed Nov 01, 2017 1:10 am

When there is a product in the cart and I go to vew cart page, the page title says, Use Gift Certificate (0.50kg). The weight changes and is the weight of the actual product.

No gift certificates have been purchased and why would the weight appear there??

I would prefer to have either Shopping Cart or the product name on there. Where can I change this?

jpg screenshot:
Image

New member

Posts

Joined
Mon Aug 14, 2017 3:23 am

Post by Seraph77 » Wed Nov 01, 2017 1:36 am

Update:
If I change heading title in voucher.php to 'Shopping Basket', the title changes to 'Shopping Basket(0.05kg)' and the lower 'Use Gift Certificate' changes to Shopping Basket too.

If I change 'text voucher', nothing happens.

New member

Posts

Joined
Mon Aug 14, 2017 3:23 am

Post by pom » Wed Nov 01, 2017 1:45 am


pom
New member

Posts

Joined
Thu Oct 26, 2017 12:12 am

Post by straightlight » Wed Nov 01, 2017 2:41 am

Which OC version? In the mean time, switch back to the default theme and see if you can reproduce the same issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Seraph77 » Wed Nov 01, 2017 3:23 am

Changing the theme to default made no difference to the cart title.

Looking at the thread Pom posted. I made the edit suggested in this post: viewtopic.php?p=700549#p700549

As a result, 'Use Gift Certifcate (0.50kg)' changed to 'Shopping Cart (0.50kg)'.

So it did half the job as the weight is still displaying.

Any suggestions?

OC: 3.0.2.0
Theme: Journal 2
Plug-in's: SEO Pack Pro

New member

Posts

Joined
Mon Aug 14, 2017 3:23 am

Post by Seraph77 » Wed Nov 01, 2017 4:51 pm

Any suggestions anyone? Any ideas what causes the product weight to be added to the cart page title? It looks really bad.

New member

Posts

Joined
Mon Aug 14, 2017 3:23 am

Post by phinq1910 » Wed Nov 01, 2017 5:18 pm

go to file catalog\view\theme\*\template\checkout\cart.tpl, search

Code: Select all

if ($weight)
and remove following:

Code: Select all

<?php if ($weight) { ?>
        &nbsp;(<?php echo $weight; ?>)
        <?php } ?>

User avatar
New member

Posts

Joined
Sat Jun 11, 2016 11:43 am
Location - Hanoi

Post by Johnathan » Wed Nov 01, 2017 10:36 pm

Rather than edit core files, you can actually just turn this off in the admin panel. It's a setting called "Display Weight on Cart Page" in System > Settings > Option.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Seraph77 » Thu Nov 02, 2017 12:03 am

All sorted, thanks everyone! :)

New member

Posts

Joined
Mon Aug 14, 2017 3:23 am

Post by dynamicsites » Tue Mar 20, 2018 12:50 am

Johnathan wrote:
Wed Nov 01, 2017 10:36 pm
Rather than edit core files, you can actually just turn this off in the admin panel. It's a setting called "Display Weight on Cart Page" in System > Settings > Option.
Any advice if setting is as suggested but still the weight appears on the Cart Page?
Opencart 3.0.2 with Journal theme, Cart is default ("Quickcheckout" option has been disabled)

Thanks in advance,
Alex

Image

Newbie

Posts

Joined
Mon Oct 23, 2017 4:30 pm

Post by Johnathan » Wed Mar 21, 2018 4:53 am

If you're using 3.0, make sure you turn off twig caching in the main admin dashboard. You do that using the small gear icon in the upper-right. It's possible the page was just getting cached.

If that's not it, you can manually remove that text by making this edit in 3.0.2.0:

Code: Select all

IN:
/catalog/view/theme/YOURTHEME/template/checkout/cart.twig

DELETE:
&nbsp;({{ weight }})

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by dynamicsites » Thu Mar 22, 2018 3:23 pm

Hi Johnathan, thanks for the information.

Unfortunately changing the suggested twig file didn't work (cache was already deactivated).
Could it be that I need to tweak the core twig file? As mentioned, I have disabled the theme's "quickcheckout" and using the default cart.

Thanks,
Alex

Newbie

Posts

Joined
Mon Oct 23, 2017 4:30 pm

Post by Johnathan » Fri Mar 23, 2018 1:14 am

If you made that edit, then it definitely should be working. Some things to check:

1. Are you sure you *cleared* the Twig cache, not just disabled it? If you didn't clear it then it will still use the old cached files, even if you disable it.

2. Double-check that you've edited the file in your theme, and not the default theme (unless you're using that).

3. If you used the Theme Editor in the admin panel, that will override any edits you make to the .twig files themselves. Double-check that you haven't edited the checkout/cart.twig file in the Theme Editor.

4. Make sure you clear/disable all other caching on your site. Another caching mechanism could be at play here.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by straightlight » Fri Mar 23, 2018 1:44 am

If your cache is causing issue, ensure to follow these two posts:

- viewtopic.php?f=176&p=718325#p718325
- viewtopic.php?f=176&p=718325#p717782

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by dynamicsites » Fri Mar 30, 2018 3:29 am

A big apology to all, it turns out I'm an idiot for not explaining properly what I'm trying to do. :clown:
I am actually trying to remove cart weight from the shipping method in the checkout page, please see image below.
It dawned on me when I started comparing the code from the section I'm trying to edit to the code in the Twig file.
Also, it's definitely not a caching issue. I checked ALL cache files via FTP and they are absolutely fresh (created at the exact moment I refreshed cache).

https://imgur.com/a/5hLN0
Last edited by dynamicsites on Sun Apr 01, 2018 2:42 am, edited 1 time in total.

Newbie

Posts

Joined
Mon Oct 23, 2017 4:30 pm

Post by Johnathan » Fri Mar 30, 2018 10:43 pm

I e-mailed this to dynamicsites, but for others that need this in the future, here's the edit you need to remove the weight from the Weight Based Shipping rate title:

Code: Select all

IN:
/catalog/model/shipping/weight.php
or
/catalog/model/extension/shipping/weight.php

REPLACE:
'title'        => $result['name'] . '  (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')',

WITH:
'title'        => $result['name'],

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by straightlight » Fri Mar 30, 2018 10:48 pm

For which OC version is this replacement code for?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by dynamicsites » Sun Apr 01, 2018 2:41 am

straightlight wrote:
Fri Mar 30, 2018 10:48 pm
For which OC version is this replacement code for?
My installation is v.3.0.2.0 and it worked great.

Newbie

Posts

Joined
Mon Oct 23, 2017 4:30 pm

Post by Johnathan » Tue Apr 03, 2018 9:42 pm

straightlight wrote:
Fri Mar 30, 2018 10:48 pm
For which OC version is this replacement code for?

Literally every OpenCart version since 1.5.1. The syntax for that line is slightly different in 1.5.0 and older, but I doubt there are many users of versions that old these days. If you do have a version that's 1.4.x or 1.5.0, the line is pretty much the same, so it shouldn't be hard to find.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by straightlight » Tue Apr 03, 2018 9:59 pm

Johnathan wrote:
Tue Apr 03, 2018 9:42 pm
straightlight wrote:
Fri Mar 30, 2018 10:48 pm
For which OC version is this replacement code for?

Literally every OpenCart version since 1.5.1. The syntax for that line is slightly different in 1.5.0 and older, but I doubt there are many users of versions that old these days. If you do have a version that's 1.4.x or 1.5.0, the line is pretty much the same, so it shouldn't be hard to find.
No problem. Although, it would of still be informative to indicate the OC version range that is available to use the provided codes to help future users. ;)

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 3 guests