Premitium Posted July 29, 2016 Share Posted July 29, 2016 I am looking into adding a functionality to the store that lets the merchant make a product part of a second category and have a different design in the product page. Do you think that the approach of adding the product to a second category is even possible within 1.6? If you know another way please share. Link to comment Share on other sites More sharing options...
rocky Posted July 30, 2016 Share Posted July 30, 2016 It's certainly possible to have a product in two categories (a main category and a "Product of the day" category), but changing the product page design based on the selected category is more difficult. You can use the category in the cookie to determine whether the customer visited the product from the main category or the "Product of the day" category, though that relies on the customer viewing the "Product of the day" category. If they go straight to the product without going through the "Product of the day" category first, they'll get the default product design. For example, you could use code like the following in product.tpl: {if $cookie->last_visited_category == 10} Put "Product of the day design here" {else} Put normal product design here {/if} Change 10 to the ID of your "Product of the day" category. You can add more if statements if needed. 1 Link to comment Share on other sites More sharing options...
Premitium Posted August 1, 2016 Author Share Posted August 1, 2016 I changed the view purely with JS. Worked well so far Thank you 1 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