julian burbano Posted December 15, 2020 Share Posted December 15, 2020 Hello , I wondering if is possible to hide an image placed in the product short description until the users get log in? my version is 1.7.6 . See attachment or visit the website www.merchfuel.com/distributors . Thank you! Link to comment Share on other sites More sharing options...
endriu107 Posted December 15, 2020 Share Posted December 15, 2020 You can do this only by editing your template file, there is few way to do it. I think easy way is edit template by adding class to product description if user is not logged like: {if $customer.is_logged}logged{else}notlogged{/if} and in css add: .notlogged img {display:none} Link to comment Share on other sites More sharing options...
julian burbano Posted December 15, 2020 Author Share Posted December 15, 2020 2 minutes ago, endriu107 said: You can do this only by editing your template file, there is few way to do it. I think easy way is edit template by adding class to product description if user is not logged like: {if $customer.is_logged}logged{else}notlogged{/if} and in css add: .notlogged img {display:none} Thank you for your reply! im not advanced user but I think you whant me to modify the product.tpl in the short descriiption area right? but exactly how the code should be placed? And when you say CSS do you mean custom css or the theme css? thank you ! Link to comment Share on other sites More sharing options...
endriu107 Posted December 15, 2020 Share Posted December 15, 2020 There should be code like: class="product-description-short typo sm-bottom" just change it by adding code from my previous post like: class="product-description-short typo sm-bottom {if $customer.is_logged}logged{else}notlogged{/if}" and css code add to custom.css after that force theme compilation and clear your cache. Link to comment Share on other sites More sharing options...
julian burbano Posted December 15, 2020 Author Share Posted December 15, 2020 30 minutes ago, endriu107 said: There should be code like: class="product-description-short typo sm-bottom" just change it by adding code from my previous post like: class="product-description-short typo sm-bottom {if $customer.is_logged}logged{else}notlogged{/if}" and css code add to custom.css after that force theme compilation and clear your cache. Hello! Im not sure if the code should be something like this. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now