$l .= '<div>' . $obj_product->displayImage(IMAGE_SIZE_THUMBNAIL_2, IMAGE_SIZE_THUMBNAIL_2) . '</div>'; $l .= '<div>' . $obj_product->displayIDAndCode() . '</div>'; if ($show_remove) { $l .= '<div title="Click to remove this product" class="red">(x) remove</div>'; } $l .= '</div>'; return $l; } //AJAX ACTION if (isset($_POST['me_action'])) { if ($_POST['me_action'] == 'PRODUCTLINKING') { $result = ''; switch ($_POST['act']) { case 'LOAD': if (isset($_POST['plid']) && $_POST['plid'] != '') { $pl = $class_pl->retrieveDetail($_POST['plid']); $result .= drawPLthumb($pl['products_linking_id'], $pl['links_id'], true, true); } else { $pl_load = $class_pl->retrieveList($products_id); $pl_load_auto = $class_pl->getProductsCrossSelling($products_id); $links = array(); foreach ($pl_load as $row) { if (!isset($links[$row['type']])) { $links[$row['type']] = array(); } $links[$row['type']][] = drawPLthumb($row['products_linking_id'], $row['links_id'], false, true); } $nolink = '<div class="red">No links for this type</div>'; $addfield = '<div id="pat-%1$s" class="addbox" style="margin-bottom:10px;">'; $addfield .= 'Product ID/Code <input type="text" name="pladd" /> '; $addfield .= '<input type="button" name="pladdbtn" value="Add" /> or ';