Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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?

Link to comment
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
Link to comment
Share on other sites

  • 1 year later...

Join the conversation

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

Guest
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.

 Share

×
×
  • Create New...