You can use:
 
  if(isset($wishlist_button_x) AND ($UserInfo["ID"]>0))
  {
   //insert into wishlist
   $Query = "INSERT INTO user_sku (User, SKU, Quantity, Notes) VALUES ";
   $Query .= "(" . $UserInfo["ID"] . ", $sku, 1, '$notes') ";
  }
 
I ran into this same problem.  Code from above is in ADD_BASKET.  I believe you can check either $wishlist_button_x or $wishlist_button_y - the coordinates of the button are passed rather than the button name (wishlist_button) when using an image.
 
Kevin
----- Original Message -----
From: Ron Dyck
Sent: Thursday, February 22, 2001 5:10 AM
Subject: [FreeTrade] Wishlist Button

I needed to use an image for the wishlist and found that the variable: $wishlist_button wasn't set using an image. So I added this bit of code to the top of ADD_BASKET to recognize it,
 
foreach($HTTP_POST_VARS as $key => $value) {
  if (preg_match ("/wishlist_button/", $key)) {
   $wishlist_button = TRUE;
  }
 }
 
My question is, is there a more efficient way? This seems to work great without requiring any modification to the ADD_BASKET action, but it just seems a little unnecessary to loop through the all POST_VARS like that.
 
Any suggestions?
 

=======================
      Ron Dyck
      WebbTech
      www.WebbTech.net

Reply via email to