You are here

function commerce_wishlist_product_add_page in Commerce Wishlist 7.3

Menu callback: Perform various actions (add to wishlist etc).

1 string reference to 'commerce_wishlist_product_add_page'
commerce_wishlist_menu in ./commerce_wishlist.module
Implements hook_menu().

File

./commerce_wishlist.module, line 815
Provides a wish list for use in Drupal Commerce.

Code

function commerce_wishlist_product_add_page($product, $user) {
  if (isset($_GET['token']) && drupal_valid_token($_GET['token'])) {
    if (!commerce_wishlist_user_has_product_in_wishlist($product->product_id, $user->uid)) {
      $display_path = '';
      if ($_GET['destination'] != '') {
        $display_path = $_GET['destination'];
      }
      commerce_wishlist_product_add($product, NULL, $user->uid, $display_path);
    }
  }
  drupal_goto();
}