Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Only Guests Rate Topic   - - - - -

 
  • webus
  • Member
  • Members
  • Join Date: 13-Jul 13
  • 49 posts

Posted 25 January 2015 - 12:39 PM #1

There re some contents that i want only guests to see.

for the ones that login as member i found the code below

{if $auth.user_id}
http://forum.cs-cart...user-logged-in/

but i couldn't find a code for guests only.


however i can do like this

<div id="guest">test</div>

{if $auth.user_id} <style type="text/css">.guest {display:none;} </style></if>

but a code like this would take less place {if $auth.guest}

 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 840 posts

Posted 25 January 2015 - 05:34 PM #2

Can't you just use the Availability options at the bottom of the Website > Content > Edit page?
Put a check mark in front of "Guest" and uncheck "All".

CS-Cart Ultimate ver 4.11.3


 
  • webus
  • Member
  • Members
  • Join Date: 13-Jul 13
  • 49 posts

Posted 25 January 2015 - 06:45 PM #3

Can't you just use the Availability options at the bottom of the Website > Content > Edit page?
Put a check mark in front of "Guest" and uncheck "All".


thank you for answer. but code required for tpl file. this isn't a block or page problem.

 
  • Magpie Don
  • Senior Member
  • Members
  • Join Date: 01-Apr 09
  • 840 posts

Posted 25 January 2015 - 07:09 PM #4

There re some contents that i want only guests to see.

Sorry, when you said "contents" I thought you were referring to the actual Website > Contents (where you create Pages & Forms) that is included with CS-Cart.

CS-Cart Ultimate ver 4.11.3


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12156 posts

Posted 26 January 2015 - 05:19 AM #5

{if empty($auth.user_id)}

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • webus
  • Member
  • Members
  • Join Date: 13-Jul 13
  • 49 posts

Posted 28 January 2015 - 08:06 AM #6

{if empty($auth.user_id)}


thank you for answer.

 
  • CS-Market
  • Senior Member
  • Authorized Reseller
  • Join Date: 06-Mar 13
  • 715 posts

Posted 28 January 2015 - 10:13 AM #7

Hello,

The full and more correct line will be
<div class="{if empty($auth.user_id)} hidden {/if}">test</div>

Sincerely yours,
CS-Market.

GET A FREE QUOTE  │  CS-Cart add-ons   │   CS-Cart custom development   │  CS-Cart design integration  │  CS-Cart license

Сертифицированный разработчик на CS-Cart Русская Версия. More than 8 years experience in CS-Cart development.


 
  • webus
  • Member
  • Members
  • Join Date: 13-Jul 13
  • 49 posts

Posted 08 March 2015 - 10:36 AM #8

Thanks for your reply it worked with a bit different way