Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 07-25-2013 06:10:33

lazarus42
Member
Registered: 11-22-2005
Posts: 29

having products NOT display to some user groups

Basic situation is that we have some products whose pricing is viewable by all users whether logged in or not. Other products which you have to be logged in to see.

On CCP6 we had implemented this by having 2 variants of the same product. Let's say it is product 1234. We would have 1234 in the database and D1234. 1234 would be only visible to people who had created an account (set prodview to L and prodviewg to users. D1234 would be visible to all users even guests who had not logged in (set prodview to A and prodviewg blank).  We then used skinoverride on a per product basis with 2 product skins skin.login being set for product 1234 and skin.logout for D1234. skin.login would display the product and skin.logout would not display the product. We did this to avoid confusing our logged in customers who in either a search or a product category would otherwise see both 1234 (with pricing) as they were logged in and also D1234 (the same product without pricing). The skin.login/skin.logout allows us to suppress the display of D1234 when logged in so that only the correct variant of the product can be displayed.

The challenge is how to implement this on CCP8 where it appears skinoverride is no longer available on a per product basis.

I have read a number of previous posts on wholesale vs non wholesale pricing which seem to be looking at the same sort of issue. It seems that the core of the issue is that the different types of prodview are viewable by all (A), viewable by specifc groups only (L) or viewable by none. An easy logical way of doing this would be to introduce a not viewable by group option (say, X or N).

Please could someone give me a pointer in the code as to where I would need to work to add this logic.

Phill

Offline

 

#2 07-25-2013 09:13:49

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19872
Website

Re: having products NOT display to some user groups

The non-viewable option would be handled by setting visibility to selected usergroups only, then not selecting any usergroups. 

Concerning presenting a login dialog in place of the price, this could be done with a simple mod to {private}/apps/ecom/ECOM/includes/pricedisp.php - and possibly a mod to the product detail display to suppress the add to cart form.


Nick Hendler

Offline

 

#3 07-26-2013 02:28:10

lazarus42
Member
Registered: 11-22-2005
Posts: 29

Re: having products NOT display to some user groups

Trying this, I have:

ID=toy0958,prodview=L,prodviewg=users     

Works exactly as wanted. i.e. visible only when logged in by a basic user

BUT

ID=Dtoy0958,prodview=L,prodviewg=     (i.e. blank)

doesn't work the way I understand you suggest. What I understood is that it is not viewable by any visitor in a user group such as logged in as a basic user but fully visible by a guest who is not logged in at all. My testing has this product not viewable at any time.

Any suggestions?  Presumably there is a test in the code somewhere if the prodviewg is set or not. Could you give me a pointer as to where this is and what I would need to do to set up the desired behaviour described above?

Phill

Offline

 

#4 07-26-2013 08:43:20

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19872
Website

Re: having products NOT display to some user groups

ID=Dtoy0958,prodview=L,prodviewg=BLANK

Would suppress the product from everyone, as your test indicates.  Basically you're saying only let logged in users who do not have a usergroup (a condition that's never met by anyone) view the product.

What are you looking for, then?  A way to hide products from registered users, but not from guests?  Is you issue with displaying the products, or just the pricing?  Why do you really need two different sets of products?


Nick Hendler

Offline

 

#5 07-26-2013 15:12:14

lazarus42
Member
Registered: 11-22-2005
Posts: 29

Re: having products NOT display to some user groups

The issue is with displaying the pricing to guests.

If we can achieve what we need with only one set of products then great!

Phill

Offline

 

#6 07-29-2013 08:50:02

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19872
Website

Re: having products NOT display to some user groups

I would set up your products as normal users would see them, then mod the pricing display to suppress the pricing from guests by add this to the top of {private}/apps/ecom/ECOM/includes/pricedisp.php.

Code:

if (!($this->globals('core_user.id'))) {return 1;}

You could also mod the product detail displays to not do add to cart forms by editing them under Store > Store Displays > Product Detail Displays.  In each of those, right below:

Code:

$add_ok = 1;

if (($proddisp['useinv']) && (!($proddisp['invlevel'] > 0))) {$add_ok = 0;}
if ($proddisp['pricestatus'] == 'D') {$add_ok = 0;}

You can add:

Code:

if (!($this->globals('core_user.id'))) {$add_ok = 0;}

Nick Hendler

Offline

 

Board footer