File_Explorer Posted June 9, 2021 Share Posted June 9, 2021 Is there anyway to add a specific line of code to a category? Example: I click on a category and order now, can i add the code on the specific review & checkout for that category? 0 Quote Link to comment Share on other sites More sharing options...
File_Explorer Posted June 9, 2021 Author Share Posted June 9, 2021 Also, is it possible to add a required option as a configurable option to a product? So like the box must ticked before clicking checkout? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 9, 2021 Share Posted June 9, 2021 12 hours ago, File_Explorer said: Is there anyway to add a specific line of code to a category? yes. 12 hours ago, File_Explorer said: Example: I click on a category and order now, can i add the code on the specific review & checkout for that category? yes.... but you'd have to a) determine which products are in the cart and b) where to display the output. the native way would be to use a ShoppingCartViewCartOutput action hook a) that part is easy - it only gets complicated when you have multiple conditions, e.g products from multiple product groups (categories) in the cart, and you want to show one message if product group 1 is in the cart, but a different message if there is a product from Product Group 2 in the cart... what to do if both are in the cart?? show both messages? only one - if so, which ?? b) the SCVCO hook output is in a predetermined location, so if that's the correct spot for you, then the hook is the way to go... if not, then you're looking at using an alternate hook with JS... or editing the template using Smarty. long story short, it can't be done from admin setting changes. 12 hours ago, File_Explorer said: Also, is it possible to add a required option as a configurable option to a product? So like the box must ticked before clicking checkout? again, not from settings - that would be a validation hook - I think ShoppingCartValidateProductUpdate would trigger at the appropriate time. you can use an order link to pass a config value to the cart, but I suspect you would need the validation hook to prevent the order from progressing unless/until the required config option is in the cart... equally, you could use a hook to set a config value to be checked in the cart by default, but that doesn't really get you any further forward as they could untick it - and you would still need the validation hook to prevent the order continuing. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.