drferrari Posted December 3, 2016 Share Posted December 3, 2016 in some of my category e.g. categories.php?cPath=2822 I have 100 products from 3 manufacturers (apple, sony, philips). I create form to show me only product from e.g. apple when is selected. echo tep_draw_form('manufacturerSelect', FILENAME_CATEGORIES . tep_get_all_get_params($parameters), '', 'get'); $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE)); $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); } echo tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id, 'onChange="this.form.submit();"'); echo tep_hide_session_id() . '</form>'; the problem is here with Action: FILENAME_CATEGORIES . tep_get_all_get_params($parameters). I get this: categories.phpcPath=2822?manufacturers_id=18 I need this: categories.php?cPath=2822&manufacturers_id=18 I put all this above: echo tep_draw_form('search', FILENAME_CATEGORIES, '', 'get'); and create: $manufacturers_id = tep_db_prepare_input($HTTP_GET_VARS['manufacturers_id']); if (isset($HTTP_GET_VARS['manufacturerSelect'])) { $products_query = tep_db_query("select .... where ... p.manufacturers_id = '" . $manufacturers_id . "' }else if (isset($HTTP_GET_VARS['search'])) {... Can somebody help me. Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted December 3, 2016 Share Posted December 3, 2016 would this help ? http://addons.oscommerce.com/info/8332 KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
drferrari Posted December 4, 2016 Author Share Posted December 4, 2016 @@bruyndoncx, thank you but no this not help. I need form action with all parameters echo tep_draw_form('manufacturerSelect', FILENAME_CATEGORIES . tep_get_all_get_params($parameters), '', 'get'); LOOK HERE: the problem is with FORM ACTION: FILENAME_CATEGORIES . tep_get_all_get_params($parameters). I get this: categories.phpcPath=2822?manufacturers_id=18 I need this: categories.php?cPath=2822&manufacturers_id=18 Link to comment Share on other sites More sharing options...
frankl Posted December 4, 2016 Share Posted December 4, 2016 @@drferrari Post your form tags here. osCommerce user since 2003! Link to comment Share on other sites More sharing options...
auzStar Posted December 5, 2016 Share Posted December 5, 2016 @@drferrari Your "tep_draw_form()" looks incorrect. Try: echo tep_draw_form('manufacturerSelect', FILENAME_CATEGORIES, tep_get_all_get_params(array('action', 'manufacturers_id')), 'get'); cheers My Add-onsAdvanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download SupportAjax Product Listing for osC 2.3.4 (bootstrap) Download SupportCategory New Products Carousel for osC 2.3.4 (bootstrap) Download SupportCategory Popular Products Carousel for osC 2.3.4 (bootstrap) Download SupportCustomer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportFront Page New Products Carousel for osC 2.3.4 (bootstrap) Download SupportIndex Nested - Product Listing for osC 2.3.4 (bootstrap) Download SupportMatch Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download SupportModular Category Page for osC 2.3.4 (bootstrap) Download SupportNEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download SupportNEW Equal Height Module for osC 2.3.4 (bootstrap) Download SupportProducts Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download SupportTwitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportUpcoming Products Modules for osC 2.3.4 (bootstrap) Download Support Assisted Add-onsScroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support Bootstrap Add-ons created by other membersosCommerce Bootstrap Addons and Code Link to comment Share on other sites More sharing options...
drferrari Posted December 5, 2016 Author Share Posted December 5, 2016 @@auzStar thank you but this not working @@frankl <?php echo tep_draw_form('manufacturerSelect', FILENAME_CATEGORIES . tep_get_all_get_params($parameters), '', 'get'); $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE)); $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); } echo tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id, 'onChange="this.form.submit();"'); echo tep_hide_session_id() . '</form>'; ?> Link to comment Share on other sites More sharing options...
auzStar Posted December 5, 2016 Share Posted December 5, 2016 @@drferrari Did you try my suggestion above? My Add-onsAdvanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download SupportAjax Product Listing for osC 2.3.4 (bootstrap) Download SupportCategory New Products Carousel for osC 2.3.4 (bootstrap) Download SupportCategory Popular Products Carousel for osC 2.3.4 (bootstrap) Download SupportCustomer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportFront Page New Products Carousel for osC 2.3.4 (bootstrap) Download SupportIndex Nested - Product Listing for osC 2.3.4 (bootstrap) Download SupportMatch Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download SupportModular Category Page for osC 2.3.4 (bootstrap) Download SupportNEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download SupportNEW Equal Height Module for osC 2.3.4 (bootstrap) Download SupportProducts Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download SupportTwitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportUpcoming Products Modules for osC 2.3.4 (bootstrap) Download Support Assisted Add-onsScroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support Bootstrap Add-ons created by other membersosCommerce Bootstrap Addons and Code Link to comment Share on other sites More sharing options...
auzStar Posted December 5, 2016 Share Posted December 5, 2016 @@drferrari try this instead: <?php echo tep_draw_form('manufacturerSelect', FILENAME_CATEGORIES, '', 'get'); $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE)); $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); } echo 'Manufacturer: ' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id, 'onChange="this.form.submit();"'); echo tep_draw_hidden_field('cPath', $cPath); echo tep_hide_session_id() . '</form> '; ?> but then you'll have to change the query to pick out the results as you've shown in your first post. cheers My Add-onsAdvanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download SupportAjax Product Listing for osC 2.3.4 (bootstrap) Download SupportCategory New Products Carousel for osC 2.3.4 (bootstrap) Download SupportCategory Popular Products Carousel for osC 2.3.4 (bootstrap) Download SupportCustomer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportFront Page New Products Carousel for osC 2.3.4 (bootstrap) Download SupportIndex Nested - Product Listing for osC 2.3.4 (bootstrap) Download SupportMatch Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download SupportModular Category Page for osC 2.3.4 (bootstrap) Download SupportNEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download SupportNEW Equal Height Module for osC 2.3.4 (bootstrap) Download SupportProducts Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download SupportTwitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportUpcoming Products Modules for osC 2.3.4 (bootstrap) Download Support Assisted Add-onsScroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support Bootstrap Add-ons created by other membersosCommerce Bootstrap Addons and Code Link to comment Share on other sites More sharing options...
drferrari Posted December 5, 2016 Author Share Posted December 5, 2016 @@auzStar, thank you, this was looking: echo tep_draw_hidden_field('cPath', $cPath); I change the query and put (if else): if (isset($HTTP_GET_VARS['manufacturers_categories_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_categories_id'])) { $products_query = tep_db_query("Select.... and change this (manufacturers_categories_id): echo 'Manufacturer: ' . tep_draw_pull_down_menu('manufacturers_categories_id', $manufacturers_array, $pInfo->manufacturers_id, 'onChange="this.form.submit();"'); thank you again and I learned something new Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.