Unable to add this product match at this time.

\n"; } mysql_close(); } else { $error = "
Whoops. Link error

\n"; } } ?> Unable to mark this product as unmatchable at this time.

\n"; } mysql_close(); } ?> 0) { while ($row = @mysql_fetch_array($result, MYSQL_ASSOC)) { $merchant_link = $row[merchant_link]; $merchant_price = $row[merchant_price]; $merchant_id = $row[merchant_id]; } } // verify product exists $query = "select * from user_products_product where deleted = \"0\" and uid = \"".$_REQUEST[product_id]."\";"; //echo "Q2: $query\n"; $result = mysql_query($query); if (@mysql_num_rows($result)>0) { while ($row = @mysql_fetch_array($result, MYSQL_ASSOC)) { $tb_product_name = $row[product_name]; } } if (($merchant_price) && ($merchant_link) && ($tb_product_name)) { // add the link $tstamp = time(); $query = "insert into user_products_merchant_product (pid,tstamp,crdate,cruser_id,product_id,merchant_id,price,merchant_url) VALUES "; $query .= "(\"1002\",\"$tstamp\",\"$tstamp\",\"80\",\"".$_REQUEST[product_id]."\",\"".$_REQUEST[merchant_id]."\",\"$merchant_price\",\"$merchant_link\");\n"; //echo "Q3: $query\n"; $result = mysql_query($query); if ($result == 1) { $query2 = "select * from user_products_merchant_product where crdate=\"$tstamp\" and product_id = \"".$_REQUEST[product_id]."\";"; $result2 = mysql_query($query2); if (@mysql_num_rows($result2)>0) { while ($row = @mysql_fetch_array($result2, MYSQL_ASSOC)) { $offer_id = $row[uid]; } } } else { $error = "Could not make the ecommerce link.

\n"; } } else { $error = "Not enough information to create ecommerce link. $merchant_price is price and $merchant_link is link and $tb_product_name is tbpname\n

"; } if ((!$error) && ($offer_id)) { $query = "insert into user_products_product_name_match (pid,tstamp,crdate,cruser_id,product_id,partner_id,partner_merchant_id,partner_product_id,merchant_product_id, merchant_product_name,merchant_cat,feed_id,upc,sku,tb_offer_id) VALUES (\"1002\",\"$tstamp\",\"$tstamp\",\"80\",\"".$_REQUEST[product_id]."\", \"0\",\"".$_REQUEST[merchant_id]."\",\"0\",\"".$_REQUEST[muid]."\",\"".$_REQUEST[product_name]."\",\"0\",\"manual_match\",\"0\",\"".$_REQUEST[merchant_sku]."\",\"$offer_id\");\n"; $result = mysql_query($query); if ($result == 1) { } else { $error = "Could not make the name match.

\n"; } } if (!$error) { // update the status for this manual match row in the matching table $query = "update user_products_merchant_product_matching set status = \"matched\" where uid =\"".$_REQUEST[muid]."\";"; //echo "Q4: $query\n"; $result = mysql_query($query); if ($result == 1) { $brand_name=urlencode($_REQUEST[brand_name]); $product_name_url=urlencode($_REQUEST[product_name]); $tb_product_name_url=urlencode($tb_product_name); $url = "matching.php?showall=1&brand_name=$brand_name&tb_product_name=$tb_product_name_url&product_name=$product_name_url&matched_msg=1&merchant_id=$_REQUEST[merchant_id]&tbpid=$_REQUEST[product_id]&pg=$_REQUEST[pg]"; header('Location: '.$url); exit; echo "Go here: $url \n"; } else { $error = "
Unable to mark this product as matched at this time. ($error)

\n"; } } mysql_close(); } else { $error = "You must provide product id and matching product id.

\n"; } } ?>

Manage ECommerce Product Matches

$_REQUEST[product_name] has been marked as unmatchable and removed from the list of pending product matches.

\n"; } if ($_REQUEST[matched_msg]) { echo "
$_REQUEST[product_name] has been matched to $_REQUEST[tb_product_name] and the ecommerce link has been added. \n"; echo "
Click here to view


\n"; } $brand_name_url = urlencode($_REQUEST[brand_name]); echo "
refresh this list (especially useful after adding products)

\n"; echo "\n"; echo "\n"; $link = mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_PASS); mysql_select_db(MYSQL_DB,$link); if (!$_REQUEST[brand_name]) { $query = "select uid,brand_name from user_products_brand where deleted = \"0\" order by brand_name ASC"; echo "\n"; $result = mysql_query($query); if (@mysql_num_rows($result)>0) { while ($row = @mysql_fetch_array($result, MYSQL_ASSOC)) { $brand_id = $row[uid]; $brand_name = $row[brand_name]; $allbrands->{$brand_name} = $brand_id; } } } else { $query = "select uid,brand_name from user_products_brand where deleted = \"0\" and brand_name = \"$_REQUEST[brand_name]\" order by uid ASC"; $result = mysql_query($query); if (@mysql_num_rows($result)>0) { while ($row = @mysql_fetch_array($result, MYSQL_ASSOC)) { $brand_id = $row[uid]; $brand_name = $row[brand_name]; $allbrands->{$brand_name} = $brand_id; } } } if (!$_REQUEST[merchant_id]) { $query = "select uid,partner_merchant_name from user_products_merchant where deleted = \"0\" order by partner_merchant_name ASC"; $result = mysql_query($query); if (@mysql_num_rows($result)>0) { while ($row = @mysql_fetch_array($result, MYSQL_ASSOC)) { $merchant_id = $row[uid]; $merchant_name = $row[partner_merchant_name]; $allmerchants->{$merchant_id} = $merchant_name; } } } else { //$query = "select uid,partner_merchant_name from user_products_merchant where deleted = \"0\" and uid = \"$_REQUEST[merchant_id]\" order by uid ASC"; $query = "select uid,partner_merchant_name from user_products_merchant where deleted = \"0\" and uid = \"$_REQUEST[merchant_id]\" order by uid ASC"; $result = mysql_query($query); if (@mysql_num_rows($result)>0) { while ($row = @mysql_fetch_array($result, MYSQL_ASSOC)) { $merchant_id = $row[uid]; $merchant_name = $row[partner_merchant_name]; $allmerchants->{$merchant_id} = $merchant_name; } } } $query = "select count(uid) from user_products_merchant_product_matching where status = \"new\" and merchant_price != \"0.00\" "; if ($_REQUEST[merchant_id]) { $query .= "and merchant_id = \"$_REQUEST[merchant_id]\" "; } if ($_REQUEST[brand_name]) { $query .= "and merchant_brand = \"$_REQUEST[brand_name]\" "; } $query .= "order by uid ASC"; echo "\n"; $result = mysql_query($query); $row = mysql_fetch_row($result); $total = $row[0]; $pages = intval($total/$perpage); echo "$total results. $pages pages.    \n"; $start = 0; if (!$_REQUEST[pg]) { $start = 0; $_REQUEST[pg] = 1; } else { $start = (($_REQUEST[pg] - 1) * $perpage); } if (($_REQUEST[pg]) && ($_REQUEST[pg] != 1)) { echo "<< | "; } if ($_REQUEST[pg] > 1) { $pgdown = ($_REQUEST[pg] - 1); echo "$pgdown | "; } echo "$_REQUEST[pg] | "; if ($_REQUEST[pg] != $pages) { $showpages = 1; while ($showpages < 5) { $mylinkpg = ($_REQUEST[pg] + $showpages); if ($mylinkpg <= $pages) { echo "$mylinkpg | "; } $showpages++; } } if ($_REQUEST[pg] != $pages) { echo " >>\n"; } echo "

\n"; $query = "select * from user_products_merchant_product_matching where status = \"new\" "; if ($_REQUEST[merchant_id]) { $query .= "and merchant_id = \"$_REQUEST[merchant_id]\" "; } if ($_REQUEST[brand_name]) { $query .= "and merchant_brand = \"$_REQUEST[brand_name]\" "; } $query .= "order by uid ASC limit $start,$perpage"; echo "\n"; $result = mysql_query($query); if (@mysql_num_rows($result)>0) { while ($row = @mysql_fetch_array($result, MYSQL_ASSOC)) { if ($row[deleted] > 0) { echo "No pending matches found at this time.
\n"; } else { $status = $row[status]; $product_id = $row[product_id]; $merchant_id = $row[merchant_id]; $merchant_sku = $row[merchant_sku]; $merchant_brand = $row[merchant_brand]; $merchant_product_name = $row[merchant_product_name]; $merchant_price = $row[merchant_price]; $merchant_desc = $row[merchant_desc]; $merchant_link = $row[merchant_link]; $merchant_img = $row[merchant_img]; if ($allmerchants->{$merchant_id}) { $merchantname = $allmerchants->{$merchant_id}; } else { $merchantname = $merchant_id; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } } } mysql_close(); echo "
PartnerProductPriceLinksMatch To:  
$merchantname   $merchant_product_name\$$merchant_pricevisit page
(view image)


TB PID: \n"; echo "\n"; echo "\n"; echo "\n"; echo "


\n"; $product_name_url = urlencode($merchant_product_name); $desc_url = urlencode($merchant_desc); if ($allbrands->{$merchant_brand}) { $brandid = $allbrands->{$merchant_brand}; } else { $brandid = 0; } $link_to_add = "module=product&brand=$brandid&product_name=$product_name_url&desc_text=$desc_url&data_source=$merchant_link&price=$merchant_price"; $link_to_add = urlencode($link_to_add); echo "

"; if ($brandid == 0) { echo "(unknown brand) "; } echo "
\n"; echo "
\n"; echo "\n"; echo "

\n"; } ?>
Show All Products to Match

Show All ECommerce Partners

Add One-Off ECommerce Link to Product

or
Show All Products to Match that are associated with: