Jump to content
Johnson

Master Products - MS2

Recommended Posts

I was looking at my Cross Sell installation and see that it is working because I have the first product (the one that the cross sell is to show on) set by the Master Product - and then the cross sell product is the slave.

 

I can't do that with the 2gether Discount thought because it has you add both products to the cart at the same time with a "buy now" button. The Master Product is not a purchasable product - only the slaves are.

 

Any thoughts? I'm at a loss here :blush:

 

I'm guessing what I need to change is the following query ??

$together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ."  where product_1_id = '" . (int)$_GET['products_id'] . "' or product_2_id = '" . (int)$_GET['products_id'] . "' and status = 1");
$num_together = tep_db_num_rows($together_query);
if ($num_together > 0) {
 $record = tep_db_fetch_array($together_query);
 $discount = $record['discount'];
 $discount_type = $record['type'];
 //edit for SPPC
 if ($customer_group_id != '0'){
 $aq ="select p.products_id, p.products_image, IF(pg.customers_group_price IS NOT NULL, pg.customers_group_price, p.products_price) as products_price, pd.products_name from " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."' and pg.customers_group_id = '".$customer_group_id."'";
 }else{
 $bq ="select p.products_id, p.products_image, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";
 }//end edit for SPPC
}

 

Is there a way to tell the query that the products_id should be equal to a slave of the (int)$_GET['products_id'] ?? :huh:


~Tracy
 

Share this post


Link to post
Share on other sites

Along the lines of attempting to get the 2gether discount working along with Master Products - I know somehow I need to change the query so that it is looking for slaves of $_GET['product_id'].

 

But I also need to edit the includes/application_top.php to add both items to the cart. Both items are slave items - so I'm guessing I need to edit the case 'add_slave' :

 

Here is what I currently have for this attempt - but I'm getting an error that there is an unexpected '{' and I can't seem to locate it :(

case 'add_slave' :
						  reset($HTTP_POST_VARS);
						  while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) {
							if (substr($key,0,11) == "Qty_ProdId_") {
							  $prodId = substr($key,11);
							  $qty = $val;
							  if(isset($HTTP_POST_VARS["id_$prodId"]) && is_array($HTTP_POST_VARS["id_$prodId"])) {
								// We have attributes
								$cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId,$HTTP_POST_VARS["id_$prodId"]))+$qty, $HTTP_POST_VARS["id_$prodId"]);
							  } else {
								// No attributes
								$cart->add_cart($prodId, $cart->get_quantity($prodId)+$qty);
							  }
							  if (isset($HTTP_POST_VARS['buy_tinn_add']) && is_numeric($HTTP_POST_VARS['buy_tinn_add'])) {
								if (tep_has_product_attributes($HTTP_POST_VARS['buy_tinn_add'] && is_numeric($HTTP_POST_VARS['buy_tinn_add'])){
								  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_POST_VARS['buy_tinn_add'] && is_numeric($HTTP_POST_VARS['buy_tinn_add'])) }
								 }else{
								if (isset($HTTP_POST_VARS['buy_tinn_add']) && is_numeric($HTTP_POST_VARS['buy_tinn_add'])) {
								$cart->add_cart($ HTTP_POST_VARS['buy_tinn_add'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['buy_tinn_add'], $HTTP_POST_VARS['id'))+1, $HTTP_POST_VARS['id']);
							}
						  }
						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;

 

This is what is listed to be done to your application_top.php file on the 2gether discount contribution page:

in application_top.php add in the big case :

case 'buy_tinnx' : if (isset($_GET['products_id'])) {
if (tep_has_product_attributes($_GET['products_id'])) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id']));
} else {
if (tep_get_products_stock($_GET['products_id']) > 0) {
$cart->add_cart($_GET['products_id'], $cart->get_quantity($_GET['products_id'])+1);
}
}
}
if (isset($_GET['buy_tinn_add'])) {
if (tep_has_product_attributes($_GET['buy_tinn_add'])) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['buy_tinn_add']));
} else {
if (tep_get_products_stock($_GET['buy_tinn_add']) > 0) {
$cart->add_cart($_GET['buy_tinn_add'], $cart->get_quantity($_GET['buy_tinn_add'])+1);
}
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;

so that both products are added to the basket.

 

But the only example of this I've been able to download was changed for the $HTTP_POST_VARS rather than the $_GET (I'm not sure what difference it makes, but I'm assuming the $HTTP_POST_VARS is more appropriate as that seems to be throughout the application_top.php file) and it doesn't have anything for if the product has attributes.

 

//// bof: Added 2gether (contribution 3929)
case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
if (tep_get_products_stock($HTTP_POST_VARS['products_id']) > 0) $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
}
if (isset($HTTP_POST_VARS['buy_tinn_add']) && is_numeric($HTTP_POST_VARS['buy_tinn_add'])) {
if (tep_get_products_stock($HTTP_POST_VARS['buy_tinn_add']) > 0) {
$cart->add_cart($HTTP_POST_VARS['buy_tinn_add'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['buy_tinn_add'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
////  eof: Added 2gether (contribution 3929)

 

So I'm attempting to combine what I was able to download + the instructions + merge it into the add_slave case and I'm having a heck of a time. >_<

 

Can somebody please help to me get the 2gether Discount contrib. working with Master Products? :blush:


~Tracy
 

Share this post


Link to post
Share on other sites
Along the lines of attempting to get the 2gether discount working along with Master Products - I know somehow I need to change the query so that it is looking for slaves of $_GET['product_id'].

 

But I also need to edit the includes/application_top.php to add both items to the cart. Both items are slave items - so I'm guessing I need to edit the case 'add_slave' :

 

So I'm attempting to combine what I was able to download + the instructions + merge it into the add_slave case and I'm having a heck of a time. >_<

 

Can somebody please help to me get the 2gether Discount contrib. working with Master Products? :blush:

 

PS - using what was listed on the contribution page or using the example I was able to download both result in not adding any items to the cart.


~Tracy
 

Share this post


Link to post
Share on other sites

Here is the includes/modules/2gether.php file in it's entirety - how do I correct the queries and should I change the "buy now" button in order to get it to work for slave products?

 

<?php
if (!$together_id) $together_id = $_GET['products_id'];
if ($together_id) {
include(DIR_WS_LANGUAGES . $language . '/2gether.php');
global $sppc_customer_group_id;
$show_money_savings = true; // show money savings
$show_percentage_savings = true; // show percentage savings
$show_original_prices = true; // show origibal prices of the products

//BOF Separate Pricing Per Customer
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
}else{
$customer_group_id = $sppc_customer_group_id;
}
?>
<tr>
<td>
<?php
$together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ."  where (product_1_id = '" . $together_id . "' or product_2_id = '" . $together_id . "') and status = 1");
$num_together = tep_db_num_rows($together_query);
if ($num_together > 0) {
 $record = tep_db_fetch_array($together_query);
 $discount = $record['discount'];
 $discount_type = $record['type'];
 if ($record['product_1_id'] == $together_id) {
if ($customer_group_id != '0') {
$aq ="select p.products_id, p.products_image, IF(pg.customers_group_price IS NOT NULL, pg.customers_group_price, p.products_price) as products_price,  p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."' and pg.customers_group_id = '".$customer_group_id."' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0";
$bq ="select p.products_id, p.products_image, IF(pg.customers_group_price IS NOT NULL, pg.customers_group_price, p.products_price) as products_price,  p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."' and pg.customers_group_id = '".$customer_group_id."' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0";
 } else {
 $aq ="select p.products_id, p.products_image, p.products_price,  p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0";
 $bq ="select p.products_id, p.products_image, p.products_price,  p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0";
 }
}
 $product_a_query = tep_db_query($aq);
 $product_a = tep_db_fetch_array($product_a_query);
 $product_b_query = tep_db_query($bq);
 $product_b = tep_db_fetch_array($product_b_query);

 if ($discount > 0) {

$together_image = '<img src=' . DIR_WS_IMAGES . 'save-icon_blink.gif alt="$" title="$">';
if (stristr(basename($PHP_SELF),'b2offers')) {
  $together_text = '';
} else {
  $together_text = TOGETHER_HEADING_TEXT_SPECIAL_OFFER . '<br>';
}

  if (($show_money_savings) or ($show_percentage_savings)) {
$together_savings_string = TOGETHER_TEXT_YOU_SAVE;
  } else {
$together_savings_string = '';
  }
if ($discount_type == 'p') {
  $together_price = tep_round(($product_a['products_price'] + $product_b['products_price']) * (100-$discount)/100, 6);
  if ($show_money_savings) {
	   $together_savings = $product_a['products_price'] + $product_b['products_price'] - $together_price;
	   $together_savings_string .= $currencies->display_price($together_savings, tep_get_tax_rate($product_a['products_tax_class_id']));
  }
  if ($show_percentage_savings) {
	   $together_savings_string .= ' ' . $discount . '%';
  }
} else {
   $together_price = tep_round($product_a['products_price'] + $product_b['products_price'] - $discount,6);
   if ($show_money_savings) {
	 $together_savings = $product_a['products_price'] + $product_b['products_price'] - $together_price;
	 $together_savings_string .= $currencies->display_price($together_savings, tep_get_tax_rate($product_a['products_tax_class_id']));
   }
   if ($show_percentage_savings) {
	 $together_percentage = ($discount /($product_a['products_price'] + $product_b['products_price']))*100;
	 $together_savings_string .= ' ' . $together_percentage . '%';
   }
  }
 } else {
  $together_price = tep_round(($product_a['products_price'] + $product_b['products_price']), 6);
  $together_savings_string = '';
  $together_image = '<img src=' . DIR_WS_IMAGES . 'info_blue_small.jpg alt="i" title="i">';
  $together_text = '<font color="orange">'.TOGETHER_HEADING_TEXT_SUGGESTION . '</font><br>';
}
$together_string = $currencies->display_price($together_price, tep_get_tax_rate($product_a['products_tax_class_id']));

ob_start();
echo '<table width="80%" class="borderGray" cellpadding="2" align="center">' .
'<tr>
 <td valign="top" width="1px" align="left">' . $together_image . '</td>' . 
'<td colspan="5" class="pageHeading">' . $together_text . TOGETHER_TEXT_BUY . ' <a href="' . tep_href_link('product_info.php', 'products_id=' . $product_a['products_id']) . '">' . str_replace('\'','`',$product_a['products_name']) . ' ' . tep_image('images/ico_arrow.gif', ICON_ARROW_RIGHT) . '</a> ' . TOGETHER_TEXT_AND . ' <a href="' . tep_href_link('product_info.php', 'products_id=' . $product_b['products_id']) . '">' . str_replace('\'','`',$product_b['products_name']) . ' ' . tep_image('images/ico_arrow.gif', ICON_ARROW_RIGHT) . '</a></td>' . 
'</tr>
<tr>
 <td></td>' . 
'<td width="80px" align="center">';?>
<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_a['products_id']) . 'ℑ=0\\\')">' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_a['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>
</noscript> 
<?php 
if ($show_original_prices) echo '<br>'.$currencies->display_price($product_a['products_price'], tep_get_tax_rate($product_a['products_tax_class_id']));
echo '</td><td align="center" width="100px"><img src="images/icon_plus.gif" border="0" style="vertical-align: middle"></td>' .
'<td width="80px" align="center">';?>
<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_b['products_id']) . 'ℑ=0\\\')">' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_b['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>
</noscript>
<?php
if ($show_original_prices) echo '<br>'.$currencies->display_price($product_b['products_price'], tep_get_tax_rate($product_b['products_tax_class_id']));
echo '</td><td width="2%"></td>'.
'<td align="middle" nowrap valign="middle" class="buybothText">' . TOGETHER_TEXT_TOGETHER . ' ' . '<font color=#00>'.$together_string . '</font><br>'; 
echo tep_draw_form('together', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'));
echo tep_draw_hidden_field('products_id', $product_a['products_id']) . tep_draw_hidden_field('buy_tinn_add', $product_b['products_id']) . tep_image_submit('button_buy_now.gif', 'Add Them Together');
echo '</form>';
echo '<table>';
if ($discount > 0) echo '<tr><td class="buybothText" nowrap align="center"><font color="red">' . $together_savings_string . '</font></td></tr><tr><td class="vsmalltext" nowrap align="center">(Receive your discount at checkout)</td></tr>';
echo '</table>';
echo '</td></tr>';
echo '</table>';
$contents = ob_get_clean();
echo  $contents;
echo '</td></tr>';
}
}
?>


~Tracy
 

Share this post


Link to post
Share on other sites
Here is the includes/modules/2gether.php file in it's entirety - how do I correct the queries and should I change the "buy now" button in order to get it to work for slave products?

 

I'm starting to run out of ideas on how to tweak the query :(

 

Here are my two most recent attempts at getting this to show up when the $_GET['products_id'] is the ID of the Master Product - but the 2gether Discount product_id's are slave products :blink:

 

<?php
if (!$together_id) $together_id = $_GET['products_id'];
if ($together_id) {
include(DIR_WS_LANGUAGES . $language . '/2gether.php');
global $sppc_customer_group_id;
$show_money_savings = true; // show money savings
$show_percentage_savings = true; // show percentage savings
$show_original_prices = true; // show origibal prices of the products

//BOF Separate Pricing Per Customer
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
}else{
$customer_group_id = $sppc_customer_group_id;
}
?>
<tr>
<td>
<?php
$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master LIKE  '%" . $HTTP_GET_VARS['products_id'] . "%'");
$thisquery = tep_db_fetch_array($master_query);
if ($results['products_id'] != null){
$together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ."  where (product_1_id = '" . $thisquery['master_query'] . "' or product_2_id = '" . $thisquery['master_query'] . "') and status = 1");
}
$num_together = tep_db_num_rows($together_query);
if ($num_together > 0) {
 $record = tep_db_fetch_array($together_query);
 $discount = $record['discount'];
 $discount_type = $record['type'];
 if ($record['product_1_id'] == $together_query) {
if ($customer_group_id != '0') {
$aq ="select p.products_id, p.products_image, IF(pg.customers_group_price IS NOT NULL, pg.customers_group_price, p.products_price) as products_price,  p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."' and pg.customers_group_id = '".$customer_group_id."'";
$bq ="select p.products_id, p.products_image, IF(pg.customers_group_price IS NOT NULL, pg.customers_group_price, p.products_price) as products_price,  p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."' and pg.customers_group_id = '".$customer_group_id."'";
 } else {
 $aq ="select p.products_id, p.products_image, p.products_price,  p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";
 $bq ="select p.products_id, p.products_image, p.products_price,  p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";
 }
}
 $product_a_query = tep_db_query($aq);
 $product_a = tep_db_fetch_array($product_a_query);
 $product_b_query = tep_db_query($bq);
 $product_b = tep_db_fetch_array($product_b_query);

 

and

 

<?php
$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master LIKE  '%" . $HTTP_GET_VARS['products_id'] . "%'");
if (!$together_id) $together_id = tep_db_fetch_array($master_query);
if ($together_id) {
include(DIR_WS_LANGUAGES . $language . '/2gether.php');
global $sppc_customer_group_id;
$show_money_savings = true; // show money savings
$show_percentage_savings = true; // show percentage savings
$show_original_prices = true; // show origibal prices of the products

//BOF Separate Pricing Per Customer
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
}else{
$customer_group_id = $sppc_customer_group_id;
}
?>
<tr>
<td>
<?php
$together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ."  where (product_1_id = '" . $together_id . "' or product_2_id = '" . $together_id . "') and status = 1");
$num_together = tep_db_num_rows($together_query);
if ($num_together > 0) {
 $record = tep_db_fetch_array($together_query);
 $discount = $record['discount'];
 $discount_type = $record['type'];
 if ($record['product_1_id'] == $together_id) {
if ($customer_group_id != '0') {
$aq ="select p.products_id, p.products_image, IF(pg.customers_group_price IS NOT NULL, pg.customers_group_price, p.products_price) as products_price,  p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."' and pg.customers_group_id = '".$customer_group_id."'";
$bq ="select p.products_id, p.products_image, IF(pg.customers_group_price IS NOT NULL, pg.customers_group_price, p.products_price) as products_price,  p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."' and pg.customers_group_id = '".$customer_group_id."'";
 } else {
 $aq ="select p.products_id, p.products_image, p.products_price,  p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";
 $bq ="select p.products_id, p.products_image, p.products_price,  p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";
 }
}
 $product_a_query = tep_db_query($aq);
 $product_a = tep_db_fetch_array($product_a_query);
 $product_b_query = tep_db_query($bq);
 $product_b = tep_db_fetch_array($product_b_query);

 

Both of the above result in no 2gether discount table being shown through product_info.php whether I'm viewing the master or the slave according to the products_id in the URL (original shows up only if I click to the slave product page).

 

Anybody have any ideas on how to get this to show up when the products_id in the URL is the Master Product? :huh:


~Tracy
 

Share this post


Link to post
Share on other sites

I'm getting double entries in the Slave Products. I think I added the master.sql twice, but do not know where to look. I've called myself looking in all the database, but am a newbie and need a pointer.

 

dblist.gif

 

Help,

Thanks


Sterling (a.k.a. DailyLunatic)

Useful Threads: Basics for Design.

Useful URL's: Knowledge Base, SQL Tutorial,

My Setup: Master Products v1.2, Need help installing Bundled Products v1.4.

Share this post


Link to post
Share on other sites
I'm getting double entries in the Slave Products. I think I added the master.sql twice, but do not know where to look. I've called myself looking in all the database, but am a newbie and need a pointer.

 

dblist.gif

 

Help,

Thanks

 

Go to your database and open the Configuration table. Sort the table by configuration_key (if you use phpMyAdmin you can simply click on the heading configuration_key and it will sort by that column). Look for all rows where the configuration_key starts with MASTER_LIST_ Then delete the duplicates. When I had this problem I deleted with the duplicates with the higher number under configuration_key. They are assigned numbers as they are inserted into the database, so the higher the number, the newer that row is :thumbsup:


~Tracy
 

Share this post


Link to post
Share on other sites
Go to your database and open the Configuration table. Sort the table by configuration_key (if you use phpMyAdmin you can simply click on the heading configuration_key and it will sort by that column). Look for all rows where the configuration_key starts with MASTER_LIST_ Then delete the duplicates. When I had this problem I deleted with the duplicates with the higher number under configuration_key. They are assigned numbers as they are inserted into the database, so the higher the number, the newer that row is :thumbsup:

 

huh.jpg


Sterling (a.k.a. DailyLunatic)

Useful Threads: Basics for Design.

Useful URL's: Knowledge Base, SQL Tutorial,

My Setup: Master Products v1.2, Need help installing Bundled Products v1.4.

Share this post


Link to post
Share on other sites

Sorry, hit the button too soon.

 

(if you use phpMyAdmin you can simply click on the heading configuration_key and it will sort by that column).

Which is the "heading" you are talking about? I've tried clicking on each with no luck.

 

Sorry,


Sterling (a.k.a. DailyLunatic)

Useful Threads: Basics for Design.

Useful URL's: Knowledge Base, SQL Tutorial,

My Setup: Master Products v1.2, Need help installing Bundled Products v1.4.

Share this post


Link to post
Share on other sites

hello,

 

how can i remove quantity drop down box in MASTER? --> has $0.00 PRICE

 

i have eg, MASTER A --> slave 1, 2, 3 (each have it own quantity and price)

 

when i all upload, i get quantity drop drop down box on BOTH master and slave!

 

since if customer chose any quantity on master and click on 'add to cart" they will get the item for FREE...

 

Uh?

 

to see what i mean please go to:

 

My Webpage

 

please help....spend whole day reading up to page 30 on the support threat to find the solution no luck!

 

michael

Share this post


Link to post
Share on other sites
hello,

 

how can i remove quantity drop down box in MASTER? --> has $0.00 PRICE

 

i have eg, MASTER A --> slave 1, 2, 3 (each have it own quantity and price)

 

when i all upload, i get quantity drop drop down box on BOTH master and slave!

 

since if customer chose any quantity on master and click on 'add to cart" they will get the item for FREE...

 

Uh?

 

to see what i mean please go to:

 

My Webpage

 

please help....spend whole day reading up to page 30 on the support threat to find the solution no luck!

 

michael

 

I'm not positive if this is what you are looking for or not - but read this post: http://forums.oscommerce.com/lofiversion/i...67284-1350.html

 

If it helps you any, I've found the easiest way to search the forums to see if anyone else has experienced whatever I'm dealing with at the time is to use the google tip found here:

http://forums.oscommerce.com/index.php?showtopic=222140

 

That's how I found the post listed above :thumbsup: My Master Products are not purchasable, but I honestly don't remember what I did to make them that way - but at least it can be done :blush:


~Tracy
 

Share this post


Link to post
Share on other sites
Sorry, hit the button too soon.

 

 

Which is the "heading" you are talking about? I've tried clicking on each with no luck.

 

Sorry,

 

you need to be browsing the table for the heading to work, like this:

 

pmabrowse.gif

Share this post


Link to post
Share on other sites

WooHoo!!!... Finally got everything installed (thanks all) and at first glance seems to be working.

 

I am starting up a T-Shirt site and will be matching the design transfer to the t-shirt after sale. I would like to have OSC track inventory on each.

 

I gave qty 1 to both a test master design (no cost) and test slave shirt (costed & hidden) and ran them through a sale, I now have the following issue...

 

Only slave showed in the invoice, packing list, and reduced inventory.

 

1] There is no way to tell what design the customer was wanting.

2] Master did not reduce inventory.

 

Is this the way Master Products is intended to work, or is there an issue with it?

 

Thanks,


Sterling (a.k.a. DailyLunatic)

Useful Threads: Basics for Design.

Useful URL's: Knowledge Base, SQL Tutorial,

My Setup: Master Products v1.2, Need help installing Bundled Products v1.4.

Share this post


Link to post
Share on other sites

My first ever posting on any oscommerce forum so please be gentle with an absoloute beginner!

Having read this support thread I have managed to install and configure Master Products and have it working perfectly, (brilliant addition - many thanks).

 

My query is: When I set up slaves, they all have '1' selected as the default number for customer purchase. If I have 10 slaves under the master, with 10 T-shirts in various sizes or colours, the customer automatically adds 1 of each, (ie 10 in total), to his cart if he simply clicks Add to Cart.

Is there ay way of setting the default slect to zero, meaning the customer has to physically enter the number he wants next to the slave he wishes to buy?

 

Huge apologies if this has been covered but I truly have tried to read through every contribution to find the answer to this one!


My contributions: http://addons.oscommerce.com/info/6319 - 1104 Error Fix

Share this post


Link to post
Share on other sites

Yes, that's certainly possible (if I understand correctly). I had this complaint as well. I actually ended up using a Buy It button instead of the default set up, which required a lot of modification and I won't go into it here...that being said here's your fix:

 

Go into the file catalog/includes/modules/master_listing.php and look for this:

 

 for ($i=0; $ns = 20, $i <= $ns; $i++) {
				$qty_array[] = array('id' => $i, 'text' => $i);

							$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '1', 'size="4"');

		}
	  } else {
		$quantity = tep_get_products_stock($listing['products_id']);  
		$qty_array = array();
		for ($i=0; $ns = (($quantity < 20) ? $quantity : 20), $i <= $ns; $i++) {
				$qty_array[] = array('id' => $i, 'text' => $i);

							$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '1', 'size="4"');

 

Change to this:

 

 for ($i=0; $ns = 20, $i <= $ns; $i++) {
				$qty_array[] = array('id' => $i, 'text' => $i);

							$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0', 'size="4"');

		}
	  } else {
		$quantity = tep_get_products_stock($listing['products_id']);  
		$qty_array = array();
		for ($i=0; $ns = (($quantity < 20) ? $quantity : 20), $i <= $ns; $i++) {
				$qty_array[] = array('id' => $i, 'text' => $i);

							$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0', 'size="4"');

 

My first ever posting on any oscommerce forum so please be gentle with an absoloute beginner!

Having read this support thread I have managed to install and configure Master Products and have it working perfectly, (brilliant addition - many thanks).

 

My query is: When I set up slaves, they all have '1' selected as the default number for customer purchase. If I have 10 slaves under the master, with 10 T-shirts in various sizes or colours, the customer automatically adds 1 of each, (ie 10 in total), to his cart if he simply clicks Add to Cart.

Is there ay way of setting the default slect to zero, meaning the customer has to physically enter the number he wants next to the slave he wishes to buy?

 

Huge apologies if this has been covered but I truly have tried to read through every contribution to find the answer to this one!


Installed Modules:

Dynamenu, InfoBox Admin, Master Products v.1.2, Header Tags Controller, Multiple Products Manager, Quick Edit in Admin, Secure Admin, Ultimate SEO URL's, EZ Secure Order, Easy Populate v.2.76d MS2, AuthorizeNet_AIM, ChangeFinal Breadcrumb Title, FedEx Labels, Fedex Direct 2.06, How Did you Hear 1.5, Login a la Amazon, UPS XML 1.2.4, USPS Labels, USPS Methods API MS2

Share this post


Link to post
Share on other sites
Yes, that's certainly possible (if I understand correctly). I had this complaint as well. I actually ended up using a Buy It button instead of the default set up, which required a lot of modification and I won't go into it here...that being said here's your fix:

 

Go into the file catalog/includes/modules/master_listing.php and look for this:

 

 for ($i=0; $ns = 20, $i <= $ns; $i++) {
				$qty_array[] = array('id' => $i, 'text' => $i);

							$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '1', 'size="4"');

		}
	  } else {
		$quantity = tep_get_products_stock($listing['products_id']);  
		$qty_array = array();
		for ($i=0; $ns = (($quantity < 20) ? $quantity : 20), $i <= $ns; $i++) {
				$qty_array[] = array('id' => $i, 'text' => $i);

							$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '1', 'size="4"');

 

Change to this:

 

 for ($i=0; $ns = 20, $i <= $ns; $i++) {
				$qty_array[] = array('id' => $i, 'text' => $i);

							$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0', 'size="4"');

		}
	  } else {
		$quantity = tep_get_products_stock($listing['products_id']);  
		$qty_array = array();
		for ($i=0; $ns = (($quantity < 20) ? $quantity : 20), $i <= $ns; $i++) {
				$qty_array[] = array('id' => $i, 'text' => $i);

							$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0', 'size="4"');


My contributions: http://addons.oscommerce.com/info/6319 - 1104 Error Fix

Share this post


Link to post
Share on other sites

In the slave section, (productinfo.php), on top of each column, theres a heading... Name, model, price... etc.

Is there a way to remove the links. They are all links that change the order, is there a way to stop it from doing that?

 

Please let me know.

 

Thanks in advance.

Share this post


Link to post
Share on other sites

Another question...

 

 

Lets say I have a product with three different styles.

Each style has 5 colors.

I wanna show all the colors under each style.

Is there a way to divide that?

Share this post


Link to post
Share on other sites

Hello,

 

I got a problem during import the sql in to my db....I'm using the master product 1.12 ...this is the error:

Errore
query SQL: 

INSERT INTO configuration_group
VALUES ( 16, 'Slave Products', 'Slave Product Listing - configuration options', 16, 1 );



Messaggio di MySQL:  

#1062 - Duplicate entry '16' for key 1

What can i do?

 

 

thx

Share this post


Link to post
Share on other sites
Errore
query SQL: 

INSERT INTO configuration_group
VALUES ( 16, 'Slave Products', 'Slave Product Listing - configuration options', 16, 1 );
Messaggio di MySQL:  

#1062 - Duplicate entry '16' for key 1

What can i do?

thx

Replace 16 with the result of select count(*)+1 from configuration_group;?

 

Hope that helps,

MJR

Share this post


Link to post
Share on other sites
Replace 16 with the result of select count(*)+1 from configuration_group;?

 

Hope that helps,

MJR

 

 

Can you explain better...? sorry but i'm not a real php programmer...

 

thanks for ur support!!

Share this post


Link to post
Share on other sites

it's not php it's sql :) In the sql file find the line that says INSERT INTO configuration_group

VALUES ( 16, 'Slave Products', 'Slave Product Listing - configuration options', 16, 1 ); and change the 16 for whatever the next number is in the configuration_group table. I think if you put '' instead of 16 it would auto-increment but I can't be certain.

Edited by trogette

Share this post


Link to post
Share on other sites

Hi i need in MP make a change

 

before:

 

model..........description..............stock.........price

 

change to this

 

model........................................stock.........price

description........................................................

 

model........................................stock.........price

description........................................................

 

model........................................stock.........price

description........................................................

 

Can me someone help.

thnx

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×