Master Products - MS2
#2361
Posted 14 October 2011 - 06:01 PM
When I go to product_info.php?products_id=xx, I have the text_quantity drop down box and limited to 20. Can I change this drop down box to a input box?
Also when I am on the individual product page and enter a number in the drop down box, it will not update the shopping cart. Please help, I really like this contribution.
#2362
Posted 16 October 2011 - 05:16 AM
#2363 ONLINE
Posted 16 October 2011 - 08:32 AM
dspeak, on 16 October 2011 - 05:16 AM, said:
Hi,
maybe reverse this:
To use a checkbox in includes/modules/master_listing.php
change
$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0', 'size="4"');
to
$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '1', false);
but this will not enough. At this moment v2.3.1 version use drop down. Look at Master Products pervious version for osCommerce 2.2 core.
I will do admin switch for it in future.
Edited by Gergely, 16 October 2011 - 08:35 AM.
SCM
v3
and some rewrites :-)
#2364
Posted 16 October 2011 - 07:29 PM
#2365
Posted 17 October 2011 - 05:44 PM
Please someone. This is a wonderful contribution, and this is all that is needed to make it perfect.
#2366
Posted 23 October 2011 - 04:54 AM
Attached Files
#2367 ONLINE
Posted 23 October 2011 - 04:01 PM
kplace, on 23 October 2011 - 04:54 AM, said:
Hi try to close elseif branch:
// BOF: Availability + Warranty
if (isset($HTTP_POST_VARS['availability_id_out_of_stock_image']) && tep_not_null($HTTP_POST_VARS['availability_id_out_of_stock_image']) && ($HTTP_POST_VARS['availability_id_out_of_stock_image'] != 'none')) {
$sql_data_array['availability_id_out_of_stock_image'] = tep_db_prepare_input($HTTP_POST_VARS['availability_id_out_of_stock_image']);
} elseif (isset($HTTP_POST_VARS['availability_id_in_stock_image']) && tep_not_null($HTTP_POST_VARS['availability_id_in_stock_image']) && ($HTTP_POST_VARS['availability_id_in_stock_image'] != 'none')) {
$sql_data_array['availability_id_in_stock_image'] = tep_db_prepare_input($HTTP_POST_VARS['availability_id_in_stock_image']);
} elseif (isset($HTTP_POST_VARS['availability_id_in_stock2_image']) && tep_not_null($HTTP_POST_VARS['availability_id_in_stock2_image']) && ($HTTP_POST_VARS['availability_id_in_stock2_image'] != 'none')) {
$sql_data_array['availability_id_in_stock2_image'] = tep_db_prepare_input($HTTP_POST_VARS['availability_id_in_stock2_image']);
} elseif (isset($HTTP_POST_VARS['availability_id_in_stock3_image']) && tep_not_null($HTTP_POST_VARS['availability_id_in_stock3_image']) && ($HTTP_POST_VARS['availability_id_in_stock3_image'] != 'none')) {
$sql_data_array['availability_id_in_stock3_image'] = tep_db_prepare_input($HTTP_POST_VARS['availability_id_in_stock3_image']);
} elseif (isset($HTTP_POST_VARS['availability_id_in_stock_special_image']) && tep_not_null($HTTP_POST_VARS['availability_id_in_stock_special_image']) && ($HTTP_POST_VARS['availability_id_in_stock_special_image'] != 'none')) {
$sql_data_array['availability_id_in_stock_special_image'] = tep_db_prepare_input($HTTP_POST_VARS['availability_id_in_stock_special_image']);
// EOF: Availability
add after
{
SCM
v3
and some rewrites :-)
#2368
Posted 24 October 2011 - 07:02 AM
#2369
Posted 26 October 2011 - 08:56 PM
#2370 ONLINE
Posted 27 October 2011 - 08:38 PM
<input name="Qty_ProdId_<?php echo $product_info['products_id']; ?>" type="text" size="30" maxlength="30">
its all.
SCM
v3
and some rewrites :-)
#2371
Posted 28 October 2011 - 11:08 AM
In catalog/advanced_search_result.php change:
$where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";
to:
$where_str = " where p.products_status = '1' and p.products_master = '0' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";
This only works if the Master has the search term - a better solution is to have the result return the Master if the search term is found within the Slave - something I shall get around to I am sure.
Matti Ressler
-----
I need to modify the $where_str code so that so that it searches all the slaves products_id and displays the master. Currently is either all slaves or only the masters (p.products_master = 0). Perhaps:
$where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";
if (isset($HTTP_GET_VARS['products_master_status'] == 0) && (isset($HTTP_GET_VARS ['products_master'] != 0))) {
$where_str .= " or p.products_master = '" . (int)$HTTP_GET_VARS['products_id'] . "'";
}
Parse error: syntax error, unexpected T_IS_EQUAL, expecting ',' or ')'
I would greatly appreciate your assistance – struggling for a couple of years with this issue.
#2372 ONLINE
Posted 28 October 2011 - 07:17 PM
jrvs, on 28 October 2011 - 11:08 AM, said:
Hi,
Could you put here the full query string? (try to use database logging and select the main query string)
SCM
v3
and some rewrites :-)
#2373
Posted 29 October 2011 - 06:51 AM
$Id: advanced_search_result.php,v 1.72 2003/06/23
Advanced_search_results.php is such an odd document. The $select, $from and $where_str statements are separated in portions. I know that the issue lies solely in:
$where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";
The above displays all slaves – which sometimes are over 20 slaves per master. See Scientiis.com
$where_str = " where p.products_status = '1' and p.products_master = '0' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";
The above displays the master, but does not search the slaves. Searching for a slave model gives " There is no product that matches the search criteria."
Maybe if I could adapt somehow the following:
// Master Products
$master_prod = tep_db_query("select products_master, products_master_status
from " . TABLE_PRODUCTS . "
where products_id = '" . $products_master['products_id'] . "'");
$master_prod_values = tep_db_fetch_array($master_prod);
if (($master_prod_values['products_master_status'] == 0) && ($master_prod_values['products_master'] != 0)) {
$str_selected_values = $master_prod_values['products_master'];
} else {
$str_selected_values = $products_master['products_id'];
}
Tried adapting the following, but received errors
if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
$where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
}
There is also this function in /includes/functions/general.php
// Master Products
function tep_get_products_master_status($product_id) {
$product_query = tep_db_query("select products_master_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
$product = tep_db_fetch_array($product_query);
return $product['products_master_status'];
}
// Master Products EOF
By the way, I'm not a programmer.
Thank you again.
#2374 ONLINE
Posted 30 October 2011 - 04:04 PM
if I understand the question is that search all master products which has slave product with search key. The results contain master products or single products only. The slaves are not listing.
This process need subqueries.
Here is a simple sql code where searching for price in osCommerce v2.3.1 core:
SELECT * FROM `products` WHERE products_master_status = '1' and products_id in(SELECT replace(replace(replace(products_master, "_ ", ""), " ", ", "), "_", "") FROM `products` WHERE products_price = '824' and products_master_status = '0')
The results give only masters.
At this model searching for single master products. The master products only single (_ xxxx _) and not multiply (like _ xxxx yyyy fff _)
The problem is that how can search masters but there are a lot of events.
SCM
v3
and some rewrites :-)
#2375
Posted 31 October 2011 - 08:15 PM
Gergely, on 27 October 2011 - 08:38 PM, said:
<input name="Qty_ProdId_<?php echo $product_info['products_id']; ?>" type="text" size="30" maxlength="30">
its all.
#2376 ONLINE
Posted 31 October 2011 - 09:21 PM
change:
echo TEXT_QUANTITY . ' ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array, MASTER_PRODUCT_DEFAULT_QUANTITY);
to:
echo tep_draw_input_field('Qty_ProdId_' . $product_info['products_id'], '0', 'size="4"');
look at master_listing.php
case 'MASTER_LIST_BUY_NOW':
$list_box_contents .= '<td' . (($slave_id == $listing['products_id']) ? ' class="slave" align="center">' : ' align="center">');
if ((STOCK_CHECK == 'true')&&(tep_get_products_stock($listing['products_id']) < 1)) {
// $list_box_contents .= TEXT_STOCK;
$list_box_contents .= '<small> use here go-ahead sales enhance</small>';
} elseif ((STOCK_CHECK == 'false')&&(tep_get_products_stock($listing['products_id']) < 1)) {
$qty_array = array();
for ($i=0; $ns = 20, $i <= $ns; $i++) {
$qty_array[] = array('id' => $i,
'text' => $i);
}
// $list_box_contents .= tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0', 'size="4"');
$list_box_contents .= tep_draw_pull_down_menu('Qty_ProdId_' . $listing['products_id'], $qty_array);
} 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);
}
// $list_box_contents .= tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0', 'size="4"');
$list_box_contents .= tep_draw_pull_down_menu('Qty_ProdId_' . $listing['products_id'], $qty_array);
}
$list_box_contents .= '</td>';
break;
where you can switch on simple input field
Edited by Gergely, 31 October 2011 - 09:24 PM.
SCM
v3
and some rewrites :-)
#2377
Posted 31 October 2011 - 09:42 PM
#2378
Posted 01 November 2011 - 06:47 PM
I looked at the code last night, I am using RC2. I see some similarity in the code, but just can't quite get it all figured out. I will play with it some, hopefully I can get this working soon.
#2379
Posted 01 November 2011 - 08:14 PM
#2380
Posted 15 November 2011 - 04:17 PM










