Jump to content



Latest News: (loading..)

- - - - -

Master Products - MS2


  • Please log in to reply
2401 replies to this topic

#2381   diro5

diro5
  • Members
  • 2 posts
  • Real Name:Dirk Rose

Posted 20 November 2011 - 01:44 PM

Hi,

i get stuck.

If a customer puts a slave into the shopping cart, the master is added too. I can´t find out how to stop this.  If a slave is selected, only the slave should be put into the shopping cart.

Has anyone a tip for me?

Thanks a lot

#2382   Gergely

Gergely
  • Community Team
  • 529 posts
  • Real Name:Gergely Tóth
  • Gender:Male

Posted 22 November 2011 - 08:49 PM

View Postdiro5, on 20 November 2011 - 01:44 PM, said:

Hi,

i get stuck.

If a customer puts a slave into the shopping cart, the master is added too. I can´t find out how to stop this.  If a slave is selected, only the slave should be put into the shopping cart.

Has anyone a tip for me?

Thanks a lot


Hi,

look at backwards in this forum
Header Footer Content Modules
SCM
v3

and some rewrites :-)

#2383   univer

univer
  • Members
  • 21 posts
  • Real Name:De Ridder Patrick
  • Gender:Male
  • Location:Belgium

Posted 23 November 2011 - 08:28 PM

@ gergely

Posted 25 September 2011, 09:34



[img]http://forums.oscommerce.com//public/style_images/master/snapback.png[/img]univer, on 24 September 2011, 21:34, said:



i forgot to mention that i'm stucked while merging the file catalog/product_info.php
here are the two files, who can do this?
I'm trying since days without any succes


Hi,
We need to do new module for it. As soon as possible I will do it in extras. The tab page navigation not fix yet.


Did you solve this problem already?

Thank you.


#2384   diro5

diro5
  • Members
  • 2 posts
  • Real Name:Dirk Rose

Posted 24 November 2011 - 09:29 AM

Hi Gergely,

thank you for your answer.

I didn´t understand the solution given above, for me it seemed there is some information missing. But i found the point in my shop.

This change in my application_top helped:

  case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
    $attributes = isset($HTTP_POST_VARS['id']) ? $HTTP_POST_VARS['id'] : '';
    $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes)), $attributes);
  // original: $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes);

Thank You

#2385   Gergely

Gergely
  • Community Team
  • 529 posts
  • Real Name:Gergely Tóth
  • Gender:Male

Posted 27 November 2011 - 04:28 PM

View Postuniver, on 23 November 2011 - 08:28 PM, said:

Did you solve this problem already?

Thank you.

I am rebuilding an rc2.2a shop now. As soon as finish I will take it.
Header Footer Content Modules
SCM
v3

and some rewrites :-)

#2386   arlocalles

arlocalles
  • Members
  • 4 posts
  • Real Name:Arlo

Posted 04 December 2011 - 07:33 AM

Hi George

I would like to ask you something about the Master/Slave contribution that you made for OSCommerce. It's a little difficult for me since it works but it doesn't let me add products with Downloadable attributes to the shopping cart when they are converted to Master products. But they CAN actually be added to the shopping cart when they are NOT master products.

I'd really appreciate your help on this.

This is a link of the site:
http://voxpopulibooks.com/product_info.php?cPath=136&products_id=197
This is the master product which cannot be added to the cart as a downloadable product.

And this one http://voxpopulibooks.com/product_info.php?cPath=136&products_id=181
is an example of a product which CAN be added to the shopping cart with Downloadable attributes.

So in other words, all products with downloadable attributes (mp3 in this case) can actually be added to the shopping cart with the Download description or attribute EXCEPT when they are made into Master products, because after adding them to the cart, they don't keep the Download attribute.

#2387   arlocalles

arlocalles
  • Members
  • 4 posts
  • Real Name:Arlo

Posted 04 December 2011 - 08:02 AM

I forgot to mention that I am using OSCommerce 2.2 RC2a and Master Products Rc2a V1.25

#2388   arlocalles

arlocalles
  • Members
  • 4 posts
  • Real Name:Arlo

Posted 04 December 2011 - 09:37 AM

This is the code for the product_info.php I am using.

<?php
/*
  $Id: product_info.php 1739 2007-12-20 00:52:16Z hpdl $
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2003 osCommerce
  Released under the GNU General Public License
*/
  require('includes/application_top.php');
  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
  $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
  $product_check = tep_db_fetch_array($product_check_query);
  //added by admin  showing the master for slave products
$master_query1 = tep_db_query("select products_id,products_master from " . TABLE_PRODUCTS . " where products_id =  '" . (int)$HTTP_GET_VARS['products_id'] . " '");
$results1 = tep_db_fetch_array($master_query1);
if (($results1['products_master'] != NULL) &&($results1['products_master'] != 0) ) {
$HTTP_GET_VARS['products_id']=(int)$results1['products_master'];
}
//end of code added by admin  showing the master for slave products
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
  <tr>
	<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
	</table></td>
<!-- body_text //-->
	<?php
$master_status_query = tep_db_query("select p.products_master_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$master_check = tep_db_fetch_array($master_status_query);
if ($master_check['products_master_status'] > 0) {
?>
<td width="100%" valign="top"><?php echo '<form name="buy_now_" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_slave', 'NONSSL') . '">'; ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
}
else {
?>
<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
}
// Master Products EOF
  if ($product_check['total'] < 1) {
?>
	  <tr>
		<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
		  <tr class="infoBoxContents">
			<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
			  <tr>
				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
				<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
			</table></td>
		  </tr>
		</table></td>
	  </tr>
<?php
  } else {
	//Master Products
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_master_status, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
//Master Products EOF
	$product_info = tep_db_fetch_array($product_info_query);
	tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
	if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
	  $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
	} else {
	  $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
	}
	if (tep_not_null($product_info['products_model'])) {
	  $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
	} else {
	  $products_name = $product_info['products_name'];
	}
?>
	  <tr>
		<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr>
			<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
			<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
		  </tr>
		</table></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td class="main">
<?php
	if (tep_not_null($product_info['products_image'])) {
?>
		  <table border="0" cellspacing="0" cellpadding="2" align="right">
			<tr>
			  <td align="center" class="smallText">
<script language="javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>
			  </td>
			</tr>
		  </table>
<?php
	}
?>
		  <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
	$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
	$products_attributes = tep_db_fetch_array($products_attributes_query);
	if ($products_attributes['total'] > 0) {
?>
		  <table border="0" cellspacing="0" cellpadding="2">
			<tr>
			  <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
			</tr>
<?php
	  $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
	  while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
		$products_options_array = array();
		$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
		while ($products_options = tep_db_fetch_array($products_options_query)) {
		  $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
		  if ($products_options['options_values_price'] != '0') {
			$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
		  }
		}
		if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
		  $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
		} else {
		  $selected_attribute = false;
		}
?>
			<tr>
			  <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
			  <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
			</tr>
<?php
	  }
?>
		  </table>
<?php
	}
//Master Products
if (tep_not_null($product_info['products_url'])) {
?>
<tr>
<td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
?>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
if ($product_info['products_price']>0) {
$qty_array = array();
for ($i=0; $n2 = (($product_info['products_quantity'] < 20) ? $product_info['products_quantity'] : 20), $i <= $n2; $i++) {
$qty_array[] = array('id' => $i, 'text' => $i);
}
?>
<tr>
<td align="right" class="main"><?php if ($product_info['products_quantity'] > 0) {
echo TEXT_QUANTITY . '  ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array) ;
} elseif ((STOCK_CHECK == 'false')&& ($product_info['products_quantity'] < 1)) {
$qty_array = array();
for ($i=0; $ns = 20, $i <= $ns; $i++) {
$qty_array[] = array('id' => $i, 'text' => $i);
}
echo TEXT_QUANTITY . '  ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array) ;
} else {
echo TEXT_STOCK;
}
echo tep_draw_separator('pixel_trans.gif', '30', '10');
?>
</td>
</tr>
<?php
}
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
</tr>
<?php
$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$reviews = tep_db_fetch_array($reviews_query);
if ($reviews['count'] > 0) {
?>
<tr>
<td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
<tr>
<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
</tr>
<?php
} else {
?>
<tr>
<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
</tr>
<?php
}
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master =  " . $HTTP_GET_VARS['products_id']);
$results = tep_db_fetch_array($master_query);
if (($results['products_id'] != NULL) && ($product_info['products_master_status'] == 1)) { ?>
<tr>
<td align="left" class="main"> <?php echo TEXT_SLAVE_PRODUCTS; ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><?php  include(DIR_WS_MODULES . FILENAME_MASTER_PRODUCTS); ?></td>
</tr>
<?php
}
}
?>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<?php  if ($reviews['count'] > 0) { ?>
<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
<?php
}
?>
<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td></form>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<?php
if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_also_purchased(3600);
} else {
include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
?>
</td>
</tr>
</table></td>
<!-- Master Products EOF //-->
<!-- body_text_eof //-->
	<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
	</table></td>
  </tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


#2389   Geotex

Geotex
  • Members
  • 628 posts
  • Real Name:George Snell
  • Gender:Male
  • Location:Houston, TX USA

Posted 04 December 2011 - 11:13 PM

Master slave products, by design, only allow purchase of slaves. The master works kind of like a subcategory, except that the slave products can be anywhere on the system, including hidden or disabled directories. When someone clicks on a product or the master, all associated products are rounded up from wherever they are located and displayed in a meaningful display, with the Master providing a location to adequately describe and promote the whole group.
GEOTEX from Houston, TX

(George)

#2390   univer

univer
  • Members
  • 21 posts
  • Real Name:De Ridder Patrick
  • Gender:Male
  • Location:Belgium

Posted 06 December 2011 - 09:26 PM

View PostGergely, on 27 November 2011 - 04:28 PM, said:


I am rebuilding an rc2.2a shop now. As soon as finish I will take it.
ok, thank you
do you have any idea in what time it could be done?

#2391   arlocalles

arlocalles
  • Members
  • 4 posts
  • Real Name:Arlo

Posted 07 December 2011 - 03:48 AM

I'm having this problem when I click on the contents of the Shopping Cart. I'm using OSC 2.2 RC2a and Master Products Rc2a V1.25

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{9}23' at line 1

select products_id from products where products_master = 181{9}23

[TEP STOP]


So this error is displayed in: product_info.php?products_id=181{9}23

Does anyone know why? I tried searching and it's not that fix they say for the offset at split_page_results.php since that page already comes with that fix.

#2392   Gergely

Gergely
  • Community Team
  • 529 posts
  • Real Name:Gergely Tóth
  • Gender:Male

Posted 29 December 2011 - 10:41 PM

View Postarlocalles, on 07 December 2011 - 03:48 AM, said:

I'm having this problem when I click on the contents of the Shopping Cart. I'm using OSC 2.2 RC2a and Master Products Rc2a V1.25

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{9}23' at line 1

select products_id from products where products_master = 181{9}23

[TEP STOP]

So this error is displayed in: product_info.php?products_id=181{9}23

Does anyone know why? I tried searching and it's not that fix they say for the offset at split_page_results.php since that page already comes with that fix.


Hi,

it look like attributes values. Maybe something mixed with attributes codes.

Regards,
Gergely
Header Footer Content Modules
SCM
v3

and some rewrites :-)

#2393   Gergely

Gergely
  • Community Team
  • 529 posts
  • Real Name:Gergely Tóth
  • Gender:Male

Posted 29 December 2011 - 10:47 PM

View Postuniver, on 06 December 2011 - 09:26 PM, said:

ok, thank you
do you have any idea in what time it could be done?


Hi,

I use tab fix for myself in catalog/includes/modules/products_tabs.php

  /*
	<script type="text/javascript">
	$(function() {
	  $( "#tabs" ).tabs({ selected: <?php echo $selected_tab; ?>
						 });
	});
  </script>
*/
?>
  <script type="text/javascript">
	$(function() {
	  $( "#tabs" ).tabs({ cookie: { // store cookie for a day, without, it would be a session cookie
								  expires: 1
								  }
						 });
	});
  </script>

Header Footer Content Modules
SCM
v3

and some rewrites :-)

#2394   wood1e

wood1e
  • Members
  • 5 posts
  • Real Name:Rob Wood

Posted 05 February 2012 - 08:34 PM

Hi,

I am looking for some clarification/help.  I have a client who has many products and product variations.

At the moment we are using attributes, but this is a little clunky and long winded for the client, and so I am now looking at 'Master and Slave as a solution.

But I am struggling to find sites using this contribution so see working examples...so my questions are:

Can the slave products be a drop down box?
Is the slave pricing $+x to the Master product, or can they be actual prices?
Can 'Master/Slave' work with Attributes, for example attributes would still be used for variations that has no effect on price. like color.
Apart from 'Delivery', 'installation' which would be $+x added to the Master price or the Slave variation price.

Sorry for the number of questions, these are the ones I am still struggling to find answers to in the 120 pages of this help forum.

Any help will be greatly appreciated.

#2395   Gergely

Gergely
  • Community Team
  • 529 posts
  • Real Name:Gergely Tóth
  • Gender:Male

Posted 08 February 2012 - 06:46 PM

View Postwood1e, on 05 February 2012 - 08:34 PM, said:

Can the slave products be a drop down box?
Is the slave pricing $+x to the Master product, or can they be actual prices?
Can 'Master/Slave' work with Attributes, for example attributes would still be used for variations that has no effect on price. like color.
Apart from 'Delivery', 'installation' which would be $+x added to the Master price or the Slave variation price.

Hi,

I use master products with extra fields, but attributes works too.
This project built in osCommerce V3 as parent-child concept.

Free slave Drop down select not available at this moment.

Forget price differencies (like works in attributes), master-slave is different. Every products are unique but can group with master product.

Why dont you try it? You can install osCommerce v2.3.1 and dropp into master package. That's all.

regards,
Gergely
Header Footer Content Modules
SCM
v3

and some rewrites :-)

#2396   grellk

grellk
  • Members
  • 10 posts
  • Real Name:Michael

Posted 11 March 2012 - 10:08 PM

Hi all. I am looking for a bit of help here, please be patient as I am quite new to osC and PHP in general.

I am running a new install of 2.3.1 with The Master Products contrib in addition to QT Pro.

The issue I am having is that during checkout the master product (purely a virtual placeholder) is removed from inventory however the two slave items are not. I do not know if I am missing something or if the interaction with the QT Pro addon is a possible cause.

I am wondering if there is a way to force the quantity of the slave items to always be 1? This will be the case in my product and it may also resolve the issue.

Any help would be appreciated for this osC noob.

Thanks!

#2397   guettapan

guettapan
  • Members
  • 3 posts
  • Real Name:guettapan

Posted 19 March 2012 - 07:18 AM

Hello,
I used to master that works very well, but in the cart I want that when you remove the product slave, the master also removes product.
Can you help me?


I give the code to my basket
	$info_box_contents[$cur_row][] = array('align' => 'center',
											 'params' => 'class="productListing_image" valign="midlle" width="20px"',
											 'text' => '<a class="opacity_min" href="' . tep_href_link(FILENAME_SHOPPING_CART, 'action=remove_product&products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_ICONS . 'ndc_picto_bin.gif', TABLE_HEADING_REMOVE, 11, 13) . '</a>');


Sorry for my english
thank you

Edited by guettapan, 19 March 2012 - 07:19 AM.


#2398   ce7

ce7
  • Members
  • 202 posts
  • Real Name:lyn

Posted 24 May 2012 - 12:13 AM

Hi,

Can anyone please help?

I installed SPPC, stock tracking with Master Product in osC2.3.1,

I got error message when delete the product and master product.

Fatal error: Call to undefined function tep_remove_product() in \catalog\admin\categories.php on line 169

my categories.php code is as below:


<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright © 2010 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
require('includes/template_top.php'); // Line 619
// BOF Featured Products for v2.3.x _20120503_P060
//++++ QT Pro: Begin Added code
//Create the product investigation for this product that are used in this page.
$product_investigation = qtpro_doctor_investigate_product($HTTP_GET_VARS['pID']);
//++++ QT Pro: End Added code
// EOF Featured Products for v2.3.x _20120503_P060
require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
if (tep_not_null($action)) {
switch ($action) {
case 'setflag':
if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {
if (isset($HTTP_GET_VARS['pID'])) {
tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']);
}
if (USE_CACHE == 'true') {
tep_reset_cache_block('categories');
tep_reset_cache_block('also_purchased');
}
}
tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID']));
break;
case 'insert_category':
case 'update_category':
if (isset($HTTP_POST_VARS['categories_id'])) $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
$sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);
$sql_data_array = array('sort_order' => (int)$sort_order);
if ($action == 'insert_category') {
$insert_sql_data = array('parent_id' => $current_category_id,
'date_added' => 'now()');
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
tep_db_perform(TABLE_CATEGORIES, $sql_data_array);
$categories_id = tep_db_insert_id();
} elseif ($action == 'update_category') {
$update_sql_data = array('last_modified' => 'now()');
$sql_data_array = array_merge($sql_data_array, $update_sql_data);
tep_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "'");
}
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
$categories_name_array = $HTTP_POST_VARS['categories_name'];
$language_id = $languages[$i]['id'];
$sql_data_array = array('categories_name' => tep_db_prepare_input($categories_name_array[$language_id]));
if ($action == 'insert_category') {
$insert_sql_data = array('categories_id' => $categories_id,
'language_id' => $languages[$i]['id']);
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);
} elseif ($action == 'update_category') {
tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");
}
}
$categories_image = new upload('categories_image');
$categories_image->set_destination(DIR_FS_CATALOG_IMAGES);
if ($categories_image->parse() && $categories_image->save()) {
tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");
}
if (USE_CACHE == 'true') {
tep_reset_cache_block('categories');
tep_reset_cache_block('also_purchased');
}
tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
break;
case 'delete_category_confirm':
if (isset($HTTP_POST_VARS['categories_id'])) {
$categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
$categories = tep_get_category_tree($categories_id, '', '0', '', true);
$products = array();
$products_delete = array();
for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
$product_ids_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$categories[$i]['id'] . "'");
while ($product_ids = tep_db_fetch_array($product_ids_query)) {
$products[$product_ids['products_id']]['categories'][] = $categories[$i]['id'];
}
}
reset($products);
while (list($key, $value) = each($products)) {
$category_ids = '';
for ($i=0, $n=sizeof($value['categories']); $i<$n; $i++) {
$category_ids .= "'" . (int)$value['categories'][$i] . "', ";
}
$category_ids = substr($category_ids, 0, -2);
$check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$key . "' and categories_id not in (" . $category_ids . ")");
$check = tep_db_fetch_array($check_query);
if ($check['total'] < '1') {
$products_delete[$key] = $key;
}
}
// removing categories can be a lengthy process
tep_set_time_limit(0);
for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
tep_remove_category($categories[$i]['id']);
}
reset($products_delete);
while (list($key) = each($products_delete)) {
tep_remove_product($key);
}
}
if (USE_CACHE == 'true') {
tep_reset_cache_block('categories');
tep_reset_cache_block('also_purchased');
}
tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
break;
case 'delete_product_confirm':
if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['product_categories']) && is_array($HTTP_POST_VARS['product_categories'])) {
$product_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
$product_categories = $HTTP_POST_VARS['product_categories'];

// BOF Separate Pricing Per Customer 1/6
tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . tep_db_input($product_id) . "' ");
// EOF Separate Pricing Per Customer 1/6
for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {
tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "' and categories_id = '" . (int)$product_categories[$i] . "'");
}
$product_categories_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "'");
$product_categories = tep_db_fetch_array($product_categories_query);
if ($product_categories['total'] == '0') {
tep_remove_product($product_id); (--->this is line 169)
}
}
if (USE_CACHE == 'true') {
tep_reset_cache_block('categories');
tep_reset_cache_block('also_purchased');

#2399   germ

germ
  • Members
  • 13,921 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 24 May 2012 - 12:22 AM

At some point in time you've copied the includes/functions/general.php from the catalog side to the admin side.

That function is in the admin file, but not the catalog file.
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#2400   michellepchy

michellepchy
  • Members
  • 1 posts
  • Real Name:michelle

Posted 07 October 2012 - 07:09 AM

Hello all i am new to oscommerce and have just installed it on my local machine to see if it will do what I need as the cart I am using at the moment can not handle what I need. Anyway I have just installed v2.3.3 and the add on master products v2.3x v2.0a to see if I can get it to do what I need. So far it is looking like it is going to be able to do what i want except for a few things that I need to change and would really appreciate it if anyone could help me out or point me in the right direction to achieve this.
I have set up a master product called sailor costume with 0 price and 0 quantity, I have then set up 4 slaves to this small, medium, large and x large each one with a stock quantity and price assigned. The things I need to change are as follows;
1. Right now the master product is showing an out of stock message which I would like to get rid of.
2. When I add the slaves to the shopping cart the master product is added also which I do no want to happen.
3. When I add the slaves to the shopping cart I would like it to also show the name of the master product infront of the slave product name for example as of now it shows this
small 1 29.99 I would like it to do this
Sailor Costume Small 1 29.99.

If I can get these sorted out then this mod is perfect for what I need I am hoping I can as this is a really great mod and i would love to be able to use it.
Thank you in advance for any help anyone can offer me.