Master Products - MS2
#41
Posted 04 December 2003, 01:16
#42
Posted 04 December 2003, 01:24
<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_hidden_field('Qty_ProdId_' . $product_info['products_id'], 1) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></form></td>Note: this change will affect all master products and will add the master every time the Add to Cart button is pressed.Hth,
Matt
#43
Posted 04 December 2003, 15:39
I'm desperatly trying to combine Master Products with UltraPics/HTMLArea but got into serious problems while trying to join the changes in categories.php.
This is a part of my categories.php with UltraPics installed:
case 'update_product':
if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {
$action = 'new_product';
} else {
// BOF MaxiDVD: Modified For Ultimate Images Pack!
if ($HTTP_POST_VARS['delete_image'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image']);
}
if ($HTTP_POST_VARS['delete_image_med'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_med']);
}
if ($HTTP_POST_VARS['delete_image_lrg'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_lrg']);
}
if ($HTTP_POST_VARS['delete_image_sm_1'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_sm_1']);
}
if ($HTTP_POST_VARS['delete_image_xl_1'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_xl_1']);
}
if ($HTTP_POST_VARS['delete_image_sm_2'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_sm_2']);
}
if ($HTTP_POST_VARS['delete_image_xl_2'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_xl_2']);
}
if ($HTTP_POST_VARS['delete_image_sm_3'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_sm_3']);
}
if ($HTTP_POST_VARS['delete_image_xl_3'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_xl_3']);
}
if ($HTTP_POST_VARS['delete_image_sm_4'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_sm_4']);
}
if ($HTTP_POST_VARS['delete_image_xl_4'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_xl_4']);
}
if ($HTTP_POST_VARS['delete_image_sm_5'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_sm_5']);
}
if ($HTTP_POST_VARS['delete_image_xl_5'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_xl_5']);
}
if ($HTTP_POST_VARS['delete_image_sm_6'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_sm_6']);
}
if ($HTTP_POST_VARS['delete_image_xl_6'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_previous_image_xl_6']);
}
// EOF MaxiDVD: Modified For Ultimate Images Pack!
if (isset($HTTP_GET_VARS['pID'])) $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);
$products_date_available = tep_db_prepare_input($HTTP_POST_VARS['products_date_available']);
$products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';
$sql_data_array = array('products_quantity' => tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),
'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),
'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),
'products_date_available' => $products_date_available,
'products_weight' => tep_db_prepare_input($HTTP_POST_VARS['products_weight']),
'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),
'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),
'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));
// BOF MaxiDVD: Modified For Ultimate Images Pack!
if (($HTTP_POST_VARS['unlink_image'] == 'yes') or ($HTTP_POST_VARS['delete_image'] == 'yes')) {
$sql_data_array['products_image'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {
$sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']);
}
}
if (($HTTP_POST_VARS['unlink_image_med'] == 'yes') or ($HTTP_POST_VARS['delete_image_med'] == 'yes')) {
$sql_data_array['products_image_med'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_med']) && tep_not_null($HTTP_POST_VARS['products_image_med']) && ($HTTP_POST_VARS['products_image_med'] != 'none')) {
$sql_data_array['products_image_med'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_med']);
}
}
if (($HTTP_POST_VARS['unlink_image_lrg'] == 'yes') or ($HTTP_POST_VARS['delete_image_lrg'] == 'yes')) {
$sql_data_array['products_image_lrg'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_lrg']) && tep_not_null($HTTP_POST_VARS['products_image_lrg']) && ($HTTP_POST_VARS['products_image_lrg'] != 'none')) {
$sql_data_array['products_image_lrg'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_lrg']);
}
}
if (($HTTP_POST_VARS['unlink_image_sm_1'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_1'] == 'yes')) {
$sql_data_array['products_image_sm_1'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_sm_1']) && tep_not_null($HTTP_POST_VARS['products_image_sm_1']) && ($HTTP_POST_VARS['products_image_sm_1'] != 'none')) {
$sql_data_array['products_image_sm_1'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_1']);
}
}
if (($HTTP_POST_VARS['unlink_image_xl_1'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_1'] == 'yes')) {
$sql_data_array['products_image_xl_1'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_xl_1']) && tep_not_null($HTTP_POST_VARS['products_image_xl_1']) && ($HTTP_POST_VARS['products_image_xl_1'] != 'none')) {
$sql_data_array['products_image_xl_1'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_1']);
}
}
if (($HTTP_POST_VARS['unlink_image_sm_2'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_2'] == 'yes')) {
$sql_data_array['products_image_sm_2'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_sm_2']) && tep_not_null($HTTP_POST_VARS['products_image_sm_2']) && ($HTTP_POST_VARS['products_image_sm_2'] != 'none')) {
$sql_data_array['products_image_sm_2'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_2']);
}
}
if (($HTTP_POST_VARS['unlink_image_xl_2'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_2'] == 'yes')) {
$sql_data_array['products_image_xl_2'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_xl_2']) && tep_not_null($HTTP_POST_VARS['products_image_xl_2']) && ($HTTP_POST_VARS['products_image_xl_2'] != 'none')) {
$sql_data_array['products_image_xl_2'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_2']);
}
}
if (($HTTP_POST_VARS['unlink_image_sm_3'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_3'] == 'yes')) {
$sql_data_array['products_image_sm_3'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_sm_3']) && tep_not_null($HTTP_POST_VARS['products_image_sm_3']) && ($HTTP_POST_VARS['products_image_sm_3'] != 'none')) {
$sql_data_array['products_image_sm_3'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_3']);
}
}
if (($HTTP_POST_VARS['unlink_image_xl_3'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_3'] == 'yes')) {
$sql_data_array['products_image_xl_3'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_xl_3']) && tep_not_null($HTTP_POST_VARS['products_image_xl_3']) && ($HTTP_POST_VARS['products_image_xl_3'] != 'none')) {
$sql_data_array['products_image_xl_3'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_3']);
}
}
if (($HTTP_POST_VARS['unlink_image_sm_4'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_4'] == 'yes')) {
$sql_data_array['products_image_sm_4'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_sm_4']) && tep_not_null($HTTP_POST_VARS['products_image_sm_4']) && ($HTTP_POST_VARS['products_image_sm_4'] != 'none')) {
$sql_data_array['products_image_sm_4'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_4']);
}
}
if (($HTTP_POST_VARS['unlink_image_xl_4'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_4'] == 'yes')) {
$sql_data_array['products_image_xl_4'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_xl_4']) && tep_not_null($HTTP_POST_VARS['products_image_xl_4']) && ($HTTP_POST_VARS['products_image_xl_4'] != 'none')) {
$sql_data_array['products_image_xl_4'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_4']);
}
}
if (($HTTP_POST_VARS['unlink_image_sm_5'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_5'] == 'yes')) {
$sql_data_array['products_image_sm_5'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_sm_5']) && tep_not_null($HTTP_POST_VARS['products_image_sm_5']) && ($HTTP_POST_VARS['products_image_sm_5'] != 'none')) {
$sql_data_array['products_image_sm_5'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_5']);
}
}
if (($HTTP_POST_VARS['unlink_image_xl_5'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_5'] == 'yes')) {
$sql_data_array['products_image_xl_5'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_xl_5']) && tep_not_null($HTTP_POST_VARS['products_image_xl_5']) && ($HTTP_POST_VARS['products_image_xl_5'] != 'none')) {
$sql_data_array['products_image_xl_5'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_5']);
}
}
if (($HTTP_POST_VARS['unlink_image_sm_6'] == 'yes') or ($HTTP_POST_VARS['delete_image_sm_6'] == 'yes')) {
$sql_data_array['products_image_sm_6'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_sm_6']) && tep_not_null($HTTP_POST_VARS['products_image_sm_6']) && ($HTTP_POST_VARS['products_image_sm_6'] != 'none')) {
$sql_data_array['products_image_sm_6'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_6']);
}
}
if (($HTTP_POST_VARS['unlink_image_xl_6'] == 'yes') or ($HTTP_POST_VARS['delete_image_xl_6'] == 'yes')) {
$sql_data_array['products_image_xl_6'] = '';
} else {
if (isset($HTTP_POST_VARS['products_image_xl_6']) && tep_not_null($HTTP_POST_VARS['products_image_xl_6']) && ($HTTP_POST_VARS['products_image_xl_6'] != 'none')) {
$sql_data_array['products_image_xl_6'] = tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_6']);
}
}
// EOF MaxiDVD: Modified For Ultimate Images Pack!
if ($action == 'insert_product') {
$insert_sql_data = array('products_date_added' => 'now()');
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
tep_db_perform(TABLE_PRODUCTS, $sql_data_array);
$products_id = tep_db_insert_id();
tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$current_category_id . "')");
} elseif ($action == 'update_product') {
$update_sql_data = array('products_last_modified' => 'now()');
$sql_data_array = array_merge($sql_data_array, $update_sql_data);
tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");
}
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
$language_id = $languages[$i]['id'];
$sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]),
'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]),
'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]));
if ($action == 'insert_product') {
$insert_sql_data = array('products_id' => $products_id,
'language_id' => $language_id);
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
} elseif ($action == 'update_product') {
tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_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 . '&pID=' . $products_id));
}
break;
###################
###################
and I'm unable to join it with Master Products version, which goes like that:
case 'update_product':
if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {
$action = 'new_product';
} else {
if (isset($HTTP_GET_VARS['pID'])) $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);
$products_date_available = tep_db_prepare_input($HTTP_POST_VARS['products_date_available']);
$products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';
$sql_data_array = array('products_quantity' => tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),
'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),
'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),
'products_date_available' => $products_date_available,
'products_weight' => tep_db_prepare_input($HTTP_POST_VARS['products_weight']),
'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),
// Master Products
'products_listing_status' => tep_db_prepare_input($HTTP_POST_VARS['products_listing_status']),
'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),
'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']),
'products_master' => tep_db_prepare_input($HTTP_POST_VARS['products_master']));
// Master Products EOF
if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {
$sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']);
}
if ($action == 'insert_product') {
$insert_sql_data = array('products_date_added' => 'now()');
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
tep_db_perform(TABLE_PRODUCTS, $sql_data_array);
$products_id = tep_db_insert_id();
tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$current_category_id . "')");
} elseif ($action == 'update_product') {
$update_sql_data = array('products_last_modified' => 'now()');
$sql_data_array = array_merge($sql_data_array, $update_sql_data);
tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");
}
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
$language_id = $languages[$i]['id'];
$sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]),
'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]),
'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]));
if ($action == 'insert_product') {
$insert_sql_data = array('products_id' => $products_id,
'language_id' => $language_id);
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
} elseif ($action == 'update_product') {
tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_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 . '&pID=' . $products_id));
}
break;
//Master Products
I seriously need a solution because I need to be able to set different product weights and ids !
Please give me a hand..
Greetz from Germany
René Reineke
Edited by flynst4r, 04 December 2003, 15:41.
#44
Posted 04 December 2003, 15:51
iiinetworks, on Dec 3 2003, 04:22 AM, said:
Hth,
Matt
I do have one outstanding display issue with the box however. It doesn't appear to line up so well. The drop down column doesn't line up with the title and the far side of the box has a vacant column - no title above this, as if the box has over drawn horizontally? - i'm currently not hosted so can't show you? any ideas based on what i've said?
Thanks again for your help, really appreciate the time you've saved me.
Marc
#45
Posted 04 December 2003, 16:02
Master Products - MS2.
then
MS2 HTML WYSIWYG Editor, Product Desc, Email
Works ok, but i'm struggling getting the admin/categories.php working. Currently settled for designing my HTML page in frontpage and pasting the text into the box within OSC\admin - i havent updated the categories file to include the HTML contrib as i'd prefer the Master Products working completely.. It seems by leaving the updates of the HTML contrib i dont have the ability to edit the page within the OSc admin, but rather paste HTML into the box, which is then displayed correctly in the catalog.
So what i'd ideally like to do is get the Java applet working in categories.php so i can edit the pages within Osc admin without breaking the Master Products...anyone done this?
thanks
Marc
#46
Posted 06 December 2003, 10:00
I could finally merge the files more or less but now I'm stuck again.
http://www.hair-xperts.de/product_info.php/products_id/32
I am able to chose the amount of products but clicking on buy means -> 'empty cart'
Can't solve that.
Anybody able to help?
Thanks
René
Edited by flynst4r, 06 December 2003, 10:00.
#47
Posted 06 December 2003, 12:49
I believe that something in application_top.php might go wrong concerning "case: add_slave"
That's what I have got:
//Master Products
// customer adds multiple products from the master_listing page
case 'add_slave' :
while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) {
if (substr($key,0,11) == "Qty_ProdId_") {
$prodId = substr($key,11);
$qty = $val;
if ($qty <= 0 ) continue;
$cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId, $HTTP_POST_VARS['id']))+($qty), $HTTP_POST_VARS['id']);
echo("$prodId<br>" . $HTTP_POST_VARS['id'] . "<br>" . $HTTP_POST_VARS['id'] . "<br><p>");
}
}
die;
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
//Master Products EOF
Trying to locate the source of the error I added a die() function, which gets executed (result: add_slave is called!) but nothing is returned by my echo function (maybe while(...) not workin')
a part of the form source follows (product_info.php/master_listing.php)
<!-- Master Products //--> <td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td> </tr> <tr> <td align="left" class="main"> *Bitte wählen Sie unten die gewünschte Anzahl aus.</td> </tr> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td> </tr> <tr> <td><form name="buy_now_" method="post" action="http://www.hair-xperts.de/product_info.php/cPath/21/products_id/32/sort/3a/[b]action/add_slave[/b]"><form name="buy_now_" method="post" action="http://www.hair-xperts.de/product_info.php/cPath/21/products_id/32/sort/3a/action/add_slave"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="productListing"> <tr> <td class="productListing-heading"> <a href="http://www.hair-xperts.de/product_info.php/cPath/21/products_id/32/page/1/sort/1a" title="Sortierung der Artikel ist aufsteigend nach Modell" class="productListing-heading">Modell</a> </td> <td align="center" class="productListing-heading"> Beschreibung </td> <td class="productListing-heading"> <a href="http://www.hair-xperts.de/product_info.php/cPath/21/products_id/32/page/1/sort/3d" title="Sortierung der Artikel ist absteigend nach Name" class="productListing-heading">Name+</a> </td> <td align="right" class="productListing-heading"> <a href="http://www.hair-xperts.de/product_info.php/cPath/21/products_id/32/page/1/sort/4a" title="Sortierung der Artikel ist aufsteigend nach Preis" class="productListing-heading">Preis</a> </td> <td align="center" class="productListing-heading"> Jetzt kaufen! </td> </tr> <tr class="productListing-odd"> <td class="productListing-data"> 18-CS-1000 </td> <td class="productListing-data"> Dies ist die 1000ml version des prodkt </td> <td class="productListing-data"> 1.8 Color Saver Shampoo 1000 ml</a> </td> <td align="right" class="productListing-data"> 127,60€ </td> <td align="center" class="productListing-data"><select name="Qty_ProdId_33" value="0" class="main" style="width: 40px"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> </select></td> </tr> <tr class="productListing-even"> <td class="productListing-data"> 18-CS-500 </td> <td class="productListing-data"> 5500 </td> <td class="productListing-data"> 500 ml</a> </td> <td align="right" class="productListing-data"> 63,80€ </td> <td align="center" class="productListing-data"><select name="Qty_ProdId_34" value="0" class="main" style="width: 40px"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> </select></td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td> </tr> <tr> <td class="main" align="right"><input type="hidden" name="products_id" value="32"><input type="image" src="includes/languages/german/images/buttons/button_in_cart.gif" border="0" alt="In den Warenkorb" title=" In den Warenkorb "></form></td> </tr> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText">angezeigte Produkte: <b>1</b> bis <b>2</b> (von <b>2</b> insgesamt)</td> <td class="smallText" align="right">Seiten: <b>1</b> </td> </tr> </table> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td> </tr> </td> </tr> <!-- Master Products EOF //-->
Edited by flynst4r, 06 December 2003, 12:53.
#48
Posted 06 December 2003, 13:00
Johnson, on Nov 27 2003, 10:21 AM, said:
Idea for next version:
The dropdown quantity selector goes from 0 -> 20 on every product. This would be more beneficial to go from 0 -> quantity in stock.
I will have a go at doing this when I finish my next project (if no-one does it in the meantime).
A very useful addition to Oscommerce - finally removing one of the big barriers to being able to deploy this to the business sector (rather than the "amateur business" sector) -> attributes stock levels. Good work.
#49
Posted 06 December 2003, 15:32
add_slave was infact broken but don't know why.
Used a foreach loop und worked after some tries like a charm
Sorry for bothering!
#50
Posted 07 December 2003, 06:47
burt, on Dec 6 2003, 09:00 AM, said:
Idea for next version:
The dropdown quantity selector goes from 0 -> 20 on every product. This would be more beneficial to go from 0 -> quantity in stock.
I will have a go at doing this when I finish my next project (if no-one does it in the meantime).
A very useful addition to Oscommerce - finally removing one of the big barriers to being able to deploy this to the business sector (rather than the "amateur business" sector) -> attributes stock levels. Good work.
I've been toying in my mind with what to do with the quantity select - basing it on stock becomes a problem if there is a great deal of stock - I definitely intend to add admin control of the select range - perhaps a stock option if it is not too difficult. Some people prefer a simple text field, so this needs to be an option also. Global settings are simple, but some also prefer control per product.... this also is a consideration.....
Attributes are the no.1 priority at the moment - this will multiply the usefulness of Master Products immensly... almost there, busy, busy....
Also in the works: - (Admin) easy identification of Master and Slave products - the abilty to select a Master and have Slaves listed with it . More control for Master products so they are purchasable - this will include a quantity select on product_info.php for the Master, maintaining a single Buy Now button. An option on the admin product edit page whether a slave will have its own product_info page or not.... I think perhaps a series of check boxes as to which pages a Slave will show on... products_new, specials etc.
Feedback/ideas are greatly appreciated.
Matti
We were all once expert at...... nothing
_____
#51
Posted 07 December 2003, 09:51
Your Shopping Cart is empty! (every time)
Why?
I use
Apache 1.3.29
PHP 4.3.4
MySQL 4.0.16
at php.ini
register_globals=on
Can somebody help?
#52
Posted 07 December 2003, 14:19
ruta, on Dec 7 2003, 09:51 AM, said:
Your Shopping Cart is empty! (every time)
Why?
I use
Apache 1.3.29
PHP 4.3.4
MySQL 4.0.16
at php.ini
register_globals=on
Can somebody help?
with the following:
//Master Products ENDLICH ÜBERHOLT!! René Reineke 06.12.03
// customer adds multiple products from the master_listing page
case 'add_slave' :
foreach ($HTTP_POST_VARS as $keyA => $valueA) {
if (substr($keyA,0,11) == "Qty_ProdId_") {
$prodId = substr($keyA,11);
if ($valueA <= 0 ) continue;
$cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId, $HTTP_POST_VARS['id']))+($valueA), $HTTP_POST_VARS['id']);
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
//Master Products EOF
Worked for me!
Edited by flynst4r, 07 December 2003, 14:22.
#53
Posted 08 December 2003, 01:57
#54
Posted 08 December 2003, 04:00
I have a master product with 2 slaves (color and sizes). When I select how many of a slave I want, the program only adds the master product and not the slave.
The only way I can add a slave is to click on the slave image, thus opening it's own product page, and then adding to the cart from there.
Also, my slave products are showing up in the "New products" box even though they are set no to show in the listing.
Thank you folks for all of the contributions and support you have provided. You are helping me reach my dream. I can't express enough how awesome you all are.
--Kristy
Kristy
I'm just a girl living in captivity
Your rules of thumb makes me worrisome
#55
Posted 08 December 2003, 05:28
burt, on Dec 6 2003, 08:00 AM, said:
$quantity_select_list = array();
for ($i = 0, $n2 = (($listing['products_quantity'] < 20) ? $listing['products_quantity'] : 20); $i <= $n2; $i++) {
$quantity_select_list[] = array('id' => $i, 'text' => $i);
}
$lc_text = tep_draw_pull_down_menu('Qty_ProdId_' . $listing['products_id'], $quantity_select_list, '0', 'class="main" style="width: 40px"');Note that the 20 and the '0' could be replaced by admin settings and that the whole thing could be enclosed in an if statement that selects between the pull_down (code here) and an input field.Hth,
Matt
#56
Posted 08 December 2003, 10:57
iiinetworks, on Dec 8 2003, 01:28 AM, said:
$master_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_quantity, p.products_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 . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master = '" . $thisquery['products_master'] . "' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";
For those who didn't quite get that, the '20' in Matt's code is the upper limit the drop menu will display - change to the desired setting. Good one
Edited by Johnson, 08 December 2003, 10:57.
We were all once expert at...... nothing
_____
#57
Posted 08 December 2003, 13:14
## after
$info_box_contents[$cur_row][] = array('align' => 'center',
'params' => 'class="productListing-data" valign="top"',
'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']));
##add this
// René Reineke -- link back to master product on shopping cart
$master_prod = tep_db_query("select products_master, products_master_status
from " . TABLE_PRODUCTS . "
where products_id = '" . $products[$i]['id'] . "'");
$master_prod_values = tep_db_fetch_array($master_prod);
if (($master_prod_values['products_master_status'] == 0) && ($master_prod_values['products_master'] != 0)) {
$products[$i]['id'] = $master_prod_values['products_master'];
}
// René Reineke MaSTER Mod end
creates an extra query. I'm sure it can be optimized but no time now.
#58
Posted 08 December 2003, 16:44
iiinetworks, on Dec 8 2003, 05:28 AM, said:
burt, on Dec 6 2003, 08:00 AM, said:
$quantity_select_list = array();
for ($i = 0, $n2 = (($listing['products_quantity'] < 20) ? $listing['products_quantity'] : 20); $i <= $n2; $i++) {
$quantity_select_list[] = array('id' => $i, 'text' => $i);
}
$lc_text = tep_draw_pull_down_menu('Qty_ProdId_' . $listing['products_id'], $quantity_select_list, '0', 'class="main" style="width: 40px"');Note that the 20 and the '0' could be replaced by admin settings and that the whole thing could be enclosed in an if statement that selects between the pull_down (code here) and an input field.Hth,
Matt
#59
Posted 09 December 2003, 03:50
Johnson, on Dec 8 2003, 05:57 AM, said:
// $select_column_list .= 'p.products_quantity, ';Hth,
Matt
#60
Posted 10 December 2003, 17:34














