Post by Olsta » Thu Jan 30, 2014 11:39 am

Hi,

I would like to hide some content in product description if the customer is not logged in (this is a Customer/Distributor website).
So I have created a user group for distributors. Basically I only want distributors to see certain content ie. download links when they login.

Is there a bit of code that I could use to let me hide content if not logged in. I only want a specific customer group to see the content/links in this case.

Newbie

Posts

Joined
Thu Jan 30, 2014 11:35 am

Post by Xyph3r » Sat Feb 01, 2014 12:28 am

There are a lot of extensions in the market. you can assign free downloads to any product..and only logegd customers can download them. Check the extension market

ImageImageImage
Opencart Templates, Modules, Themes & Custom Development | ShopThemer


User avatar
Active Member

Posts

Joined
Sun Feb 10, 2013 1:08 am


Post by Olsta » Mon Feb 03, 2014 5:25 am

Xyph3r wrote:There are a lot of extensions in the market. you can assign free downloads to any product..and only logegd customers can download them. Check the extension market
I ended purchasing a custom page tabs extension for this but what I really wanted was to be able to wrap a section of content in the product description and wrap it in a div tag with a display:none if not logged in.

Newbie

Posts

Joined
Thu Jan 30, 2014 11:35 am

Post by rempong » Mon Feb 03, 2014 1:55 pm


OPENCART MODULE :
Opencart Compare Link Link your compared product to forum/email

Frontend Link From Admin Dashboard
Get link to product , category, manufacturer, information from admin backend.

Copy and DIRECTLY Edit Product the easy way.

Custom Product Sort Full control to product sorting options

Already Sold Product Module, shows total product sold


Active Member

Posts

Joined
Fri Sep 14, 2012 2:38 pm
Location - Indonesia

Post by dolrichfortich » Mon Feb 03, 2014 2:29 pm

You can just wrap the content with this code.

Code: Select all

<?php if ($this->customer->isLogged()) { ?>
Show this only for logged in users.
<?php } ?>

Opencart Options Pro, Reward Points For Review, DISQUS Comment Form,
Dolrich Fortich - Freelance web developer

Image


User avatar
New member

Posts

Joined
Thu Aug 05, 2010 8:09 pm
Location - Philippines

Post by Olsta » Tue Feb 04, 2014 10:42 am

dolrichfortich wrote:You can just wrap the content with this code.

Code: Select all

<?php if ($this->customer->isLogged()) { ?>
Show this only for logged in users.
<?php } ?>
Thanks dolrichfortich but this does not work inside the html editor for the category/products section on admin side.

Newbie

Posts

Joined
Thu Jan 30, 2014 11:35 am

Post by tarheit » Tue Feb 04, 2014 12:19 pm

I bet you could setup a style the is not displayable by default. Wrap your content in a div with that style. Then override the css with an inline style using the above code in your product template. Should be very strait forward.

New member

Posts

Joined
Wed Jan 22, 2014 5:16 am

Post by Olsta » Tue Feb 04, 2014 12:46 pm

Thanks will give that a go. Guess I should have thought of that in the first place.

Newbie

Posts

Joined
Thu Jan 30, 2014 11:35 am

Post by qahar » Tue Feb 04, 2014 5:13 pm

You can use OpenCart Shortcode to hide content manually until user is logged in.

You can use the shortcode at information, product description editor etc

Code: Select all

Some text A

[login]Some text B[/login]

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by ajaiverma » Tue Feb 04, 2014 11:15 pm

Hi,
I can code this, I am expert opencart developer.
Contact me at ajaiverma401[at]gmail[dot]com

Newbie

Posts

Joined
Fri Jan 31, 2014 11:07 am

Post by OSWorX » Tue Feb 04, 2014 11:58 pm

For all shops having reseller/distributor.
Here a module you can assign products and categories as well to selected customergroups:
Module Resellermode

The module will also introduce a new unit: packing unit (available for all products).
Useful for products shipped as package (definition is up to you and your business).

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by Olsta » Wed Feb 05, 2014 4:52 am

qahar wrote:You can use OpenCart Shortcode to hide content manually until user is logged in.

You can use the shortcode at information, product description editor etc

Code: Select all

Some text A

[login]Some text B[/login]
I like this and I downloaded the extension to test but unfortunately it is not compatible with Mijoshop :-[

Newbie

Posts

Joined
Thu Jan 30, 2014 11:35 am

Post by sensadvert » Thu Apr 16, 2015 9:40 pm

Hello,

How can I hide certain product from listing on the store? I tried -1 but it's not working.

Thanks.

Newbie

Posts

Joined
Wed Mar 25, 2015 7:26 pm
Location - Macedonia
Who is online

Users browsing this forum: No registered users and 18 guests