Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Show All Products in Category & Subcategories V1.0 Support


Rachael w.

Recommended Posts

Someone did for sppc

 

// We show them all
// BOF Separate Pricing Per Customer --last query changed for mysql 5 compatibility
       if ($status_product_prices_table == true) {
// original, no need to change for mysql 5
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
       } else { // either retail or no need to get correct special prices -- changed for mysql 5
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; 
     } // end else { // either retail...
// EOF Separate Pricing per Customer

Link to comment
Share on other sites

Hi,

 

I needed the similar thing. You only need to modify the $listing_sql at index.php that was modified by this contrib.

 

Find this

$listing_sql = "select distinct " . $select_column_list . " p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and " . $cat_Search . "";

 

And replace with this

 

$listing_sql = "select distinct " . $select_column_list . " p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, cat.categories_id as catid, cat.categories_image, catd.categories_id as catd_id , catd.categories_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p, " . TABLE_CATEGORIES . " cat, " . TABLE_CATEGORIES_DESCRIPTION . " catd left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and " . $cat_Search . " and cat.categories_id = p2c.categories_id and catd.categories_id = p2c.categories_id and catd.language_id = '" . (int)$languages_id . "' "; 

This will add the categorie name and image. You can remove the other id's since i only used them for checking.

not working for me :( got error on index.php:

1054 - Unknown column 'p.manufacturers_id' in 'on clause'

 

select count(distinct p.products_id) as total from products_description pd, products p, categories cat, categories_description catd left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id, products_to_categories p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '4' and (p2c.categories_id = '50' or p2c.categories_id = '51' or p2c.categories_id = '52' or p2c.categories_id = '53' or p2c.categories_id = '21') and cat.categories_id = p2c.categories_id and catd.categories_id = p2c.categories_id and catd.language_id = '4'

Kestas

Link to comment
Share on other sites

  • 4 weeks later...

Hi...Great Contribution....

 

One problem i'm having, when I click through to the product information page (product_info.php) and then click the back button (not the browser back button), the sub-category header does not revert back...instead the sub-category header is the product header...

 

..Any Ideas?

 

Thanks,

Link to comment
Share on other sites

Hi...Great Contribution....

 

One problem i'm having, when I click through to the product information page (product_info.php) and then click the back button (not the browser back button), the sub-category header does not revert back...instead the sub-category header is the product header...

 

..Any Ideas?

 

Thanks,

 

 

Can you pm me your site so I can see exactly what your experiencing?

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Nice contribution :) .

 

I do seem to have one problem though. The manufacturer filter dropdown does not show if i am in a category with other categories in it (ex: DVD movies) it does show if there are no more categories to go to (ex: Action). On the picture that are in the contribution this seems to work for you!

 

Any idea why mine doesn't?

 

thanks

Link to comment
Share on other sites

I think i found the problem, but not the solution.

 

I tried to put some products from the action category to the DVD movies category, and that made the manufacturer filter dropdown show up. But if I use the filter it only shows the products that are in the DVD movies category and not its subcategories.

 

So the problem seems to be that the filter only search the current category and not its subcategories for manufacturer information.

 

Any idea for a solution

Link to comment
Share on other sites

  • 1 month later...

It has just been brought to my attention that verison 1.01 had an error in the code which resulted in a tep-get error. This was due to some extra info I had hard coded to my test site that was added to the instructions accidentally. I've updated the instructions in Version 1.02 to avoid the tep_get error in product_listing.php.

 

I've uploaded a full package with instructions.

 

http://www.oscommerce.com/community/contributions,5351

Link to comment
Share on other sites

  • 9 months later...

Hi folks and thanks Racheal for the contrib...

 

:blink: Noob question:

 

Is anybody aware of a clever but simple way to restore (perhaps "continue to display" is a better way to put it) the 'new products module' functionality at the top category and perhpas even sub-category product display levels?

 

Thanks

Link to comment
Share on other sites

  • 5 months later...

This is exactly what i have been looking for! hours of searching... I LOVE whoever came up with his..

 

But i have a problem..

 

I already have the Show Sold Out Items installed. At http://addons.oscommerce.com/info/4884

 

Both that and this one want the same part of code changed in the index.php file to different things. :(

 

I really need to use both of these for what im trying to do. But im not good with php at all. Most of it looks alien to me. Im shocked i have gotten as far as i have.

 

Can anyone help me out with this? Somekind of work around from someone who knows way more about what they are doing than i do.

 

I would gladly send over a few bucks via paypal for the help of whoever could solve this for me. Thanks alot for at least reading. (Fingers crossed)

Link to comment
Share on other sites

  • 10 months later...

Hi,

 

I needed the similar thing. You only need to modify the $listing_sql at index.php that was modified by this contrib.

 

Find this

$listing_sql = "select distinct " . $select_column_list . " p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and " . $cat_Search . "";

 

And replace with this

 

$listing_sql = "select distinct " . $select_column_list . " p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, cat.categories_id as catid, cat.categories_image, catd.categories_id as catd_id , catd.categories_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p, " . TABLE_CATEGORIES . " cat, " . TABLE_CATEGORIES_DESCRIPTION . " catd left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and " . $cat_Search . " and cat.categories_id = p2c.categories_id and catd.categories_id = p2c.categories_id and catd.language_id = '" . (int)$languages_id . "' "; 

 

 

This will add the categorie name and image. You can remove the other id's since i only used them for checking.

 

Sorry to join this thread so late but I hope you can help me.

 

Is there any way to achieve the above display of products in sub categories all on one page but only show 1 product in each of the sub categories?

 

Any help you can give me would be much appreciated.

 

Thanks

 

Ally

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...