Differences
This shows you the differences between two versions of the page.
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 ====== |
- | A 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. | + | A 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 user. If **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. |
+ | |||
+ | Normally, LiteMage serves the same cache copy for non-logged-in users and logged-in users alike. However, 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. |