PDA

View Full Version : X-Sell v2-MS2 - Cross Sell for MS2



michael_s
05-29-2008, 02:12 PM
I am using an older version of Cross Sell, and I'm not sure which version, but I wanted to post this because it's such an improvement.

The Edit page becomes very unmanageable when you have lots of items in your store. This modification makes it so that the products are 5 columns across, rather than 1. This modification also will allow you to click the product image to select for Cross Sell, rather than just the checkbox.

TO INSTALL:

1. BACK UP! I have no idea which version of the Addon I'm using.

2. Near Line 181, find the code starting with
// This bit does the 'EDIT' page (previously Add/Remove)

and ending with
//////////////////////////////////////////////////////////////////////////////////
// This bit does the 'PRIORITISE' page (previously Sort)


3. Replace with the following:

//////////////////////////////////////////////////////////////////////////////////
// This bit does the 'EDIT' page (previously Add/Remove)

if ($_POST && !$sort)
{
if ($_POST[run_update]==true)
{
$query ="DELETE FROM " . TABLE_PRODUCTS_XSELL . " WHERE products_id = '".$_POST[add_related_product_ID]."'";
if (!tep_db_query($query))
exit('could not delete');
}
if ($_POST[xsell_id])
foreach ($_POST[xsell_id] as $temp)
{
$query = "INSERT INTO " . TABLE_PRODUCTS_XSELL . " VALUES ('',$_POST[add_related_product_ID],$temp,1)";
if (!tep_db_query($query))
exit('could not insert to DB');
}
echo 'Click Here to add a new cross sale (http://www.oscmax.com/forums/' . tep_href_link(FILENAME_XSELL_PRODUCTS, '', 'NONSSL') . ')
' . "n";
if ($_POST[xsell_id])
echo 'Click here to sort (top to bottom) the added cross sale (http://www.oscmax.com/forums/' . tep_href_link(FILENAME_XSELL_PRODUCTS, 'sort=1&add_related_product_ID=' . $_POST[add_related_product_ID], 'NONSSL') . ')' . "n";
}

if ($add_related_product_ID && ! $_POST && !$sort)
{ ?>







size="20" name="xsell_id[]" type="checkbox" value="">
Cross-sell




">