Forums / Templates, Stylesheets, Page Layout / Products list by manufacturers in admin

Products list by manufacturers in admin

Views: 1,428

Results 1 to 11 of 11
19 Dec 2014, 1:58 AM
#1
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Products list by manufacturers in admin

Hi,
Is this possible to list/separate products in admin using manufacturer name? On catalog side it is possible by clicking on manufacturer name/other products need similar in admin.

Thank you!

19 Dec 2014, 2:27 PM
#2
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Re: Products list by manufacturers in admin

jsarwar:

Hi,
Is this possible to list/separate products in admin using manufacturer name? On catalog side it is possible by clicking on manufacturer name/other products need similar in admin.

Thank you!

Can anyone assist on this soon please?

19 Dec 2014, 3:05 PM
#3
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Products list by manufacturers in admin

I don't know if this does what you want or not but you might take a look:

http://www.zen-cart.com/downloads.php?do=file&id=1673

19 Dec 2014, 3:32 PM
#4
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Re: Products list by manufacturers in admin

stevesh:

I don't know if this does what you want or not but you might take a look:

http://www.zen-cart.com/downloads.php?do=file&id=1673

I tried this and it does not work. It only add manufacturer name to order/ invoice etc. but I need items separated by manufacturer name in admin either using a filter or a page where all manufacturer name appear and can click on any to see/edit its products.

19 Dec 2014, 4:00 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Products list by manufacturers in admin

Try something like the code in RED by editing the file:
/your_secret_admin/includes/modules/category_product_listing.php

[B]// bof: add filter by manufacturers_id
if (preg_match('#man:#', $_GET['search'])) {
  $manufacturers_filter = ' or manufacturers_id = ' . substr($_GET['search'], 4) . ' ';
} else {
  $manufacturers_filter = '';
}
[/B]      $products_query_raw = ("select p.products_type, p.products_id, pd.products_name, p.products_quantity,
                                       p.products_image, p.products_price, p.products_date_added,
                                       p.products_last_modified, p.products_date_available,
                                       p.products_status, p2c.categories_id,
                                       p.products_model,
                                       p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
                                       p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping,
                                       p.products_quantity_order_max, p.products_sort_order,
                                       p.master_categories_id,
                                       p. manufacturers_id
                                from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, "
                                       . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
                                where p.products_id = pd.products_id
                                and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                                and (p.products_id = p2c.products_id
                                and p.master_categories_id = p2c.categories_id)
                                and (
                                pd.products_name like '%" . zen_db_input($_GET['search']) . "%'
                                or pd.products_description like '%" . zen_db_input($_GET['search']) . "%'
                                or p.products_id = '" . zen_db_input($_GET['search']) . "'
                                or p.products_model like '%" . zen_db_input($_GET['search']) . "%')" .
[B]                                $manufacturers_filter .
[/B]                                $order_by);
[B]// eof: add filter by manufacturers_id
[/B]    } else {
      $products_query_raw = ("select p.products_type, p.products_id, pd.products_name, p.products_quantity,

Then, using the manufactures_id, enter into the search box:
man:3

if you wanted to find all products for manufactures_id 3 ... does this work for you?

NOTE: I have not worked out the page results when there are more than the maximum displayed on the page and the page count may/will be off ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Dec 2014, 5:13 AM
#6
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Re: Products list by manufacturers in admin

Ajeh:

Try something like the code in RED by editing the file:
/your_secret_admin/includes/modules/category_product_listing.php

[B]// bof: add filter by manufacturers_id
if (preg_match('#man:#', $_GET['search'])) {
$manufacturers_filter = ' or manufacturers_id = ' . substr($_GET['search'], 4) . ' ';
} else {
$manufacturers_filter = '';
}
[/B]
$products_query_raw = ("select p.products_type, p.products_id, pd.products_name, p.products_quantity,
p.products_image, p.products_price, p.products_date_added,
p.products_last_modified, p.products_date_available,
p.products_status, p2c.categories_id,
p.products_model,
p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping,
p.products_quantity_order_max, p.products_sort_order,
p.master_categories_id,
p. manufacturers_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, "
. TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and (p.products_id = p2c.products_id
and p.master_categories_id = p2c.categories_id)
and (
pd.products_name like '%" . zen_db_input($_GET['search']) . "%'
or pd.products_description like '%" . zen_db_input($_GET['search']) . "%'
or p.products_id = '" . zen_db_input($_GET['search']) . "'
or p.products_model like '%" . zen_db_input($_GET['search']) . "%')" .
[B] $manufacturers_filter .
[/B]
$order_by);
[B]// eof: add filter by manufacturers_id
[/B]
} else {
$products_query_raw = ("select p.products_type, p.products_id, pd.products_name, p.products_quantity,

> 
> Then, using the manufactures_id, enter into the search box:
> man:3
> 
> if you wanted to find all products for manufactures_id 3 ... does this work for you?
> 
> NOTE: I have not worked out the page results when there are more than the maximum displayed on the page and the page count may/will be off ...


Hi,
Thank you! I tried this it does not show any products in admin search. When enter man:3 it keep loading page for 5 - 10 minutes then shows no products found. 

and I also tried using different manufacturer id and it took almost 7 minutes to load page but did not load full page. It loaded upto 

Left : Categories / Products - Top   Right: Go To Top*

* Drop down on top right. 

Any idea how to fix this or make it work. Thank you!
21 Dec 2014, 2:29 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Products list by manufacturers in admin

Okay, start with your clean copy of the file ...
/your_secret_admin/includes/modules/category_product_listing.php

replace the code:

      $products_query_raw = ("select p.products_type, p.products_id, pd.products_name, p.products_quantity,
                                       p.products_image, p.products_price, p.products_date_added,
                                       p.products_last_modified, p.products_date_available,
                                       p.products_status, p2c.categories_id,
                                       p.products_model,
                                       p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
                                       p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping,
                                       p.products_quantity_order_max, p.products_sort_order,
                                       p.master_categories_id
                                from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, "
                                       . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
                                where p.products_id = pd.products_id
                                and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                                and (p.products_id = p2c.products_id
                                and p.master_categories_id = p2c.categories_id)
                                and (
                                pd.products_name like '%" . zen_db_input($_GET['search']) . "%'
                                or pd.products_description like '%" . zen_db_input($_GET['search']) . "%'
                                or p.products_id = '" . zen_db_input($_GET['search']) . "'
                                or p.products_model like '%" . zen_db_input($_GET['search']) . "%')" .
                                $order_by);

    } else {
      $products_query_raw = ("select p.products_type, p.products_id, pd.products_name, p.products_quantity,

with this new code:

// bof: add filter by manufacturers_id
if (preg_match('#man:#', $_GET['search'])) {
  $manufacturers_filter = ' and (manufacturers_id = ' . substr($_GET['search'], 4) . ') ';
      $products_query_raw = ("select p.products_type, p.products_id, pd.products_name, p.products_quantity,
                                       p.products_image, p.products_price, p.products_date_added,
                                       p.products_last_modified, p.products_date_available,
                                       p.products_status, p2c.categories_id,
                                       p.products_model,
                                       p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
                                       p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping,
                                       p.products_quantity_order_max, p.products_sort_order,
                                       p.master_categories_id,
                                       p. manufacturers_id
                                from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, "
                                       . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
                                where p.products_id = pd.products_id
                                and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                                and (p.products_id = p2c.products_id
                                and p.master_categories_id = p2c.categories_id) " .
                                $manufacturers_filter .
                                $order_by);
} else {
      $products_query_raw = ("select p.products_type, p.products_id, pd.products_name, p.products_quantity,
                                       p.products_image, p.products_price, p.products_date_added,
                                       p.products_last_modified, p.products_date_available,
                                       p.products_status, p2c.categories_id,
                                       p.products_model,
                                       p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
                                       p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping,
                                       p.products_quantity_order_max, p.products_sort_order,
                                       p.master_categories_id,
                                       p. manufacturers_id
                                from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, "
                                       . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
                                where p.products_id = pd.products_id
                                and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                                and (p.products_id = p2c.products_id
                                and p.master_categories_id = p2c.categories_id)
                                and (
                                pd.products_name like '%" . zen_db_input($_GET['search']) . "%'
                                or pd.products_description like '%" . zen_db_input($_GET['search']) . "%'
                                or p.products_id = '" . zen_db_input($_GET['search']) . "'
                                or p.products_model like '%" . zen_db_input($_GET['search']) . "%')" .
                                $order_by);
}
// eof: add filter by manufacturers_id
    } else {
      $products_query_raw = ("select p.products_type, p.products_id, pd.products_name, p.products_quantity,

This will allow the page navigation to work ...

To test this, go to phpMyAdmin and search the table:
products

to the manufacturers_id that you want to test ...

Check how many Products are found on a search for the manufacturers_id ... then in your Zen Cart Admin, do a search for:
man:XX

where XX is the same manufacturers_id ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Dec 2014, 2:42 PM
#8
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Re: Products list by manufacturers in admin

worked like a charm. Thank you!

21 Dec 2014, 2:45 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Products list by manufacturers in admin

Thanks for the update that this was able to work for you ...

Remember the Zen Cart Team when you are rich and famous! :cool:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Dec 2014, 2:48 PM
#10
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

Re: Products list by manufacturers in admin

Ajeh:

Thanks for the update that this was able to work for you ...

Remember the Zen Cart Team when you are rich and famous! :cool:

I am web developer and sure will. Have a happy holiday season!

21 Dec 2014, 2:55 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Products list by manufacturers in admin

Hope you have a good Holiday season as well ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!