Hi
this are the steps to integrate "X-Sell v2.2" with "Individual Boxes 1.2":
1. Edit file:
catalog/includes/modules/xsell_products.php
Find:
new contentBoxHeading($info_box_contents);
Replace:
// new contentBoxHeading($info_box_contents);
(this hide the default header of the module)
2. In the same file find this line:
$info_box_contents[$row][$col] = array('align' => 'center',
ADD BEFORE:
$sql = 'SELECT `products_description` FROM `products_description` WHERE products_id ='. $xsell['products_id'].' && language_id='.(int)$languages_id;
$description_query = tep_db_query($sql);
$description = mysql_fetch_array($description_query, MYSQL_ASSOC);
$description['products_description'] = substr($description['products_description'], 0, 150);
$desc_len = strlen($description['products_description']);
$description['products_description'][$desc_len-1] = '.';
$description['products_description'][$desc_len-2] = '.';
$description['products_description'][$desc_len-3] = '.';
$description['products_description'] = ereg_replace("(Array)", "", $description['products_description']);
(this is for add the query for product description and create the short description)
3. the second is create the individual boxes:
In the same file find:
$info_box_contents[$row][$col] = array('align' => 'center',
'params' => 'class="smallText" width="33%" valign="top"',
'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a><br>' . $xsell_price. '<br><a href="' . tep_href_link(basename($PHP_SELF), 'action=buy_now&products_id=' . $xsell['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $xsell['products_name'] . TEXT_NOW) .'</a>');
Replace:
$info_box_contents[$row][$col] = array('align' => 'center',
'params' => 'class="smallText" cellspacing="0" width="50%" valign="top"',
'text' => '<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" valign="bottom" bordercolor="0"><img src="images/infobox_module/upper_left.gif" width="14" height="33" /></td>
<td colspan="2" background="images/infobox_module/top.gif" class=mws_boxTop_module><a class=productTitle href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . substr($xsell['products_name'], 0, 30) .'</a></td>
<td align="left" valign="bottom"><img src="images/infobox_module/upper_right.gif" width="14" height="33" /></td>
</tr>
<tr>
<td background="images/infobox_module/left.gif" width="14"> </td>
<td align="center" class=mws_boxCenter_module><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> </td>
<td class=mws_boxCenter_module2>'. strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']). '"><b>' . DESCR_READ_MORE . '</b></a><br><br><a href="' . tep_href_link(basename($PHP_SELF), 'action=buy_now&products_id=' . $xsell['products_id'], 'NONSSL') . '">' . tep_image_button('cart_buy.gif', TEXT_BUY . $xsell['products_name'] . TEXT_NOW) .'</a> <strong>' . $xsell_price . '</strong></td>
<td background="images/infobox_module/right.gif" class="smallText" width="14"><img src="images/infobox_module/right.gif" width="14" height="149" /></td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/infobox_module/lower_left.gif" width="14" height="12" /></td>
<td colspan="2" background="images/infobox_module/bot.gif"><img src="images/infobox_module/bot.gif" width="2" height="12" /></td>
<td align="left" valign="top" class="smallText"><img src="images/infobox_module/lower_right.gif" width="14" height="12" /></td>
</tr>
</table><br>');
(the code use for buy button the code of x-sell)
4. Find this line:
if ($col > 2) {
Replace:
if ($col > 1) {
(this is for change the columns products to show 2 columns)
5. Find this line:
new contentBox($info_box_contents);
replace:
new noborderBox($info_box_contents);
(this is for hide the default border of the module)
Finish.
For integrate with others modules:
is similar for steps 1,4 and 5
in step 2 for other module change the $xsell for the variable of the other module
Step 3 is more difficult but it only needed to compare code
first the params change to 50%: 'params' => 'class="smallText" cellspacing="0" width="50%" valign="top"',
and the base table is:
xsell
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" valign="bottom" bordercolor="0"><img src="images/infobox_module/upper_left.gif" width="14" height="33" /></td>
<td colspan="2" background="images/infobox_module/top.gif" class=mws_boxTop_module>here is for the product name code</td>
<td align="left" valign="bottom"><img src="images/infobox_module/upper_right.gif" width="14" height="33" /></td>
</tr>
<tr>
<td background="images/infobox_module/left.gif" width="14"> </td>
<td align="center" class=mws_boxCenter_module>here the product image and the module tag (NEW, SPECIALS,...)</td>
<td class=mws_boxCenter_module2>here is for the short description, more info link, price,... </td>
<td background="images/infobox_module/right.gif" class="smallText" width="14"><img src="images/infobox_module/right.gif" width="14" height="149" /></td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/infobox_module/lower_left.gif" width="14" height="12" /></td>
<td colspan="2" background="images/infobox_module/bot.gif"><img src="images/infobox_module/bot.gif" width="2" height="12" /></td>
<td align="left" valign="top" class="smallText"><img src="images/infobox_module/lower_right.gif" width="14" height="12" /></td>
</tr>
</table><br>
comparing the code with others modules integrated with Individual boxes made easy to create the code to insert in the table.
regards