HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Lock out guests from the shopping cart

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#103498 (In Topic #20250)
Avatar

Fan in training

I'm stuck trying to figure out how to force account creation before shopping.

I'm having way Way to many guests adding items to the cart then quiting or not buying at Pay Pal (dozens and dozens actually). This is tying up the store which thinks there is no product stock.

How do I lock out the Shopping cart from Guests? I've almost got it, where ocPortal pops up and demands a log in, but I can't quite get it to come up between "Add To Cart" and the shopping cart page. I think if I could find the shopping cart page, I could change the permissions on it, and that might do it. But I can't find that page (hours of looking and trying).
Back to the top
 
Posted
Item has a rating of 5 (Liked by Chris GrahamLiked by FletchLiked by Steven Jarvis)  
Rating:
#103499
Avatar

Community saint

You can do this with a 'match-key page restriction'. Go to you site Admin Zone->Security->Match-key page restrictions option. In the 'match-key page restrictions' section of that page, enter this:

_WILD:shopping:type=add_item

in the text box in the left column. Put a check in the Guest column (and any other usergroup column you want to exclude from the cart) for that line.

In the 'match-key permission-denied messages' section of that page, add the same match-key in the left column:

_WILD:shopping:type=add_item

and in the Message column you can add a custom error message like:

Sorry, you must be a registered member to add items to the cart.

And then click the Save button at the bottom of the page.

A guest attempting to add an item to the cart will bring up the login page with that custom error message at the top, and the guest can either login or join to continue adding the item to the cart.

Guests also have a little message below the 'Add to Cart' button on the product entry page that informs them cookies will be used to try to remember them. To remove that message, use the template editor for your theme (Admin Zone->Style->Manage themes and click the Edit Templates option for your theme), and remove this bit of code:

Code

{+START,IF,{$IS_GUEST}}
<p class="associated_details">{!COOKIES_AS_GUEST}</p>
{+END}
 


Done!
Back to the top
 
Posted
Rating:
#103500
Avatar

Fan in training

OMG - That is EXACTLY what I was trying to figure out. That's amazing. It works perfectly! Thanks so much!
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: