Post by Schwimpi » Tue May 04, 2021 10:15 pm

I was wondering if there's a way if not already via OCMOD to hide the wishlist until the user is registered or signed in. Thanks for your help guys!

New member

Posts

Joined
Thu Apr 29, 2021 2:19 am

Post by straightlight » Wed May 05, 2021 7:49 am

In catalog/view/theme/default/template/common/header.twig file,

find:

Code: Select all

<li><a href="{{ wishlist }}" id="wishlist-total" title="{{ text_wishlist }}"><i class="fa fa-heart"></i> <span class="hidden-xs hidden-sm hidden-md">{{ text_wishlist }}</span></a></li>
replace with:

Code: Select all

{% if logged %}<li><a href="{{ wishlist }}" id="wishlist-total" title="{{ text_wishlist }}"><i class="fa fa-heart"></i> <span class="hidden-xs hidden-sm hidden-md">{{ text_wishlist }}</span></a></li>{% endif %}
Then, follow this FAQ post: viewtopic.php?f=134&t=215776#p718325

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 thekrotek » Wed May 05, 2021 3:25 pm

straightlight wrote:
Wed May 05, 2021 7:49 am
In catalog/view/theme/default/template/common/header.twig file,
It only hides a link to wishlist and doesn't restrict the access to it.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by paulfeakins » Wed May 05, 2021 4:37 pm

Schwimpi wrote:
Tue May 04, 2021 10:15 pm
I was wondering if there's a way if not already via OCMOD to hide the wishlist until the user is registered or signed in. Thanks for your help guys!
If you can't find an extension, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by straightlight » Wed May 05, 2021 7:33 pm

thekrotek wrote:
Wed May 05, 2021 3:25 pm
straightlight wrote:
Wed May 05, 2021 7:49 am
In catalog/view/theme/default/template/common/header.twig file,
It only hides a link to wishlist and doesn't restrict the access to it.
That is correct, the OP user specifically asked to: hide the wishlist link if customer is not logged in; not to restrict it.

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 Schwimpi » Sat May 08, 2021 12:30 am

Thanks for the help guys, I used the "% If Logged %" before the wishlist div tag and the closer "% end if%" after. And for some reason now, when someone tries to add something to their wishlist not logged in, a message pops up telling them they need to login/register first.

Cheers!

New member

Posts

Joined
Thu Apr 29, 2021 2:19 am

Post by straightlight » Sat May 08, 2021 1:34 am

Schwimpi wrote:
Sat May 08, 2021 12:30 am
Thanks for the help guys, I used the "% If Logged %" before the wishlist div tag and the closer "% end if%" after. And for some reason now, when someone tries to add something to their wishlist not logged in, a message pops up telling them they need to login/register first.

Cheers!
OC version. URL?

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 Pamella » Sun May 09, 2021 4:45 am

Hi, do you know ;) how to use it in footer? Tryed without success (OC 3..0.3.7 & default theme), thanks in advance

OC 3.0.3.7 EN (default theme) running on PHP 7.3 MariaDB 10.3 Linux / Apache 2.4


New member

Posts

Joined
Tue Oct 25, 2011 4:22 am

Post by Schwimpi » Thu May 13, 2021 5:13 am

Pamella wrote:
Sun May 09, 2021 4:45 am
Hi, do you know ;) how to use it in footer? Tryed without success (OC 3..0.3.7 & default theme), thanks in advance
I actually was tinkering with that earlier today and almost got it working, I'll let you know if I succeed.

New member

Posts

Joined
Thu Apr 29, 2021 2:19 am
Who is online

Users browsing this forum: DesignCart, JNeuhoff, sidclel and 96 guests