Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] All Products v3.0 MS 2.2 with Images


Farrukh

Recommended Posts

Jack, i didn't install this contribution, can i make changes you told me without the contribution? i would like on Category page(i don't have subcategories) all the products to be displayed in order so that the newest will be on the top, just like "New items" box... i was looking everywhere, product_listing.php, index.php, searched all the forums and i didn't find... cannot believe nobody did it... any advise, please...

Sometimes, ignorance is not bliss.

Link to comment
Share on other sites

  • Replies 387
  • Created
  • Last Reply

Top Posters In This Topic

Categories are displayed using the index.php page. You will need to find the sql call and change it to sort the way you want. You can't necessarily use what I posted since the code is probably different. If you can't find it, repost your request in the general support forum so more people will see it and you will likely get the help you need.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 3 weeks later...

Since the index file handles more than just the home page display, to have it display all products, you would need to find the section on the page that starts with } else { and insert

tep_redirect(tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL'));

I haven't tried this but I think it should work.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

One of my client sites using copies of products between categories. For example, product1 belongs to Category1 but is also displayed in Category2.

 

When I use the AllProds contribution , it is showing duplicates of these copied products. Is there an easy way to prevent this? I am sure we could just modify the sql command and group products id maybe? But where would I find this?

 

Thank you.

Keith Gallant

Link to comment
Share on other sites

I have figured it out....

I just had to add distinct to the sql command....

 

Changed

$products_query = tep_db_query("select s.specials_new_products_price, p.products_id, .....

 

To

 

$products_query = tep_db_query("select distinct s.specials_new_products_price, p.products_id, .....

 

Thanks

Keith Gallant

Link to comment
Share on other sites

The code is not setup for that. You would need to find the code in includes/modules/allprods.php that loads in the database and add a sort statement. If you want your visitors to be able to do this, then a link on the page to change sorting would also be needed.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...
Hi,

 

I have just installes the latest update. When I try to click on the manufacturer I don't get the manufacturer id in the link.

 

Does anybody else have the same problem and how can i fix it?

 

Alex Wolf

The manufacturers id is missing from the generated url. To fix it, find this line of code in allprods.php

$listing_sql = "select p.products_id, p.products_model, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name, m.manufacturers_id from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id  $where order by pd.products_name";

and change it to

$listing_sql = "select p.products_id, p.products_model, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id  $where order by pd.products_name";

 

Jack

Edited by Jack_mcs

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi,

 

The all products list seems to be showing products that have been marked as inactive as well.

Has anyone else had this problem?

I read through this topic but couldn't find anything.

Do you mean an item that is our of stock?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Do you mean an item that is our of stock?

 

Jack

 

Hi Jack,

 

Not neccessarily, just an item that is in the database but one doesn't want visible at the moment so has been made inactive by selecting the red traffic light icon in the Categories/Products section of admin.

Link to comment
Share on other sites

Ive just installed the contribution and it looks great.

I made a few changes like removing the alphabet letters at the top of the page and changed the color of the All Products text to suit my site but in all, everything works and looks great.

I'm a victim of circumstance

Link to comment
Share on other sites

Hi Jack,

 

Not neccessarily, just an item that is in the database but one doesn't want visible at the moment so has been made inactive by selecting the red traffic light icon in the Categories/Products section of admin.

That's the out of stock indicator on a standard shop. I'll put it on the lsit of things to look into for the next version. Thanks for mentioning it.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi, is there anyway of limiting the friendly url used for the links to the products page. Trying to clarify my post a bit by saying that my products are listed on a categories page, with no products info page per se.

 

Currently everything works nicely but the urls are displayed as maincategory/productcategory/productname.html.

 

Whereas within the normal navigation (and in google's index) they are maincategory/productcategory/ and no mention of the product name or html at the end.

 

What code would I need to amend to get rid of the unwanted part of the url?

 

cheers

Link to comment
Share on other sites

This contribution lists All Products. What you are describing is All Categories. For that, you ned the Dynamic Sitemap contribuiton.

 

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 4 weeks later...

Hello everyone,

 

 

i just installed AllProds v4.4. I have 2 problems:

1) When I click on "view all products" in my Infobox, it redirects me to the index.php

Any hint?

 

PS: Neader Tags Controller v2.5.6 installed too.

 

 

 

Thanks for this contib and everyone's support.

Didi

Link to comment
Share on other sites

Hello,

 

I adapted the contribution to show the product_listing-table with the columns defined in admin and sorting. There is the problem, that the fields quantity and weight are displayed as table header but no values are displayed in the table itself.

 

I copied the necessary code from index.php to allprods.php and I tracked down the reason for not displaying but could not find out why it worked in index.php but not in allprods.php.

index.php:

...
// create column list
$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
					 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
					 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
					 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
					 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
					 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
					 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
					 'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

asort($define_list);

$column_list = array();
reset($define_list);
while (list($key, $value) = each($define_list)) {
  if ($value > 0) $column_list[] = $key;
}

$select_column_list = '';

for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
  switch ($column_list[$i]) {
	case 'PRODUCT_LIST_MODEL':
	  $select_column_list .= 'p.products_model, ';
	  break;
	case 'PRODUCT_LIST_NAME':
	  $select_column_list .= 'pd.products_name, ';
	  break;
	case 'PRODUCT_LIST_MANUFACTURER':
	  $select_column_list .= 'm.manufacturers_name, ';
	  break;
	case 'PRODUCT_LIST_QUANTITY':
	  $select_column_list .= 'p.products_quantity, ';
	  break;
	case 'PRODUCT_LIST_IMAGE':
	  $select_column_list .= 'p.products_image, ';
	  break;
	case 'PRODUCT_LIST_WEIGHT':
	  $select_column_list .= 'p.products_weight, ';
	  break;
  }
}

// show the products of a specified manufacturer
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
	$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 . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' 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)$HTTP_GET_VARS['filter_id'] . "'";
  }
...

allprods.php:

...
// create column list
$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
				  'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
				  'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
				  'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
				  'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
				  'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
				  'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
				  'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
asort($define_list);

$column_list = array();
reset($define_list);
while (list($key, $value) = each($define_list)) {
  if ($value > 0) $column_list[] = $key;
}

$select_column_list = '';

for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
  if ( ($column_list[$i] == 'PRODUCT_LIST_BUY_NOW') || ($column_list[$i] == 'PRODUCT_LIST_NAME') || ($column_list[$i] == 'PRODUCT_LIST_PRICE') || ($column_list[$i] == 'PRODUCT_LIST_WEIGHT') )
 {
  switch ($column_list[$i]) {
	case 'PRODUCT_LIST_MODEL':
	  $select_column_list .= 'p.products_model, ';
	  break;
	case 'PRODUCT_LIST_NAME':
	  $select_column_list .= 'pd.products_name, ';
	  break;
	case 'PRODUCT_LIST_MANUFACTURER':
	  $select_column_list .= 'm.manufacturers_name, ';
	  break;
	case 'PRODUCT_LIST_QUANTITY':
	  $select_column_list .= 'p.products_quantity, ';
	  break;
	case 'PRODUCT_LIST_IMAGE':
	  $select_column_list .= 'p.products_image, ';
	  break;
	case 'PRODUCT_LIST_WEIGHT':
	  $select_column_list .= 'p.products_weight, ';
	  break;
	}
  }
}

$listing_sql = "select " . $select_column_list . " p.products_id, p.products_model, pd.products_name, pd.products_description, p.products_image, 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, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id  " . $where;
...

Removing the line

   if ( ($column_list[$i] == 'PRODUCT_LIST_BUY_NOW') || ($column_list[$i] == 'PRODUCT_LIST_NAME') || ($column_list[$i] == 'PRODUCT_LIST_PRICE') || ($column_list[$i] == 'PRODUCT_LIST_WEIGHT') )

changes nothing.

If I include p.products_weight in the select statement, the weight is displayed, but it should be displayed too, if there is only the $select_column_list in the select statement. The $select_column_list should include all columns that are defined in admin, like it works in the normal product listing.

 

Has anybody a clue where to look for the mistake?

 

Thanks

Hardy.

Link to comment
Share on other sites

Hi, I just installed this contribution, and i get the following error, after I enabled it in admin:

 

 

Cannot instantiate non-existent class splitpageresults in allprods.php on line 14

 

Anyone know what causes this?

 

/jacob

Link to comment
Share on other sites

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