Jump to content

Code on specific page

Recommended Posts

12 hours ago, File_Explorer said:

Is there anyway to add a specific line of code to a category?


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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated