Custom page after add to cart (Catgory dependant)

  • Posts: 260
  • Thank you received: 25
12 years 4 months ago #58036

Hi,

This is what I am wanting to do:

My shop has the following setup:

Category 1 (5 Sub Categories > each with 5 items)
Category 2 (5 items)
Category 3 (5 items)

All items in Category 1 can be purchased individually but also require products from Category 2
All items in Category 2 can be purchased individually but also require products from Category 3

What I want to do is, if someone buys any of the products in Category 1, once they add to cart, they are redirected to a page (customer) that asks if they need Category 2 products.
If Yes, they go to category 2, if no, they go to checkout.(and same through the Category 2)

Basically, once they have added the main product, I want to direct them to the custom page. (I read the post relating to add to cart HTML button , but not sure if that is what I am looking for as I just want to use the standard checkout button.

Do I have to set up custom check buts for every product?

Regards

Simon B


Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

  • Posts: 82820
  • Thank you received: 13366
  • MODERATOR
12 years 3 months ago #58108

Hi,

That would indeed require some custom code.
What you could do is this:
set the option "After a product is added to the cart" to "Stay and display a popup notice" in the Checkout tab of the configuration.
Then, in the file "notice" of the "checkout" view via the menu Display->views, you would have to add custom code to change the "continue shopping" button for cat1 and 2 products so that it would redirect to the appropriate listing when clicked on.
Here a thread about getting the product information in that notice box:
www.hikashop.com/en/forum/2-general-talk...-cart-modal-how.html
Then, you would have to adapt it in order to load the category of the product with a query on the table hiakshop_product_category and display your button based on that.

Please Log in or Create an account to join the conversation.

  • Posts: 260
  • Thank you received: 25
12 years 3 months ago #58163

Hi Nicolas,

Thanks for the quick reply (as always)

I have looked over what you say, and the link, and the file, but no idea how to do. (any chance of getting an outline, start etc on the coding - not my forte)

EDIT:

Staring at the screen, I think what I am trying to do may be more extremely complicated so I think there may be an easier approach....

Edit the 'Continue Shopping' so it goes to a custom page (whereby I can direct with instructions from there)

Off to find out how I can do that.


Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'
Last edit: 12 years 3 months ago by sambob. Reason: A thought

Please Log in or Create an account to join the conversation.

  • Posts: 260
  • Thank you received: 25
12 years 3 months ago #58181

Ok... from anothe post here:

<?php echo $this->cartClass->displayButton(JText::_('CUSTOM MESSAGE'),'continue_shopping',$this->params,'','window.top.location.href=\'PAGE TO DIRECT TO'; return false;','id="hikashop_add_to_cart_continue_button"');?>

In the file "notice" of the "checkout" view in Display->views.

A good start and I can live with that for a while.


Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'
Last edit: 12 years 3 months ago by sambob.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum