Differences

This shows you the differences between two versions of the page.

Link to this comparison view

litespeed_wiki:cache:litemage:troubleshooting:logged-in-logged-out-users-different-views [2018/06/26 20:07]
Jackson Zhang created
litespeed_wiki:cache:litemage:troubleshooting:logged-in-logged-out-users-different-views [2018/06/26 21:01] (current)
Lisa Clarke Proofreading
Line 1: Line 1:
-====== ​How to hide the "add to cart" button when the client is not logged in? ====== +====== ​Treat Add to Cart Button Differently Based on Login Status ​====== 
-user needs to hide the **add to cart** button when the client is not logged in, and unfortunately,​ when LiteMage enabled, the user was not able to do so anymore.  +page should display like this for non-logged-in users:
- +
-For non-logged-in users:+
 {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-when-not-logged-in-no-addtocart.png?​600 |}} {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-when-not-logged-in-no-addtocart.png?​600 |}}
  
-For logged-in users:+And like this for logged-in users:
 {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-when-logged-in-show-addtocart.png?​600 |}} {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-when-logged-in-show-addtocart.png?​600 |}}
  
-Normally LiteMage ​will share the same cache copies ​for the non-logged-in ​user and logged-in ​userIf **Add to cart** should only show to the logged-in user but not for the non-logged-in users the user needs to set "Separate Cache Copy per Customer Group" ​in general ​setting ​to  ​**Only distinguish between logged-in vs logged-out users**, which assumes ​that all logged in users see the same price.+The **Add to Cart** button should not appear when a client is not logged in. However, with LiteMage enabled, the button was being displayed. 
 + 
 +NormallyLiteMage ​serves ​the same cache copy for non-logged-in ​users and logged-in ​users alikeHowever, if **Add to cart** should only show to the logged-in user, this does not work. You will need to set **Separate Cache Copy per Customer Group** in general ​settings ​to  ​''​Only distinguish between logged-in vs logged-out users''​. This makes it so that there are two copies of the page stored in cache: one for logged-in users and one for logged-out users.
  
 {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-logged-in-user-warm-up-when-separatecachcopy.png?​600 |}} {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-logged-in-user-warm-up-when-separatecachcopy.png?​600 |}}
-Furthermore,​ if the different user will see the different ​price for different groups, then the user should specify different groupings+This assumes that all logged-in users should ​see the same price. If there are different ​prices ​for different groups, then you will need to cache separate copies of the page for each customer group.
  • Admin
  • Last modified: 2018/06/26 21:01
  • by Lisa Clarke