Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Master Products - MS2


Guest

Recommended Posts

I'm sure mine works like that as default.

 

Actually I don't know if it's default or not but I have this code in currencies.php which I think does the job:

 

//Master Products
function display_price($products_price, $products_tax, $quantity = 1) {
	if($products_price == '0') {
  return '';
} else {		
  return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
   }
//Master Products EOF

 

before 2 } brackets and the closing ?> at the end.

Link to comment
Share on other sites

I've been trying to get Master Products to work in my heavily modified OSC-MS2 site. I was able to sucessfully get the mod to work except for 1 problem. I am unable to get Products to be added to the shopping cart from product_info.php.

 

I'd like to be clear on what I mean by Products. A product is an item in the catalog that is neither a master nor a slave. I've read a lot of posts about others having the same problem that I'm having and I'm wondering if it isn't clear that the issue is with "products" not being added into the cart.

 

In my trouble shooting I've noticed that the logic in MP in the product_listing.php handles products differently then masters and slaves.

 

I've noticed in product_listing.php, all items added to the cart use "add_slave" as the action. "Products" that used to use "buy_now" are using code that looks like it was intended for Masters/Slaves. I have been focusing my efforts on what heppens when a product use the add_slave code and why it doesn't get added in my install.

 

Now, if I change the action from add_slave to "buy_now" in product_info, the product is added to the cart just fine (of course slaves are not at that point).

 

I've put quite a few hours into solving my problem and have come up with a solution that I think works. What I've done is basically combine the add_slave and buy_now functions in application_top.php. I'll post my changes as soon as I get more convinced that it is working ;-). In my dev environment everything for me is working like a charm now.

 

I'd sure like for some others to try the changes that I made to see if there is something I'm missing. There's got to be a hole in what I've done but it's pretty neat to see products, masters and slaves using the same action to get added to the cart.

 

Please post any comments about this and I'll try to get something posted in the next couple of days for the changes I've made.

Link to comment
Share on other sites

I've been trying to get Master Products to work in my heavily modified OSC-MS2 site. I was able to sucessfully get the mod to work except for 1 problem. I am unable to get Products to be added to the shopping cart from product_info.php.

 

I'd like to be clear on what I mean by Products. A product is an item in the catalog that is neither a master nor a slave. I've read a lot of posts about others having the same problem that I'm having and I'm wondering if it isn't clear that the issue is with "products" not being added into the cart.

 

In my trouble shooting I've noticed that the logic in MP in the product_listing.php handles products differently then masters and slaves.

 

I've noticed in product_listing.php, all items added to the cart use "add_slave" as the action. "Products" that used to use "buy_now" are using code that looks like it was intended for Masters/Slaves. I have been focusing my efforts on what heppens when a product use the add_slave code and why it doesn't get added in my install.

 

Now, if I change the action from add_slave to "buy_now" in product_info, the product is added to the cart just fine (of course slaves are not at that point).

 

I've put quite a few hours into solving my problem and have come up with a solution that I think works. What I've done is basically combine the add_slave and buy_now functions in application_top.php. I'll post my changes as soon as I get more convinced that it is working ;-). In my dev environment everything for me is working like a charm now.

 

I'd sure like for some others to try the changes that I made to see if there is something I'm missing. There's got to be a hole in what I've done but it's pretty neat to see products, masters and slaves using the same action to get added to the cart.

 

Please post any comments about this and I'll try to get something posted in the next couple of days for the changes I've made.

 

I'm having the same issue so pls post any solution you got =D

Link to comment
Share on other sites

  • 2 weeks later...

I was unable to fix that same problem so I had to uninstall this contribution. Seems like I've heard a lot about people having this installed on their carts and I can't imagine that so many would put up with such a bug. I really need this kind of functionality so I'm hoping some kind person can help fix it. I tried but I'm just learning php...

 

Hope someone can help out. I would be eternally grateful!

Kendall

Brooklyn, New York USA

Link to comment
Share on other sites

Ok - I need to modify the Master Products contrib a little. Hopefully somebody will know how to do this :D

 

I am using AllProducts contrib for an A-Z Product Listing page. When I view this page I get both the master and the slaves. Same thing if I click on a category - the resulting page shows me both the master products and the slave products.

 

Now - the slave products are simply different sizes of the same thing. (ie - 4oz and 8oz bottles). I am using the "Master" status as the main description for that product, and then visitors can purchase one of the slave products (master is not purchasable). If I click on the Master product name I get exactly what I wanted, which is the product description and the option to purchase the slave products (not the master product).

 

So - what I need to have happen, is on the All Products page as well as on the page that results from clicking on a category link - If there is a Master product, then only show the Master Product, else, if there is NO Master Product, show the product. Slaves will only be shown on the page you get when you click the name of the Master Product. I am going to remove the "Buy Now" buttons from the All Products page and the first product listing page that you get when you click on a category since Masters are not purchasable. This way, when someone clicks on the product or Master that they are interested in, they can purchase it from the resulting page.

 

Does this make sense? I can send you a link to the test site with a "path" to follow through on the site so you can see what I mean if I wasn't very clear here :)

 

 

Oh - as for the problems in the previous post, if you click on your products name (the one that is neither Master no Slave) and then choose to add to cart from the resulting page it should work (it does on mine). So that issue seems to be specific only to certain pages?

 

Tracy

~Tracy
 

Link to comment
Share on other sites

So - what I need to have happen, is on the All Products page as well as on the page that results from clicking on a category link - If there is a Master product, then only show the Master Product, else, if there is NO Master Product, show the product. Slaves will only be shown on the page you get when you click the name of the Master Product. I am going to remove the "Buy Now" buttons from the All Products page and the first product listing page that you get when you click on a category since Masters are not purchasable. This way, when someone clicks on the product or Master that they are interested in, they can purchase it from the resulting page.

 

Tracy

 

Well - I thought I might have found a way to do this by setting the slave product listing status to 0 - but the slave products still show. Does anybody know what bit of code on what page is supposed to tell the product_listing page not to show products with a product_status of 0?

 

Tracy

~Tracy
 

Link to comment
Share on other sites

hi Tracy,

In ur allprods page n category page(index page if u using the default to show categories) there r queries in which u should add products_master=1 which should take care of ur prob....if u read the previous posts its clearly mentioned....u didnt have to change ur product_status to 0

Simple Add-ons Please add simple plain tips here for others.
Link to comment
Share on other sites

hi Tracy,

In ur allprods page n category page(index page if u using the default to show categories) there r queries in which u should add products_master=1 which should take care of ur prob....if u read the previous posts its clearly mentioned....u didnt have to change ur product_status to 0

 

I apologize, but I have even searched with Google for products_master=1 in any osCommerce forum and it comes up blank. I've been reading through the thread- but with 80 pages this takes a while and I may have missed something. :blush:

 

Do you know what line of code I am looking for? I cannot find products_master= anything on the index page. I can find p.products_master as something that needs to be pulled from the database, but I don't know where to put the =1 in at.

 

I might have used the wrong term with categories - my categories menu is dynamenu - what I meant is when you click on a category that has products - which I believe shows up on the products_listing.php include page, it is showing both the master and the slaves (I only want the master to show here) - and then clicking a product from that point gives you the products_info.php include page - is that right? So do I need to add / change code on products_listing.php - or will changing it on index.php be enough?

 

I'm going to do a google search on using MasterProducts and Allprods contrib's together to see if I need to modify the allprods page before I start looking at how to add the =1 somewhere.

 

Thank you,

Tracy

~Tracy
 

Link to comment
Share on other sites

hi Tracy,

In ur allprods page n category page(index page if u using the default to show categories) there r queries in which u should add products_master=1 which should take care of ur prob....if u read the previous posts its clearly mentioned....u didnt have to change ur product_status to 0

 

 

For example - in the product_listing.php file I have this bit of code:

 

//Master Products			
		if ($listing[$x]['products_master_status'] != '1' && $listing[$x]['products_master'] == '0') {
				$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
			} elseif ($listing[$x]['products_master'] != '0') {
	   		 $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_master']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
			} else {
				$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
			}
//Master Products EOF

 

Here it is telling the page what to do if the products_master is equal to 0 AND what to do if the products_master is Not equal to 0. Seems to me like that should cover it - but just in case I tried changing both 0's to 1's - and I still have the same result. Both master and slaves listed on the product_listing.php page.

 

Tracy

~Tracy
 

Link to comment
Share on other sites

hi Tracy,

In ur allprods page n category page(index page if u using the default to show categories) there r queries in which u should add products_master=1 which should take care of ur prob....if u read the previous posts its clearly mentioned....u didnt have to change ur product_status to 0

 

 

Ok - I just tried even changing the above code around to this:

 

//Master Products			
		if ($listing[$x]['products_master_status'] != '1' && $listing[$x]['products_master'] == '0') {
				$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
			} elseif ($listing[$x]['products_master_status'] == '1' && $listing[$x]['products_master'] != '0') {
	   		 $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_master']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
			} 
//Master Products EOF

 

changing the elseif statement and completely removing the else statement - and I still get both slaves and master in my product_listing.php portion of my page??

 

Tracy

~Tracy
 

Link to comment
Share on other sites

hi Tracy,

In ur allprods page n category page(index page if u using the default to show categories) there r queries in which u should add products_master=1 which should take care of ur prob....if u read the previous posts its clearly mentioned....u didnt have to change ur product_status to 0

 

Here is the section of code from my index.php page that I am guessing needs to be corrected since changing the product_listing.php page doesn't seem to do a thing :huh:

 

I have SPPC installed as well, and I'm wondering if that might be causing the problem?

 

<?php
 } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
					 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
					 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
					 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
					 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
					 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
					 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
					 'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

asort($define_list);

$column_list = array();
reset($define_list);
while (list($key, $value) = each($define_list)) {
  if ($value > 0) $column_list[] = $key;
}

// 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;
  }
  // this will build the table with specials prices for the retail group or update it if needed
  // this function should have been added to includes/functions/database.php
  if ($customer_group_id == '0') {
  tep_db_check_age_specials_retail_table(); 
  }
  $status_product_prices_table = false;
  $status_need_to_get_prices = false;

  // find out if sorting by price has been requested
  if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){
$_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
  $status_need_to_get_prices = true;
  }
  }

  if ($status_need_to_get_prices == true && $customer_group_id != '0') { 
  $product_prices_table = TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id;
  // the table with product prices for a particular customer group is re-built only a number of times per hour
  // (setting in /includes/database_tables.php called MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE, in minutes)
  // to trigger the update the next function is called (new function that should have been
  // added to includes/functions/database.php)
  tep_db_check_age_products_group_prices_cg_table($customer_group_id);
  $status_product_prices_table = true;   

  } // end if ($status_need_to_get_prices == true && $customer_group_id != '0')
// EOF Separate Pricing Per Customer

$select_column_list = '';

for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
  switch ($column_list[$i]) {
	case 'PRODUCT_LIST_MODEL':
	  $select_column_list .= 'p.products_model, ';
	  break;
	case 'PRODUCT_LIST_NAME':
	  $select_column_list .= 'pd.products_name, ';
	  break;
	case 'PRODUCT_LIST_MANUFACTURER':
	  $select_column_list .= 'm.manufacturers_name, ';
	  break;
	case 'PRODUCT_LIST_QUANTITY':
	  $select_column_list .= 'p.products_quantity, ';
	  break;
	case 'PRODUCT_LIST_IMAGE':
	  $select_column_list .= 'p.products_image, ';
	  break;
	case 'PRODUCT_LIST_WEIGHT':
	  $select_column_list .= 'p.products_weight, ';
	  break;
  }
}

// show the products of a specified manufacturer
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
// BOF Separate Pricing Per Customer
if ($status_product_prices_table == true) {
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";		
} else { // either retail or no need to get correct special prices
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
} // end else { // either retail...
// EOF Separate Pricing Per Customer
  } else {
// We show them all
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";	
} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m  left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
} // end else { // either retail...
// EOF Separate Pricing Per Customer
  }
} else {
// show the products in a given categorie
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory;  
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";	
	} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} // end else { // either retail...
// EOF Separate Pricing Per Customer
  } else {
// We show them all
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) {
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS . " p" . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} else { // either retail or no need to get correct special prices
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
  } // end else { // either retail...
// EOF Separate Pricing per Customer
  }
}

if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
  for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
	if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by pd.products_name";
	  break;
	}
  }
} else {
  $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
  $sort_order = substr($HTTP_GET_VARS['sort'], 1);
  $listing_sql .= ' order by ';
  switch ($column_list[$sort_col-1]) {
	case 'PRODUCT_LIST_MODEL':
	  $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_NAME':
	  $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
	  break;
	case 'PRODUCT_LIST_MANUFACTURER':
	  $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_QUANTITY':
	  $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_IMAGE':
	  $listing_sql .= "pd.products_name";
	  break;
	case 'PRODUCT_LIST_WEIGHT':
	  $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_PRICE':
	  $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
  }
}
?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<?php
// optional Product List Filter
if (PRODUCT_LIST_FILTER > 0) {
  if (isset($HTTP_GET_VARS['manufacturers_id'])) {
	$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
  } else {
	$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
  }
  $filterlist_query = tep_db_query($filterlist_sql);
  if (tep_db_num_rows($filterlist_query) > 1) {
	echo '			<td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' ';
	if (isset($HTTP_GET_VARS['manufacturers_id'])) {
	  echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
	  $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
	} else {
	  echo tep_draw_hidden_field('cPath', $cPath);
	  $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
	}
	echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
	while ($filterlist = tep_db_fetch_array($filterlist_query)) {
	  $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
	}
	echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
	echo '</form></td>' . "\n";
  }
}

// Get the right image for the top-right
$image = DIR_WS_IMAGES . 'table_background_list.gif';
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
  $image = tep_db_fetch_array($image);
  $image = $image['manufacturers_image'];
} elseif ($current_category_id) {
  $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
  $image = tep_db_fetch_array($image);
  $image = $image['categories_image'];
}
?>
		<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
  </tr>
</table></td>
<?php

 

~A completely lost Tracy :'(

~Tracy
 

Link to comment
Share on other sites

Here is the section of code from my index.php page that I am guessing needs to be corrected since changing the product_listing.php page doesn't seem to do a thing :huh:

 

I have SPPC installed as well, and I'm wondering if that might be causing the problem?

 

~A completely lost Tracy :'(

 

PS - I do have some products that do not have a master and I do need those products to show up (they aren't slaves or masters). Not sure if that makes a difference.

 

It is just really baffling me that no matter what I do to the product_listing.php page it makes absolutely no difference to what is pulled from the database and put into that particular table :(

 

Tracy

~Tracy
 

Link to comment
Share on other sites

PS - I do have some products that do not have a master and I do need those products to show up (they aren't slaves or masters). Not sure if that makes a difference.

 

It is just really baffling me that no matter what I do to the product_listing.php page it makes absolutely no difference to what is pulled from the database and put into that particular table :(

 

Tracy

 

Ah Hah!! I found an article somewhere in the forums on getting All Products and Master Products to play nice together - and that showed me where I needed to add and p.products_master_status = '1' in order to only display the masters. Then I just went in for products that didn't have a master, turned them into a master and created a new slave for the actual product. Works like a charm now! :thumbsup:

 

Tracy

~Tracy
 

Link to comment
Share on other sites

There seems to be a problem with taxes in slave products. Master products seem to have tax classes as normal, but I can't select tax for slave product? Does anyone have any idea what I should be looking for, if I'm trying to fix this.

Link to comment
Share on other sites

There seems to be a problem with taxes in slave products. Master products seem to have tax classes as normal, but I can't select tax for slave product? Does anyone have any idea what I should be looking for, if I'm trying to fix this.

 

Darn, I've just found the solution but can't delete the previous message. Sorry for the disturbance. For some reason I've missed the following piece of code from categories.php:

	while ($tax_class = tep_db_fetch_array($tax_class_query)) {
  $tax_class_array[] = array('id' => $tax_class['tax_class_id'],
							 'text' => $tax_class['tax_class_title']);
}

Link to comment
Share on other sites

I am attempting to link to products from text in the content area of a page. For some reason, the master product and description show when the link is clicked on - but the table of the slave products does not show :(

 

Here is the code I am using to create the links:

 

<a href="<?php echo tep_href_link('product_info.php?cPath=1_17_25&products_id=32', '', 'NONSSL'); ?>">

 

and

 

<a href="<?php echo tep_href_link('product_info.php?products_id=44', '', 'NONSSL'); ?>">

 

Both options give me the same results.

 

You can see it in action at http://mmherbs.dreamhosters.com

 

First - click on Women's Health > Pregnancy > Morning Sickness and then on Morning Sickness Balm

Notice the description at the top, and then the table of available products to purchase underneath.

 

Now - click on Women's Health and then just click the link in the text content to Morning Sickness Balm

Notice the description is still there, but the table of available products seems to disappear??

 

Any ideas?

~Tracy
 

Link to comment
Share on other sites

I am attempting to link to products from text in the content area of a page. For some reason, the master product and description show when the link is clicked on - but the table of the slave products does not show :(

 

Here is the code I am using to create the links:

 

<a href="<?php echo tep_href_link('product_info.php?cPath=1_17_25&products_id=32', '', 'NONSSL'); ?>">

 

and

 

<a href="<?php echo tep_href_link('product_info.php?products_id=44', '', 'NONSSL'); ?>">

 

Both options give me the same results.

 

You can see it in action at http://mmherbs.dreamhosters.com

 

First - click on Women's Health > Pregnancy > Morning Sickness and then on Morning Sickness Balm

Notice the description at the top, and then the table of available products to purchase underneath.

 

Now - click on Women's Health and then just click the link in the text content to Morning Sickness Balm

Notice the description is still there, but the table of available products seems to disappear??

 

Any ideas?

 

WooHoo!! I got it figured out - instead of using:

<a href="<?php echo tep_href_link('product_info.php?products_id=44', '', 'NONSSL'); ?>">

 

you need to use:

<a href="<?php echo tep_href_link('product_info.php', 'products_id=44&', 'NONSSL'); ?>">

 

apparently the way the line is read, the code automatically puts in a ? before whatever is in the second set of '' (between page.php and 'NONSSL') - so you need to remove the ?, put the products info into that second set of '' and append the & sign at the end so it will put the osCsid in after an & sign ;)

~Tracy
 

Link to comment
Share on other sites

I just installed the Master Products.. I'm having trouble with the Master/slave..

 

http://cdlpress.com/catalog/index.php?cPat...4817c378934c5cc

 

Cunieform Text >> there are 4 volumns. When you click on any of of them, it should show the other 3 books in the series! But when I click on Vol2, 3, 4 .. it only LINKS back to VOL 1!!!!!

 

when you click on Vol 1.... http://cdlpress.com/catalog/product_info.p...4817c378934c5cc

 

on the bottom you see the books, but when you click on them.. nothing happens! It takes you back to vol 1??!?!?

 

 

 

Please help!! :'(

Link to comment
Share on other sites

I just installed the Master Products.. I'm having trouble with the Master/slave..

 

http://cdlpress.com/catalog/index.php?cPat...4817c378934c5cc

 

Cunieform Text >> there are 4 volumns. When you click on any of of them, it should show the other 3 books in the series! But when I click on Vol2, 3, 4 .. it only LINKS back to VOL 1!!!!!

 

when you click on Vol 1.... http://cdlpress.com/catalog/product_info.p...4817c378934c5cc

 

on the bottom you see the books, but when you click on them.. nothing happens! It takes you back to vol 1??!?!?

Please help!! :'(

 

 

Download Master Products - 1.1.5 and install the product_info.php from that package

 

Sonia

Link to comment
Share on other sites

Hello

 

has anyone noticed whether products that are master products and their slaves are being crawled and indexed by google and search engines properly? It seems ok in yahoo and msn.

 

I have had some products and varients thereof not in the index although having been present for several months and despite google crawling every 7 days.

 

Could it be a duplicate content issue? or do you think it is google having trouble with the slave table

The sooner you fall behind, the more time you'll have to catch up.

Link to comment
Share on other sites

oh noo.. I just realized something else... when you look at the list

 

http://cdlpress.com/catalog/index.php?cPat...728bd12a167c24b

 

 

 

and you click on buy it now for the slave product..it just goes to the master product! How do I make the slave product always 0? I don't want the customers to buy 1 product, and all the slave products are in the cart!

Link to comment
Share on other sites

I tried to run the master.sql..

 

and it said

 

SQL query:

 

INSERT INTO configuration_group

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

 

MySQL said: Documentation

#1062 - Duplicate entry '16' for key

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...