Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Show products from selected manufacturer, categories.php


drferrari

Recommended Posts

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

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

@@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

@@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-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

@@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

@@drferrari

 

Did you try my suggestion above?

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

@@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-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

@@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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...