Jump to content
Latest News: (loading..)

Search the Community

Showing results for tags 'products'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News and Announcements
    • News and Announcements
    • Partner Announcements
    • Ambassadors
  • Commercial Support
    • Developer Feedback
  • osCommerce Online Merchant v2.x
    • General Support
    • Installation and Configuration
    • Upgrading from Earlier Versions (v2.x to v2.x)
    • Add-Ons
    • Tips and Tricks
    • Security
  • Development
    • osCommerce Online Merchant v2.4
    • osCommerce Online Merchant Community Bootstrap Edition
    • osCommerce Online Merchant v3.x
    • Development Proposals
  • General
    • OSCOMMERCE.TV
    • Next Steps / Optimizations / Marketing
    • Live Shop Reviews
    • E-Commerce Laws
    • General Discussions
    • PHP / SQL / Web Design
  • oscBooks and oscTemplates's Announcements
  • PayPal's Announcements
  • Sage Pay's Announcements
  • Solomono - new level osCommerce templates's Announcements
  • German Community's OSCOM v2.x
  • German Community's Allgemein
  • German Community's OSCOM v3.x

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Real Name


Location


Interests


Website


Skype

Found 14 results

  1. This Addon replaces the New Product page in your store's admin with a tabbed interface that is better organized and easier to use. The rest of the Categories/Products admin is the same; only the Product page has been changed. I backported this from the osCommerce 2.3.5 Beta, then added the additional fields that the 2.3.4.1 Bootstrap version uses. I did this because the old Products page has always felt poorly organized and confusing to me. If you feel the same way, give this one a try. Code is here. Screenshot:
  2. I have been looking on this forum and searched other websites, and would like to find an addon that is suitable for use on the BS version, that will create bundles of products, which can be made up with in stock items, and sold at a discounted price. When a bundle is sold, the stock of the individual products must be reduced. I currently have a x-sell addon installed where these products are set up to be listed at the bottom of a product listing, but really want to sell at a discount a bundles of items. What I am thinking of is to create a new product in a category of products. For example, the bundle would include say a soldering iron, a soldering iron stand, a tip cleaner and some solder. All the items are available from the site individually for say 30 GBP. The bundle will cost 25 GDP. When sold all stock for the bundled products and the bundle must reduce by one. I can find older addons such as "better together" or "bundled products" or "Master products" but nothing that will work with a BS version, and nothing that does not have hundreds of core code changes. Converting something is way above my pay grade without a lot of help. Any help or guidance appreciated. I dont care whether the addon is free or a paid for one, but it must work.
  3. This is the support topic for the Featured Products BS Addon. All credits to DunWeb Designs. I just converted to Bootstrap and fix some minor typos. http://addons.oscommerce.com/info/9355 Core code changes are necessary but only very, very few. Enjoy!
  4. Hello, I have been using an older OsC shop for years and am very happy to see this new Responsive version, I hope to use it for a new project. Right now I need help with a desired feature: I frequently import and export product to my store in .csv databases (quicker upload of new products and ability to send product database for partners). I hope to use an existing add-on with the BS version, this one seems to have separate files, so no serious modification is required: http://addons.oscommerce.com/info/8654 After installing and clicking on ExcelPopulate in admin, I get the following error messages: The "generate file" button creates this error: Can any of you wise members tell me what to change in excel.php to make this addon work with the new BS version? I sadly do not know php and only operate on a "replace this" "with that" basis. I hope it is possible to make this feature work somehow. The code to excel.php is: <?php /* $Id: define_language.php,v 1.15 2003/07/08 21:51:37 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2006 Anatolij Zavodovskij advancewebsoft.com Base on 2003 osCommerce */ ini_set ( 'memory_limit', '64M' ); require('includes/application_top.php'); tep_set_time_limit(0); $action = (isset($_GET['action']) ? $_GET['action'] : ''); if ($action == 'upload') { if ($upl_file = new upload('upl_file')) { $upl_file->set_destination( DIR_FS_ADMIN.'temp/'); if ($upl_file->parse() && $upl_file->save()) {} } } function tep_output_generated_category_path_excel($id, $from = 'category') { $calculated_category_path_string = ''; $calculated_category_path = tep_generate_category_path($id, $from); for ($i=0, $n=sizeof($calculated_category_path); $i<$n; $i++) { for ($j=sizeof($calculated_category_path[$i])-1; $j>=0; ($j=$j-1)) { $calculated_category_path_string .= $calculated_category_path[$i][$j]['text'] . ' => '; } } $calculated_category_path_string = substr($calculated_category_path_string, 0, -4); if (strlen($calculated_category_path_string) < 1) $calculated_category_path_string = TEXT_TOP; return $calculated_category_path_string; } function tep_get_category_id_from_path($str) { global $languages_id; $str_arr = explode('=>',$str); $parent_id = 0; for ($i=0;$i<sizeof($str_arr);$i++) { $str_arr[$i] = trim($str_arr[$i]); $parent_id_ar = tep_db_fetch_array(tep_db_query('select c.categories_id, cd.categories_name from '.TABLE_CATEGORIES.' c, '.TABLE_CATEGORIES_DESCRIPTION.' cd where c.categories_id=cd.categories_id and c.parent_id='.$parent_id.' and cd.categories_name=\''.tep_db_prepare_input($str_arr[$i]).'\' and cd.language_id='.$languages_id)); $parent_id = (int)$parent_id_ar['categories_id']; } return $parent_id; } // languages definition -------------------------------------- $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by languages_id"); $first_languages_id = -1; while ($languages = tep_db_fetch_array($languages_query)) { $languages_array[$languages['languages_id']] = array( 'name' => $languages['name'], 'code' => $languages['code'], 'languages_id' => $languages['languages_id'], 'image' => $languages['image'], 'directory' => $languages['directory']); if ($first_languages_id == -1) $first_languages_id = $languages['languages_id']; } $languages_array_keys = array_keys($languages_array); /// columns definition -------------------------------------- // products -------------------------------------- $products_fields = array('products_id' => 0, 'products_price' => 5, 'products_image' => 6, 'products_quantity' => 7, 'products_quantity_new' => 8, 'products_model' => 9, 'products_weight' => 10, 'products_status' => 11, 'manufacturers_id' => 12, 'categories_id' => 13, 'products_date_added' => 14, 'products_last_modified' => 15, 'products_date_available' => 16, 'products_tax_class_id' => 17, 'products_ordered' => 18 ); $products_description_fields = array('products_id' => 0, 'products_name' => 1, 'products_description' => 2, 'products_url' => 3, 'language_id' => 4); // categories -------------------------------------- $categories_fields = array('categories_id' => 0, 'categories_image' => 3, 'parent_id' => 4, 'sort_order' => 5, 'date_added' => 6, 'last_modified' => 7 ); $categories_description_fields = array('categories_id' => 0, 'categories_name' => 1, 'language_id' => 2); // manufacturers -------------------------------------- $manufacturers_fields = array('manufacturers_id' => 0, 'manufacturers_name' => 3, 'manufacturers_image' => 4, 'date_added' => 5, 'last_modified' => 6 ); $manufacturers_description_fields = array('manufacturers_id' => 0, 'manufacturers_url' => 1, 'languages_id' => 2); switch ($action) { case 'cr_file': require_once "includes/excel/Spreadsheet/Writer.php"; $dop_filename = 'products_'.Date('YmdHis').'.xls'; $xls =& new Spreadsheet_Excel_Writer('temp/'.$dop_filename); $xls->setVersion(8); $titleFormat =& $xls-> addFormat(); $titleFormat->setBgColor(''); $titleFormat->setColor('navy'); $titleFormat->setBold(); $titleFormat->setPattern(18); $sheet =& $xls->addWorksheet('Products'); // set columns width -------------------------------------- $sheet->setColumn(0, 0, 3); if (isset($products_description_fields['products_name'])){ $i = $products_description_fields['products_name']; $sheet->setColumn($i, $i, 25); } if (isset($products_description_fields['products_description'])){ $i = $products_description_fields['products_description']; $sheet->setColumn($i, $i, 25); } if (isset($products_description_fields['language_id'])){ $i = $products_description_fields['language_id']; $sheet->setColumn($i, $i, 3); } if (isset($products_fields['products_quantity'])){ $i = $products_fields['products_quantity']; $sheet->setColumn($i, $i, 4); } if (isset($products_fields['products_quantity_new'])){ $i = $products_fields['products_quantity_new']; $sheet->setColumn($i, $i, 4); } if (isset($products_fields['products_weight'])){ $i = $products_fields['products_weight']; $sheet->setColumn($i, $i, 4); } if (isset($products_fields['products_status'])){ $i = $products_fields['products_status']; $sheet->setColumn($i, $i, 4); } $sheet->freezePanes(array(1, 2)); // generating products -------------------------------------- if (isset($HTTP_POST_VARS['gn_products'])&&trim($HTTP_POST_VARS['gn_products'])<>'') { $ins_arr = array_merge($products_fields,$products_description_fields); array_multisort($ins_arr); while (list($key, $value) = each($ins_arr)) { $sheet->write(0,$value,str_replace('products_','',$key),$titleFormat); } $s = 'p.'.implode(", p.", array_keys($products_fields)).', '; $s .= 'pd.'.implode(", pd.", array_keys($products_description_fields)); $s = str_replace(', p.categories_id','',$s); $s = str_replace(', p.products_quantity_new','',$s); $product_categories_id = (int)$HTTP_POST_VARS['categories_id']; $dop_where = ''; if ($product_categories_id>0) { $from_str = ' from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd , '.TABLE_PRODUCTS_TO_CATEGORIES.' ptc '; $cat_ar = tep_get_category_tree($product_categories_id,'',0,'',true); for ($i=0;$i<sizeof($cat_ar);$i++) $dop_st .= ' ptc.categories_id='.$cat_ar[$i]['id'].' or '; $dop_st = substr($dop_st, 0, -3); if (trim($dop_st)<>'') $dop_where = ' and (p.products_id=ptc.products_id) and ('.$dop_st.')'; else $dop_where = ' and (p.products_id=ptc.products_id) and (ptc.categories_id=-1234)'; } else $from_str = ' from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd '; $products_query = tep_db_query('select '.$s. $from_str . ' where (p.products_id=pd.products_id) '.$dop_where.' and (p.products_id<='.(int)$HTTP_POST_VARS['max_products'].' and p.products_id>='.(int)$HTTP_POST_VARS['min_products'].') order by '.((sizeof($languages_array_keys)>1) ? 'p.products_id, pd.language_id ':'pd.products_name' )) ; $i=1; while ($products = tep_db_fetch_array($products_query)) { reset($ins_arr); while (list($key, $value) = each($ins_arr)) { if (($products['language_id'] == $first_languages_id) || (array_key_exists($key,$products_description_fields))) $sheet->write($i,$value,$products[$key]); } $sheet->write($i,$products_description_fields['language_id'],$languages_array[$products['language_id']]['code']); if ($products['language_id'] == $first_languages_id) { $dop_cat_name = ''; $prod_to_cat_query = tep_db_query('select categories_id from '.TABLE_PRODUCTS_TO_CATEGORIES.' where products_id='.$products['products_id']); while ($prod_to_cat = tep_db_fetch_array($prod_to_cat_query)) { $categ_names = tep_output_generated_category_path_excel($prod_to_cat['categories_id']); if ($prod_to_cat['categories_id'] == 0) $dop_cat_name1 = 'Top'; else $dop_cat_name1 = $categ_names; $dop_cat_name .= (($dop_cat_name<>'')?"\n":'').$dop_cat_name1; } $sheet->writeString($i,$products_fields['categories_id'],$dop_cat_name); $manuf_name = tep_db_fetch_array(tep_db_query('select manufacturers_name from '.TABLE_MANUFACTURERS.' where manufacturers_id='.(int)$products['manufacturers_id'])); $sheet->writeString($i,$products_fields['manufacturers_id'],trim($manuf_name['manufacturers_name'])); } $i++; } } // generating categories -------------------------------------- $sheet1 =& $xls->addWorksheet('Categories'); $sheet1->setColumn(0, 0, 3); if (isset($categories_description_fields['categories_name'])){ $i = $categories_description_fields['categories_name']; $sheet1->setColumn($i, $i, 25); } if (isset($categories_description_fields['language_id'])){ $i = $categories_description_fields['language_id']; $sheet1->setColumn($i, $i, 3); } if (isset($categories_fields['categories_image'])){ $i = $categories_fields['categories_image']; $sheet1->setColumn($i, $i, 10); } if (isset($categories_fields['parent_id'])){ $i = $categories_fields['parent_id']; $sheet1->setColumn($i, $i, 25); } if (isset($categories_fields['sort_order'])){ $i = $categories_fields['sort_order']; $sheet1->setColumn($i, $i, 3); } $sheet1->freezePanes(array(1, 0)); if (isset($HTTP_POST_VARS['gn_categories'])&&trim($HTTP_POST_VARS['gn_categories'])<>'') { $ins_arr = array_merge($categories_fields,$categories_description_fields); array_multisort($ins_arr); $s = 'c.'.implode(", c.", array_keys($categories_fields)).', '; $s .= 'cd.'.implode(", cd.", array_keys($categories_description_fields)); $categories_query = tep_db_query('select '.$s.' from '.TABLE_CATEGORIES.' c, '.TABLE_CATEGORIES_DESCRIPTION.' cd where c.categories_id=cd.categories_id and c.categories_id<='.(int)$HTTP_POST_VARS['max_categories'].' and c.categories_id>='.(int)$HTTP_POST_VARS['min_categories'].' order by c.categories_id'); while (list($key, $value) = each($ins_arr)) { $sheet1->write(0,$value,str_replace('categories_','',$key),$titleFormat); } $i = 1; while ($categories = tep_db_fetch_array($categories_query)) { reset($ins_arr); while (list($key, $value) = each($ins_arr)) { if (($categories['language_id'] == $first_languages_id) || (array_key_exists($key,$categories_description_fields))) $sheet1->write($i,$value,$categories[$key]); } $sheet1->write($i,$categories_description_fields['language_id'],$languages_array[$categories['language_id']]['code']); if ($categories['language_id'] == $first_languages_id) { $categ_name = tep_output_generated_category_path_excel($categories['parent_id']); $sheet1->write($i,$categories_fields['parent_id'],$categ_name); } $i++; } } // generating manufacturers -------------------------------------- $sheet2 =& $xls->addWorksheet('Manufacturers'); $sheet2->setColumn(0, 0, 3); if (isset($manufacturers_description_fields['languages_id'])){ $i = $manufacturers_description_fields['languages_id']; $sheet2->setColumn($i, $i, 3); } if (isset($manufacturers_fields['manufacturers_name'])){ $i = $manufacturers_fields['manufacturers_name']; $sheet2->setColumn($i, $i, 25); } if (isset($manufacturers_fields['manufacturers_image'])){ $i = $manufacturers_fields['manufacturers_image']; $sheet2->setColumn($i, $i, 15); } $sheet2->freezePanes(array(1, 0)); if (isset($HTTP_POST_VARS['gn_manufacturers'])&&trim($HTTP_POST_VARS['gn_manufacturers'])<>'') { $ins_arr = array_merge($manufacturers_fields,$manufacturers_description_fields); array_multisort($ins_arr); $s = 'm.'.implode(", m.", array_keys($manufacturers_fields)).', '; $s .= 'md.'.implode(", md.", array_keys($manufacturers_description_fields)); $manufacturers_query = tep_db_query('select '.$s.' from '.TABLE_MANUFACTURERS.' m, '.TABLE_MANUFACTURERS_INFO.' md where m.manufacturers_id=md.manufacturers_id and m.manufacturers_id<='.(int)$HTTP_POST_VARS['max_manufacturers'].' and m.manufacturers_id>='.(int)$HTTP_POST_VARS['min_manufacturers'].' order by m.manufacturers_name'); while (list($key, $value) = each($ins_arr)) { $sheet2->write(0,$value,str_replace('manufacturers_','',$key),$titleFormat); } $i = 1; if (isset($HTTP_POST_VARS['gn_manufacturers'])&&trim($HTTP_POST_VARS['gn_manufacturers'])<>'') while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { reset($ins_arr); while (list($key, $value) = each($ins_arr)) { if (($manufacturers['languages_id'] == $first_languages_id) || (array_key_exists($key,$manufacturers_description_fields))) $sheet2->write($i,$value,$manufacturers[$key]); } $sheet2->write($i,$manufacturers_description_fields['languages_id'],$languages_array[$manufacturers['languages_id']]['code']); $i++; } } // generating attributes -------------------------------------- $sheet3 =& $xls->addWorksheet('Attributes'); $sheet4 =& $xls->addWorksheet('Options'); $sheet3->setColumn(0, 0, 3); $sheet4->setColumn(0, 0, 3); $sheet4->setColumn(1, 1, 25); $sheet4->setColumn(2, 2, 25); $sheet3->freezePanes(array(2, 2)); $sheet4->freezePanes(array(1, 0)); // $sheet3->writeString(0,0,'Product Options'); // $sheet3->writeString(1,0,'Option Values'); if (isset($HTTP_POST_VARS['gn_attributes'])&&trim($HTTP_POST_VARS['gn_attributes'])<>'') { $options = "select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$languages_id . "' order by products_options_name"; $options = tep_db_query($options); $i = 2; while ($options_values = tep_db_fetch_array($options)) { $sheet3->write(0,$i,$options_values['products_options_name'],$titleFormat); $products_options_values_qu = tep_db_query("select pov.* from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov left join " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " pov2po on pov.products_options_values_id = pov2po.products_options_values_id where pov2po.products_options_id=".$options_values['products_options_id']." and pov.language_id = '" . (int)$languages_id . "' order by pov.products_options_values_name"); while ($products_options_values = tep_db_fetch_array($products_options_values_qu)) { $sheet3->write(1,$i,$products_options_values['products_options_values_name'],$titleFormat); $options_values_columns[$products_options_values['products_options_values_id']] = $i; $i++; } } $product_categories_id = (int)$HTTP_POST_VARS['attr_categories_id']; $dop_where = ''; if ($product_categories_id>0) { $from_str = ' from '.TABLE_PRODUCTS_ATTRIBUTES.' pa, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRODUCTS_TO_CATEGORIES.' ptc '; $cat_ar = tep_get_category_tree($product_categories_id,'',0,'',true); for ($i=0;$i<sizeof($cat_ar);$i++) $dop_st .= ' ptc.categories_id='.$cat_ar[$i]['id'].' or '; $dop_st = substr($dop_st, 0, -3); if (trim($dop_st)<>'') $dop_where = ' and (pa.products_id=ptc.products_id) and ('.$dop_st.')'; else $dop_where = ' and (pa.products_id=ptc.products_id) and ( ptc.categories_id=-1234)'; } else $from_str = ' from '.TABLE_PRODUCTS_ATTRIBUTES.' pa, '.TABLE_PRODUCTS_DESCRIPTION.' pd '; $products_query = tep_db_query('select pa.* '. $from_str. ' where (pa.products_id<='.(int)$HTTP_POST_VARS['max_attributes'].' and pa.products_id>='.(int)$HTTP_POST_VARS['min_attributes'].' and pa.products_id=pd.products_id '.$dop_where.' and pd.language_id = '.$languages_id.') group by pa.products_id order by pd.products_name '); $i = 2; while ($products = tep_db_fetch_array($products_query)) { $sheet3->write($i,0,$products['products_id']); $sheet3->write($i,1,tep_get_products_name($products['products_id'],$first_languages_id)); $dop_products_query = tep_db_query('select * from '.TABLE_PRODUCTS_ATTRIBUTES.' where products_id='.$products['products_id']); while ($dop_products = tep_db_fetch_array($dop_products_query)) { $dop_st = ''; if (isset($options_values_columns[$dop_products['options_values_id']])) { if ($dop_products['price_prefix']<>'+') $dop_st = $dop_products['price_prefix']; $sheet3->write($i,$options_values_columns[$dop_products['options_values_id']],$dop_st.$dop_products['options_values_price']); } else $messageStack->add_session('Attributes sheet: There is incorrect attribute for product '.tep_get_products_name($products['products_id'],$first_languages_id).' id='.$products['products_id'].' ', 'warning'); } $i++; } // generating products options -------------------------------------- $values = "select pov.language_id,pov.products_options_values_id, pov.products_options_values_name, pov2po.products_options_id from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov left join " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " pov2po on pov.products_options_values_id = pov2po.products_options_values_id order by pov.products_options_values_id, pov.language_id"; $values = tep_db_query($values); $sheet4->write(0,0,'Language',$titleFormat); $sheet4->write(0,1,'Option Name',$titleFormat); $sheet4->write(0,2,'Option Values',$titleFormat); $i = 1; while ($values_values = tep_db_fetch_array($values)) { $options_name = tep_options_name($values_values['products_options_id']); $values_name = $values_values['products_options_values_name']; $sheet4->write($i,0,$languages_array[$values_values['language_id']]['code']); $sheet4->write($i,1,$options_name); $sheet4->write($i,2,$values_name); $i++; } } $xls->close(); $messageStack->add_session('File '.$dop_filename.' has been generated', 'success'); tep_redirect(excel.php); break; /// POPULATE -------------------------------------- case 'populate': require_once 'includes/excel/reader.php'; $data = new Spreadsheet_Excel_Reader(); $data->setRowColOffset(0); //$data->setOutputEncoding('CP1251'); $data->read('temp/'.urldecode($_GET['filename'])); // populate categories -------------------------------------- if (strstr($data->sheets[1]['cells'][0][0],'PPL')) { $messageStack->add_session('Categories populated', 'success'); $i = 1; while ($i <= $data->sheets[1]['numRows']) { if (trim($data->sheets[1]['cells'][$i][1])<>'') { reset($categories_fields); unset($sql_data_array); while (list($key, $value) = each($categories_fields)) { switch ($key) { case 'manufacturers_id': case 'categories_id': break; case 'last_modified': if (trim($data->sheets[1]['cells'][$i][$value])<>'') $sql_data_array[$key] = tep_db_prepare_input($data->sheets[1]['cells'][$i][$value]); else $sql_data_array[$key] = 'null'; break; default: $sql_data_array[$key] = tep_db_prepare_input($data->sheets[1]['cells'][$i][$value]); break; } } $categories_id = (int)tep_db_prepare_input($data->sheets[1]['cells'][$i][0]); if ($categories_id > 0) { tep_db_perform(TABLE_CATEGORIES, $sql_data_array, 'update', "categories_id = '" . $categories_id . "'"); $action = 'update'; } else { tep_db_perform(TABLE_CATEGORIES, $sql_data_array); $categories_id = tep_db_insert_id(); $action = 'insert'; } for ($j = 0; $j < sizeof($languages_array_keys); $j++) { reset($categories_description_fields); unset($sql_data_array); while (list($key, $value) = each($categories_description_fields)) { if (($key<>'language_id') && ($key<>'categories_id')) $sql_data_array[$key] = tep_db_prepare_input($data->sheets[1]['cells'][$i+$j][$value]); } if ($action == 'update') { tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$languages_array_keys[$j] . "'"); } else { $sql_data_array['categories_id'] = $categories_id; $sql_data_array['language_id'] = $languages_array_keys[$j]; tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array); } } } $i = $i+sizeof($languages_array_keys); } if (array_key_exists('parent_id',$categories_fields)) { $i = 1; while ($i <= $data->sheets[1]['numRows']) { if (trim($data->sheets[1]['cells'][$i][1])<>'') { $parent_id = (int)tep_get_category_id_from_path($data->sheets[1]['cells'][$i][$categories_fields['parent_id']]); if (($parent_id>0) || tep_db_prepare_input($data->sheets[1]['cells'][$i][$categories_fields['parent_id']])=='Top' || tep_db_prepare_input($data->sheets[1]['cells'][$i][$categories_fields['parent_id']])=='') { tep_db_query('update '.TABLE_CATEGORIES.' set parent_id=\''.(int)$parent_id.'\' where categories_id=\''.tep_db_prepare_input($data->sheets[1]['cells'][$i][0]).'\''); } elseif (($parent_id == 0) && tep_db_prepare_input($data->sheets[1]['cells'][$i][$categories_fields['parent_id']])<>'Top') $messageStack->add_session('Categories sheet: Do not find parent category for category with id='.$data->sheets[1]['cells'][$i][0].' ', 'warning'); } $i = $i+sizeof($languages_array_keys); } } } // populate manufacturers -------------------------------------- if (strstr($data->sheets[2]['cells'][0][0],'PPL')) { $messageStack->add_session('Manufacturers populated', 'success'); $i = 1; while ($i <= $data->sheets[2]['numRows']) { if (trim($data->sheets[2]['cells'][$i][1])<>'') { reset($manufacturers_fields); unset($sql_data_array); while (list($key, $value) = each($manufacturers_fields)) { switch ($key) { case 'manufacturers_id': break; case 'last_modified': if (trim($data->sheets[2]['cells'][$i][$value])<>'') $sql_data_array[$key] = tep_db_prepare_input($data->sheets[2]['cells'][$i][$value]); else $sql_data_array[$key] = 'null'; break; default: $sql_data_array[$key] = tep_db_prepare_input($data->sheets[2]['cells'][$i][$value]); break; } } $manufacturers_id = (int)tep_db_prepare_input($data->sheets[2]['cells'][$i][0]); if ($manufacturers_id > 0) { tep_db_perform(TABLE_MANUFACTURERS, $sql_data_array, 'update', "manufacturers_id = '" . $manufacturers_id . "'"); $action = 'update'; } else { tep_db_perform(TABLE_MANUFACTURERS, $sql_data_array); $manufacturers_id = tep_db_insert_id(); $action = 'insert'; } for ($j = 0; $j < sizeof($languages_array_keys); $j++) { reset($manufacturers_description_fields); unset($sql_data_array); while (list($key, $value) = each($manufacturers_description_fields)) { if (($key<>'languages_id') && ($key<>'manufacturers_id')) $sql_data_array[$key] = tep_db_prepare_input($data->sheets[2]['cells'][$i+$j][$value]); } if ($action == 'update') { tep_db_perform(TABLE_MANUFACTURERS_INFO, $sql_data_array, 'update', "manufacturers_id = '" . (int)$manufacturers_id . "' and languages_id = '" . (int)$languages_array_keys[$j] . "'"); } else { $sql_data_array['manufacturers_id'] = $manufacturers_id; $sql_data_array['languages_id'] = $languages_array_keys[$j]; tep_db_perform(TABLE_MANUFACTURERS_INFO, $sql_data_array); } } } $i = $i+sizeof($languages_array_keys); } } // populate products -------------------------------------- if (strstr($data->sheets[0]['cells'][0][0],'PPL')) { $messageStack->add_session('Products populated', 'success'); $i = 1; while ($i <= $data->sheets[0]['numRows']) { if (((isset($products_description_fields['products_url']))&&strtolower(trim($data->sheets[0]['cells'][$i][$products_description_fields['products_url']]))<>'d')||(empty($products_description_fields['products_url']))) { if (trim($data->sheets[0]['cells'][$i][1])<>'') { reset($products_fields); unset($sql_data_array); while (list($key, $value) = each($products_fields)) { switch ($key) { case 'products_id': case 'manufacturers_id': case 'categories_id': case 'products_quantity': break; case 'products_quantity_new': if (trim($data->sheets[0]['cells'][$i][$products_fields['products_quantity_new']])<>'') $sql_data_array['products_quantity'] = tep_db_prepare_input($data->sheets[0]['cells'][$i][$products_fields['products_quantity_new']]); break; case 'products_last_modified': case 'products_date_available': if (trim($data->sheets[0]['cells'][$i][$value])<>'') $sql_data_array[$key] = tep_db_prepare_input($data->sheets[0]['cells'][$i][$value]); else $sql_data_array[$key] = 'null'; break; case 'products_status': if ((tep_db_prepare_input($data->sheets[0]['cells'][$i][$value])==1)||(tep_db_prepare_input($data->sheets[0]['cells'][$i][$value])=='')) $products_status = 1; else $products_status = tep_db_prepare_input($data->sheets[0]['cells'][$i][$value]); $sql_data_array[$key] = $products_status; break; default: $sql_data_array[$key] = tep_db_prepare_input($data->sheets[0]['cells'][$i][$value]); break; } } $products_id = (int)tep_db_prepare_input($data->sheets[0]['cells'][$i][0]); // product manufacturers -------------------------------------- if (isset($products_fields['manufacturers_id'])) { if (trim($data->sheets[0]['cells'][$i][$products_fields['manufacturers_id']])<>'') { $manufacturers_id_qu = tep_db_query('select manufacturers_id from '.TABLE_MANUFACTURERS.' where manufacturers_name=\''.tep_db_prepare_input($data->sheets[0]['cells'][$i][$products_fields['manufacturers_id']]).'\''); $manufacturers_id_ar = tep_db_fetch_array($manufacturers_id_qu); if ((int)$manufacturers_id_ar['manufacturers_id']>0) $manufacturers_id = (int)$manufacturers_id_ar['manufacturers_id']; else $messageStack->add_session('Products sheet: wrong manufacturers name for product with id='.$products_id, 'warning'); } else $manufacturers_id = 0; $sql_data_array['manufacturers_id'] = $manufacturers_id; } // product manufacturers -------------------------------------- if ((int)$products_id > 0) { tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . $products_id . "'"); $action = 'update'; } else { tep_db_perform(TABLE_PRODUCTS, $sql_data_array); $products_id = tep_db_insert_id(); if (strstr($data->sheets[3]['cells'][0][0],'PPL')) $inserted_products_id[$data->sheets[0]['cells'][$i][$products_description_fields['products_name']]] = $products_id; $action = 'insert'; } for ($j = 0; $j < sizeof($languages_array_keys); $j++) { reset($products_description_fields); unset($sql_data_array); while (list($key, $value) = each($products_description_fields)) { if (($key<>'language_id') && ($key<>'products_id')) $sql_data_array[$key] = tep_db_prepare_input($data->sheets[0]['cells'][$i+$j][$value]); } if ($action == 'update') { tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$languages_array_keys[$j] . "'"); } else { $sql_data_array['products_id'] = $products_id; $sql_data_array['language_id'] = $languages_array_keys[$j]; tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array); } } // product categories -------------------------------------- if (isset($products_fields['categories_id'])) { $dop_arr = explode("\n",$data->sheets[0]['cells'][$i][$products_fields['categories_id']]); tep_db_query('delete from '.TABLE_PRODUCTS_TO_CATEGORIES.' where products_id = '.$products_id); for ($k=0; $k<sizeof($dop_arr); $k++) { $sql_data_array = array('products_id' => $products_id, 'categories_id' => tep_get_category_id_from_path($dop_arr[$k])); tep_db_perform(TABLE_PRODUCTS_TO_CATEGORIES, $sql_data_array); } } // product categories -------------------------------------- } } elseif ((isset($products_description_fields['products_url']))&&strtolower(trim($data->sheets[0]['cells'][$i][$products_description_fields['products_url']])) == 'd') { $products_id = (int)tep_db_prepare_input($data->sheets[0]['cells'][$i][0]); tep_remove_product($products_id); } $i = $i+sizeof($languages_array_keys); } } // populate products attributes -------------------------------------- if (strstr($data->sheets[3]['cells'][0][0],'PPL')) { $messageStack->add_session('Products attributes populated', 'success'); $options = "select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$languages_id . "' order by products_options_name"; $options = tep_db_query($options); $i = 2; $options_values_array = array(); while ($options_values = tep_db_fetch_array($options)) { $products_options_values_qu = tep_db_query("select pov.* from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov left join " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " pov2po on pov.products_options_values_id = pov2po.products_options_values_id where pov2po.products_options_id=".$options_values['products_options_id']." and pov.language_id = '" . (int)$languages_id . "' order by pov.products_options_values_name"); while ($products_options_values = tep_db_fetch_array($products_options_values_qu)) { $options_values_array[$i] = $products_options_values['products_options_values_id'].'_'.$options_values['products_options_id']; $i++; } } $i = 2; $numCols = sizeof($options_values_array)+1; while ($i <= $data->sheets[3]['numRows']) { if (trim($data->sheets[3]['cells'][$i][1])<>'') { for ($j=2;$j<=$numCols;$j++) { $options_values_price = $data->sheets[3]['cells'][$i][$j]; if (trim($data->sheets[3]['cells'][$i][0])<>'') $products_id = (int)$data->sheets[3]['cells'][$i][0]; else $products_id = $inserted_products_id[$data->sheets[3]['cells'][$i][1]]; if ($products_id>0) { $options_id = (int)substr($options_values_array[$j],strpos($options_values_array[$j],'_')+1,strlen($options_values_array[$j])); $options_values_id = (int)$options_values_array[$j]; if (trim($options_values_price)<>'') { unset($sql_data_array); $sql_data_array = array('products_id'=>$products_id, 'options_id'=>$options_id, 'options_values_id'=>$options_values_id, 'options_values_price'=>abs($options_values_price), 'price_prefix'=>(($options_values_price>=0)?'+':'-')); $products_attributes_id_qu = tep_db_query('select products_attributes_id from '.TABLE_PRODUCTS_ATTRIBUTES.' where products_id='.$products_id.' and options_id='.$options_id.' and options_values_id='.$options_values_id); if (tep_db_num_rows($products_attributes_id_qu)>0) { $products_attributes_id = tep_db_fetch_array($products_attributes_id_qu); $products_attributes_id = $products_attributes_id['products_attributes_id']; tep_db_perform(TABLE_PRODUCTS_ATTRIBUTES, $sql_data_array, 'update', "products_attributes_id = '" . (int)$products_attributes_id . "'"); } else tep_db_perform(TABLE_PRODUCTS_ATTRIBUTES, $sql_data_array); } else { unset($products_attributes_id); $products_attributes_id_qu = tep_db_query('select products_attributes_id from '.TABLE_PRODUCTS_ATTRIBUTES.' where products_id='.$products_id.' and options_id='.$options_id.' and options_values_id='.$options_values_id); $products_attributes_id = tep_db_fetch_array($products_attributes_id_qu); $products_attributes_id = $products_attributes_id['products_attributes_id']; if ($products_attributes_id>0) { tep_db_query('delete from '.TABLE_PRODUCTS_ATTRIBUTES.' where products_attributes_id='.$products_attributes_id); tep_db_query('delete from '.TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD.' where products_attributes_id='.$products_attributes_id); } } } else $messageStack->add_session('Something wrong with product name or id in row #'.$i, 'error'); } } $i++; } } tep_redirect(excel.php); break; case 'delete_confirm': @unlink(DIR_FS_ADMIN.'temp/' . $_GET['filename']); tep_redirect(excel.php); break; } ?> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="init()"> <div id="spiffycalendar" class="text"></div> <!-- header //--> <?php require('includes/header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <?php require('includes/column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"> <table width="100%" border="0"> <tr><td> <?php echo '<font style="size:8px;">Upload file:</font><br>'.tep_draw_form('categories', FILENAME_EXCEL, 'action=upload', 'post', 'enctype="multipart/form-data"'); echo tep_draw_file_field('upl_file').'<br>'.tep_image_submit('button_upload.gif', IMAGE_UPLOAD); ?></form> </td> </tr> <?php $contents = array(); $current_path = DIR_FS_ADMIN.'temp'; $dir = dir(DIR_FS_ADMIN.'temp'); while ($file = $dir->read()) { if ( ($file != '.') && ($file != 'CVS') && ( ($file != '..') || ($current_path != DIR_FS_DOCUMENT_ROOT) ) ) { $file_size = number_format(filesize($current_path . '/' . $file)) . ' bytes'; $permissions = ''; if ($showuser) { $user = @posix_getpwuid(fileowner($current_path . '/' . $file)); $group = @posix_getgrgid(filegroup($current_path . '/' . $file)); } else { $user = $group = array(); } $contents[] = array('name' => $file, 'is_dir' => is_dir($current_path . '/' . $file), 'last_modified' => strftime(DATE_TIME_FORMAT, filemtime($current_path . '/' . $file)), 'size' => $file_size, 'permissions' => $permissions, 'user' => $user['name'], 'group' => $group['name']); } } function tep_cmp($a, $b) { return strcmp( ($a['is_dir'] ? 'D' : 'F') . $a['name'], ($b['is_dir'] ? 'D' : 'F') . $b['name']); } usort($contents, 'tep_cmp'); ?> <tr> <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top" align="right"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent">File name</td> <td class="dataTableHeadingContent" align="right">File size</td> <td class="dataTableHeadingContent" align="center">Last Modified</td> <td class="dataTableHeadingContent" align="right">Action </td> </tr> <?php $icon = tep_image(DIR_WS_ICONS . 'file_download.gif', ICON_FILE_DOWNLOAD); for ($i=0, $n=sizeof($contents); $i<$n; $i++) { if ((!isset($HTTP_GET_VARS['info']) || (isset($HTTP_GET_VARS['info']) && ($HTTP_GET_VARS['info'] == $contents[$i]['name']))) && !isset($fInfo) && ($action != 'upload') && ($action != 'new_folder')) { $fInfo = new objectInfo($contents[$i]); } if ($contents[$i]['name'] == '..') { $goto_link = substr($current_path, 0, strrpos($current_path, '/')); } else { $goto_link = $current_path . '/' . $contents[$i]['name']; } /*if (isset($fInfo) && is_object($fInfo) && ($contents[$i]['name'] == $fInfo->name)) { if ($fInfo->is_dir) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n"; $onclick_link = 'goto=' . $goto_link; } else { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n"; $onclick_link = 'info=' . urlencode($fInfo->name) . '&action=edit'; } } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">' . "\n"; $onclick_link = 'info=' . urlencode($contents[$i]['name']); }*/ echo '<tr class="dataTableRow">'; if ($contents[$i]['is_dir']) { if ($contents[$i]['name'] == '..') { } else { } } else { } $link = tep_href_link(FILENAME_EXCEL, 'goto=' . $current_path.'/'.$contents[$i]['name']); if ($contents[$i]['name'] <> '..') { ?> <td class="dataTableContent"><?php echo '<a href="' .HTTP_SERVER.DIR_WS_ADMIN.'temp/'. $contents[$i]['name'] . '">' . $icon . ' ' . $contents[$i]['name'].'</a>'; ?></td> <td class="dataTableContent" align="right"><?php echo ($contents[$i]['is_dir'] ? ' ' : $contents[$i]['size']); ?></td> <td class="dataTableContent" align="center"><?php echo $contents[$i]['last_modified']; ?></td> <td class="dataTableContent" align="right"> <?php echo '<a href="'.tep_href_link(FILENAME_EXCEL, 'action=start_populate&filename='.urlencode($contents[$i]['name'])).'">Populate from file</a> <a href="'.tep_href_link(FILENAME_EXCEL, 'action=start_delete&filename='.urlencode($contents[$i]['name'])).'">'.tep_image(DIR_WS_IMAGES . 'icon_delete.gif','Delete').'</a>'; ?> </td></tr> <?php }} ?> </table> <?php echo '<a href="'.tep_href_link(FILENAME_EXCEL, 'action=start_cr_file').'">Generate file</a> '; ?> <?php $heading = array(); $contents = array(); switch ($action) { case 'start_populate': $heading[] = array('text' => '<b>Start populate</b>'); $contents[] = array('text' => 'Would you like to start populate of '.urldecode($_GET['filename']).'?'); $contents[] = array('align' => 'center', 'text' => '<br><a href="'.tep_href_link(FILENAME_EXCEL, 'action=populate&filename='.urlencode(urldecode($_GET['filename']))).'">'.tep_image_button('button_populate.gif', 'populate')); break; case 'start_delete': $heading[] = array('text' => '<b>Delete file</b>'); $contents[] = array('text' => 'Would you like to delegte '.$_GET['filename'].'?'); $contents[] = array('align' => 'center', 'text' => '<br><a href="'.tep_href_link(FILENAME_EXCEL, 'action=delete_confirm&filename='.urlencode(urldecode($_GET['filename']))).'">'.tep_image_button('button_delete.gif', 'populate')); break; case 'start_cr_file': $heading[] = array('text' => '<b>Generate file</b>'); $contents = array('form' => tep_draw_form('newcategory', FILENAME_EXCEL, 'action=cr_file', 'post')); $contents[] = array('text' => 'Would you like to generate new file?<br><br>'); $products_range = tep_db_fetch_array(tep_db_query('select max(products_id) as max_id, min(products_id) as min_id from '.TABLE_PRODUCTS)); $contents[] = array('text' => tep_draw_checkbox_field('gn_products','',true).' generate products from category:<br>'. tep_draw_pull_down_menu('categories_id', tep_get_category_tree()).'<br>'. 'with id<br> from: '.tep_draw_input_field('min_products',$products_range['min_id'],' size="5"').' to: '.tep_draw_input_field('max_products',$products_range['max_id'],' size="5"').'<br><br>'); $categories_range = tep_db_fetch_array(tep_db_query('select max(categories_id) as max_id, min(categories_id) as min_id from '.TABLE_CATEGORIES)); $contents[] = array('text' => tep_draw_checkbox_field('gn_categories','',true).' generate categories with id<br> from: '.tep_draw_input_field('min_categories',$categories_range['min_id'],' size="5"').' to: '.tep_draw_input_field('max_categories',$categories_range['max_id'],' size="5"').'<br><br>'); $categories_range = tep_db_fetch_array(tep_db_query('select max(manufacturers_id) as max_id, min(manufacturers_id) as min_id from '.TABLE_MANUFACTURERS)); $contents[] = array('text' => tep_draw_checkbox_field('gn_manufacturers','',true).' generate manufacturers with id<br> from: '.tep_draw_input_field('min_manufacturers',$categories_range['min_id'],' size="5"').' to: '.tep_draw_input_field('max_manufacturers',$categories_range['max_id'],' size="5"').'<br><br>'); $products_range = tep_db_fetch_array(tep_db_query('select max(products_id) as max_id, min(products_id) as min_id from '.TABLE_PRODUCTS_ATTRIBUTES)); $contents[] = array('text' => tep_draw_checkbox_field('gn_attributes','',true).' generate attributes for products from category:<br>'. tep_draw_pull_down_menu('attr_categories_id', tep_get_category_tree()).'<br>'. 'with id<br> from: '.tep_draw_input_field('min_attributes',$products_range['min_id'],' size="5"').' to: '.tep_draw_input_field('max_attributes',$products_range['max_id'],' size="5"').'<br><br>'); $contents[] = array('align' => 'center', 'text' => '<br>'.tep_image_submit('button_generate.gif', 'generate')); break; case 'delete': break; default: break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' <td width="25%" valign="top">' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo ' </td>' . "\n"; } ?> </tr> </table></td> </tr> </table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require('includes/footer.php'); ?><!-- footer_eof //--> <br> </body> </html> <?php require('includes/application_bottom.php'); ?> I appreciate any hep and suggestions! Regards
  5. Hello everyone, In our shop we have some categories containing only a single product. I am looking for a way to automatically redirect a user who is clicking on one of these category links directly to the product page. I could do this manually via htaccess but would prefer an automatic solution. Frankly I have no clue where to start without breaking a lot of stuff - does anybody have any pointers for me? Thanks in advance, estrich
  6. Alternative Administration System: Categories/Products. is an alternative way to navigate through categories to easily find and EDIT products. It has its own ui totally different from the default admin one. You simply navigate to a php page and voila!!! Some features: Add extra custom fields easily All fields custom or not, can be editable or not, visible by default or not , sortable or not e.t.c. You can also add fields from other mysql tables other than products Deletion of multiple products Multiple prices edit Right side panel (sortable fields, choose what fields to display and sort - reorder them) Bottom panel (contains: categories list, languages, display in stock or not) Top Search panel (hidden by default, opens when you click on search icon) Server side pagination (includes max products per page) Advanced search (search on specific field, developers can add their own custom fields) Order products by different fields - custom fields Print categories and/or products (only the categories - products table, everything else is not displayed ) Multiple product status change Export products into csv, json, text or excel file I will post the addon at the addons page shortly Have a look at the screenshots: Youtube demo:
  7. I had a client that wanted to be able to search the admin categories / products page using multiple keywords in the search box. As an example, they wanted to be able to search for “ces wing” and have that return products including “Cessna 170 Left Wing Tip” just as easily as “Wing Elevator for Cessna 170.” It’s essentially a multiple wildcard array for keyword bits as opposed to a single wildcard for the entire search. It’s also very easy to install! Just modify one file and a couple of lines at that: http://addons.oscommerce.com/info/9310
  8. Hi all, I got a problem with product shown on the top left corner of the site. There is three products on my site and that content box show all three products. Since I added fourth product, newly listed product it is on position 3 and product that was been on that position now missing. How can I show more than three products in that area
  9. Hi there! I have OSC installed, and everything seemed to work just well. I have two languages installed; English (from installation) and Swedish (downloaded). Since all my costumers live in Sweden I decided to remove the English language. Since then, no products can be found on the main catalog page. If I try to add a new product or category in the admin section and click Save, no product or category is added. I get no error message. I have checked phpmyadmin, and all the products and categories are there. I have made no change to the database, all I did was removing the English language. I didn't remove any files from the server, just the post in the admin section. I have seen this problem before in the forums, but without any answer. Can anyone please help? I really need my shop up and running! Thanks in advance, Tobias Henricsson
  10. la.antoniadis@gmail.com

    A single extra product Field

    Hello I Need to know if there is a simple add-on to add an extra field to the products. I only want it to be seen in the admin panel and i don't care if it can be seen at the products main page. I need an extra field just to point every products id from my fiscal store database to the e-shop's database with easy populate so i can update quantities and prices. the model field its just not enough. Is there anything simple out there because the installation of "extra-fields" addons is like Chinese to me and my "catalog" is already modified via the installed tamplate. Thanks LA
  11. I realise what I am looking for probably doesn't exist, but I think if someone would take on the challenge it could make an interesting addon. Also it would take oscommerce to a whole new level !!! I am looking for an addon that allows for a subdomain that can be added to an oscommerce site which has the same database / log in details for customers, whilst being operated on the same css / template, and from the same admin page as the main site. This could allow the main page to be for sales of products and the subdomain to cater for hire / rental of products via means of a booking calendar or a blog to promote your site. Thus giving handy information to customers whilst also attracting extra traffic through added searchable content. This could be product releases, upcoming events or some other useful info. I realise there is a lot in this and will probably need two parts : 1) the addon for the oscommerce subdomain that shares template / css / database / admin with the main site and 2) a booking calendar addon for rental of products / hotel rooms / cars ..... but if anyone has any ideas I think it could make an interesting conversation piece or an epic pair of addons ????
  12. whitewolfspirits

    Products in columns for 2.3

    I am trying to find an add on to make the product list for the category in columns. When I used the older versions of osCommerce, I used an add on that did this. I cannot find one that is compatible with 2.3.
  13. Hello, I have created a product_info.php.html and testing it on a local server, it did not work. I have used this technique to create a unique index and it worked. If I place the file in the current template on the live server it renders. Local server is XAMMPP on windows, does anyone know a way to get it to render on the local version?
  14. Hi. I am triying to add a quantity box on the products listings. At the moment i have added a contribution that allows me to show 5 products per line but i cannot find a way that i can add a quantity box to the listings. My products_listing.php is: <?php /* $Id: product_listing.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ if (!defined('PRODUCT_LIST_COLUMNS')) { tep_db_query( "insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Number of products per row on product listing modules', 'PRODUCT_LIST_COLUMNS', '5', 'Set the number of products per row to display?', '8', '20', now());" ); define('PRODUCT_LIST_COLUMNS', '5'); } $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <?php } if (tep_not_null($_GET['manufacturers_id'])) { $manufacturer_query = tep_db_query( "select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . tep_db_input($_GET['manufacturers_id']) . "';" ); $manufacturer = tep_db_fetch_array($manufacturer_query); $info_box_header = $manufacturer['manufacturers_name']; if (tep_not_null($_GET['filter_id'])) { $category_query = tep_db_query( "select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . tep_db_input($_GET['filter_id']) . "' and cd.categories_id = '" . tep_db_input($_GET['filter_id']) . "' and cd.language_id = '" . (int)$languages_id . "'" ); $category = tep_db_fetch_array($category_query); $info_box_header .= ' > '. $category['categories_name']; } } if (tep_not_null($current_category_id)) { $category_query = tep_db_query( "select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'" ); $category = tep_db_fetch_array($category_query); $info_box_header = $category['categories_name']; } $info_box_contents = array(); $info_box_contents[] = array('text' => $info_box_header); new contentBoxHeading($info_box_contents); $row = 0; $col = 0; $list_box_contents = array(); if ($listing_split->number_of_rows > 0) { $listing_query = tep_db_query($listing_split->sql_query); while ($listing = tep_db_fetch_array($listing_query)) { $lc_align = 'center'; $lc_text = '<table cellpadding="2" cellspacing="0" border="0">' . "\r\n"; foreach ($column_list as $column) { switch($column) { // Row: Products model case 'PRODUCT_LIST_MODEL': $lc_text .= ' <tr>' . "\r\n" . ' <td class="main" align="center">'. $listing['products_model'] . '</td>' . "\r\n" . ' </tr>' . "\r\n"; break; // Row: Product's image case 'PRODUCT_LIST_IMAGE': $lc_text .= ' <tr>' . "\r\n" . ' <td class="main" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, (isset($_GET['manufacturers_id']) ? 'manufacturers_id=' . $_GET['manufacturers_id'] : ($cPath ? 'cPath=' . $cPath : '')) . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' . "\r\n" . ' </tr>' . "\r\n"; break; // Row: Product's name case 'PRODUCT_LIST_NAME': $lc_text .= ' <tr>' . "\r\n" . ' <td class="main" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, (isset($_GET['manufacturers_id']) ? 'manufacturers_id=' . $_GET['manufacturers_id'] : ($cPath ? 'cPath=' . $cPath : '')) . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>' . "\r\n" . ' </tr>' . "\r\n"; break; // Row: Manufacturer's name case 'PRODUCT_LIST_MANUFACTURER': $lc_text .= ' <tr>' . "\r\n" . ' <td class="main" align="center"><span style="color: #666666;">'. $listing['manufacturers_name'] . '</span></td>' . "\r\n" . ' </tr>' . "\r\n"; break; // Row: Price case 'PRODUCT_LIST_PRICE': if (tep_not_null($listing['specials_new_products_price'])) { $lc_text .= ' <tr>' . "\r\n" . ' <td class="main" align="center"><s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) .'</s><br><span class="productSpecialPrice">'. $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span></td>' . "\r\n" . ' </tr>' . "\r\n"; } else { $lc_text .= ' <tr>' . "\r\n" . ' <td class="main" align="center">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</td>' . "\r\n" . ' </tr>' . "\r\n"; } break; // Row: Product's quantity case 'PRODUCT_LIST_QUANTITY': $lc_text .= ' <tr>' . "\r\n" . ' <td class="main" align="center">'. TABLE_HEADING_QUANTITY .': '. $listing['products_quantity'] . '</td>' . "\r\n" . ' </tr>' . "\r\n"; break; // Row: Product's weight case 'PRODUCT_LIST_WEIGHT': $lc_text .= ' <tr>' . "\r\n" . ' <td class="main" align="center">'. TABLE_HEADING_WEIGHT .': '. $listing['products_weight'] . '</td>' . "\r\n" . ' </tr>' . "\r\n"; break; // Row: Buy now button case 'PRODUCT_LIST_BUY_NOW': $lc_text .= ' <tr>' . "\r\n" . ' <td class="main" align="center"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a></td>' . "\r\n" . ' </tr>' . "\r\n"; break; } } $lc_text .= '</table>' . "\r\n"; $list_box_contents[$row][$col] = array( 'align' => $lc_align, 'params' => 'width="'. round(100/PRODUCT_LIST_COLUMNS) .'%" class="productListing-data"', 'text' => $lc_text ); $col ++; if ($col > (PRODUCT_LIST_COLUMNS-1)) { $col = 0; $row ++; } } while ($col != 0 && sizeof($list_box_contents[$row]) < PRODUCT_LIST_COLUMNS) { $list_box_contents[$row][$col] = array( 'align' => 'center', 'params' => 'width="'. round(100/PRODUCT_LIST_COLUMNS) .'%"', 'text' => ' ' ); $col ++; } new productListingBox($list_box_contents); } else { $list_box_contents = array(); $list_box_contents[0] = array('params' => 'class="productListing-odd"'); $list_box_contents[0][] = array('params' => 'class="productListing-data"', 'text' => TEXT_NO_PRODUCTS); new productListingBox($list_box_contents); } if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <?php } ?> Can you please tell me a way i can add it. Best regards Richard
×