Jump to content
Sign in to follow this  
BenjaminJ.Gremillion

Add to Wishlist Button in product_listing.php

Recommended Posts

I would like to be able to add a product to the wishlist via the product_listing.php page and the featured items contribution, but I can't seem to figure the button out. It's working perfectly from the product_info.php page. Has anyone gotten this to work?

Share this post


Link to post
Share on other sites

If anyone is interested in the solution:

 

add to application_top.php (after case buy_now...break;)

// <!-- Wish List -->
case 'add_to_wishlist' : if (isset($HTTP_GET_VARS['products_id'])) {
if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
} else {
$wishList->add_wishList($HTTP_GET_VARS['products_id'], '');
}
}
tep_redirect(tep_href_link('wishlist.php', tep_get_all_get_params($parameters)));
break;
// <!-- /Wish List -->

 

And to product_listing.php (somewhere near the buy now button)

tep_draw_button(IMAGE_BUTTON_WISHLIST, '', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_to_wishlist&products_id=' . $listing['products_id']), 'primary')

Edited by BenjaminJ.Gremillion

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×