tribulant

Untitled

Nov 8th, 2012
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. // Is this an existing product?
  2.                                                     if (!empty($product['code'])) {
  3.                                                         $productquery = "SELECT `id` FROM `" . $wpdb -> prefix . $Product -> table . "`";
  4.                                                         $productquery .= (!empty($product['code'])) ? " WHERE `code` = '" . $product['code'] . "'" : '';
  5.                                                         if ($product_id = $wpdb -> get_var($productquery)) {
  6.                                                             $product['id'] = $product_id;
  7.                                                         }
  8.                                                     }
Advertisement
Add Comment
Please, Sign In to add comment