Hi there,
first post :)
I'm tryin' to add the Master Product contrib to my store that alreadyhas the TotalB2B contrib. I can easyly edit some files, but i think on some other the two contribs overlap.
For example in /includes/modules/new_product.php
this is the beginning of my code:
<!-- new_products //-->
<?php
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
new infoBoxHeading($info_box_contents, false, false, false, $column_location);
?>
<?php
//TotalB2B start
if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, p.products_price from " . TABLE_PRODUCTS . " p where products_status = '1' and vetrina = '1' order by rand() desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
// $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by rand() DESC limit " . MAX_DISPLAY_NEW_PRODUCTS);
} else {
$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and vetrina = '1' order by rand() desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
}
//TotalB2B end
$row = 0;
$col = 0;
$info_box_contents = array();
and for master products should be:
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));
//Master Products
new infoBoxHeading($info_box_contents, false, true);
if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_listing_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
} else {
$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and products_listing_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
}
//Master Products EOF
$row = 0;
$col = 0;
$info_box_contents = array();
i'm new to php, so i don't know how to procede.
Anyone has already done this? There are 3/4 files that are in conflict, and i'm stuck with them...
thanks in advance for you help
Moloko