Jump to content
Sign in to follow this  
djmonkey1

Product Listing in Columns v2.0

Recommended Posts

OK, I went to a different version and am convinced that there are major issues with product_listing_col.php

 

1) Out of the box, the code simply does not apply the alternating odd/even classes for 2 columns. The first row will have no class, all other rows will have the odd class.

2) For three or more columns, it does apply the alternating odd/even classes BUT does not apply a class to the first row.

3) If one adds a class for the first row (previous post), it simply skips that entire row.

 

So

- has anyone gotten this working for 2 columns?

- has anyone gotten the first row to display properly?

I agree there are issues. I made a version for Separate Pricing Per Customer (add-on 716) so needed to fix that. I think it is not hard to remove the SPPC specific code from that. It is included in the "ready-made-files" includes/modules/

 

Perhaps that will solve your problem.

Share this post


Link to post
Share on other sites
I agree there are issues. I made a version for Separate Pricing Per Customer (add-on 716) so needed to fix that. I think it is not hard to remove the SPPC specific code from that. It is included in the "ready-made-files" includes/modules/

 

Perhaps that will solve your problem.

 

On further investigation, it looks like the problem is in how the code builds "params" and sends off the $list_box_contents to boxes.php. This does not look easy to fix.

 

I happen to use the "loaded" eosc version of oscommerce and it has incorporated your code but it's possible that there are some conflicts with the other contributions. I'll check out your code but in the meantime will just settle for not highlighting every other row in the product listing.

 

UPDATE: HALLELUJAH! I used your version of product_listing_col and it WORKS! I have to do some modifications (e.g., I added a short description field and display that in the product listing when using columns) but it's looking good! Thanks.

Share this post


Link to post
Share on other sites

does anyone know where you can set the number of products per row to be listed in category main page?

Share this post


Link to post
Share on other sites

Hi,

 

Please, please, please: I really need help with the split page. My links redirecting to page 2, 3, 4 and Next do not work.

 

They do work with the new products page in row but not with the Products Listing in Columns.

 

I don't know what to do... I have had a look at page_split_results but I can't see nothing wrong but then again I don't know anyting about codes.

 

But surely it can't be a page_split problem if the new products page works fine?...

 

I would be very very grateful if someone could point me in the right direction.

 

Florence

Share this post


Link to post
Share on other sites

Hmmm, I just installed this contribution and noticed my featured products had gone missing. Has anyone else had this problem or happen to know how I would be able to get it back?

 

Thanks,

-Kevin

Share this post


Link to post
Share on other sites

I installed this for the product listing display being in columns... Works great thank you... :)

 

I was just wondering if there is a way to remove the quantity box and add to cart button at the bottom?

 

Any help is appreciated :)

Share this post


Link to post
Share on other sites

Just installed version 2.2.1, Great contribution. When I select "display add multiples column" in Admin I get the follwing error in my store when products should be displayed.

---------------------------------------------------------------

1054 - Unknown column 'attributes_hide_from_groups' in 'where clause'

 

select distinct popt.products_options_id, popt.products_options_name from products_options popt, products_attributes patrib where patrib.products_id='128' and patrib.options_id = popt.products_options_id and popt.language_id = '1' and find_in_set('', attributes_hide_from_groups) = 0

 

[TEP STOP]

--------------------------------------------------------------

When "Display buy now column is selected" it list products in columns fine.

 

Also when the "display add multiples with buy now column" is selected it displays products but some products have the drop down attributes select box listed multiple times and the price is listed 2 or 3 times. Some of the products on the same page list fine.

 

Anyone had any of these problems before ?

 

Thanx

Share this post


Link to post
Share on other sites
Just installed version 2.2.1, Great contribution. When I select "display add multiples column" in Admin I get the follwing error in my store when products should be displayed.

---------------------------------------------------------------

1054 - Unknown column 'attributes_hide_from_groups' in 'where clause'

My fault. This is SPPC 4.2.0 specific code. I first made the SPPC version and then took out the SPPC specific stuff for the regular version. I overlooked two queries where and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0

should have been removed. Uploaded a corrected version now (2.2.2, just changed includes/modules/product_listing_col.php)

Share this post


Link to post
Share on other sites
I would like som one to incorporate attributes priceing, so that it shows the exact price and not eg. (+ 160.00)

(+ 175.00)

(+ 192.00)

 

Anybody up for adding this: http://www.oscommerce.com/community/contributions,2487/

 

to product_listing_col.php. I have tried, but cant get it to work.

Execute this sql command on your database:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Show actual price in the pull down menu for attributes', 'PRODUCT_LIST_ACTUAL_PRICE_IN_DROPDOWN', 'No', 'Do you want to show the actual price in the pull down menu for attributes or the (+ $10.00) ?', '8', '14', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now());

You can switch it to Yes in the admin (Configuration->Product listing) any time you like.

Then change the two occurences (this is version 2.2.3) of:

   for ($v = 0; $v < count($products_options); $v++) {
	  $options_text = ''; // make it empty again
	  $options_text = $products_options[$v]['products_options_values_name'];
	  if ($products_options[$v]['options_values_price'] != '0') {
		$options_text .= ' (' . $products_options[$v]['price_prefix'] . $currencies->display_price($products_options[$v]['options_values_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) .') ';
	  }

To:

   for ($v = 0; $v < count($products_options); $v++) {
	  $options_text = ''; // make it empty again
	  $options_text = $products_options[$v]['products_options_values_name'];
	  if (defined('PRODUCT_LIST_ACTUAL_PRICE_IN_DROPDOWN') && PRODUCT_LIST_ACTUAL_PRICE_IN_DROPDOWN == 'Yes') {
	   // if ((int) $products_options[$v]['options_values_price'] != '0') {
		  if (tep_not_null($listing[$x]['specials_new_products_price'])) {
			$original_price = $listing[$x]['specials_new_products_price'];
		  } else {
			$original_price = $listing[$x]['products_price'];
		  }
		  if ($products_options[$v]['price_prefix'] == "-") // in case price lowers, don't add values, subtract 
		  {
				$show_price = 0.0 + $original_price - $products_options[$v]['options_values_price']; // force float (in case) using the 0.0;
			} else {
			  $show_price = 0.0 + $original_price + $products_options[$v]['options_values_price']; // force float (in case) using the 0.0;
			}
		  $options_text .= ' (' .  $currencies->display_price($show_price, tep_get_tax_rate($listing[$x]['products_tax_class_id'])) .') ';
	 // }
	  } else {
		if ($products_options[$v]['options_values_price'] != '0') {
		  $options_text .= ' (' . $products_options[$v]['price_prefix'] . $currencies->display_price($products_options[$v]['options_values_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) .') ';
		} 
	  }

Share this post


Link to post
Share on other sites

Hello all, This is my first post, and I was hoping to solve this on my own, but I am stumped. I have a FRESH install of v2.2RC1. I ran the install routine for RC1, all ended well. I checked the test product, all worked fine. I then proceeded to add 2.2.3 of this contribution. I "ran" the sql command adding list_multi.sql and that reported no errors. I added all the enclosed files, double checking my work. I accessed the admin section and I see the new three options. I select 3 for number of columns, leave the other two set at zero....here is a pic

 

freshwithcolht0.jpg

 

No matter what I do, change the options around, nothing happens as far a multiple product on same row. According to what I read, and I am NOT a programmer, the original product_listing.php file would be called only if the number of columns was set to 1. So I renamed that file to test that and regardless of the number of columns I choose thru admin I then generate an error that product_listing.php is missing. My logic is that it was supposed to pull the new product_listing_col.php. That logic may very well be wrong but nonetheless, when I restore the file, all errors go away and it functions normally, but still not in columns.

 

I have tried versions 2.2.3, 2.2.2, 2.2.1, 2.2......All function the same for me. With all the success with this by others, I have to be doing something wrong, missing a step....but, I can't figure it out.

 

btw, just for giggles, I tried OSCmax (latest release) and it works fine in that install, I get columns, but I don't care for that version, I prefer this much more.

 

Website that I have this installe on is http://creativenestings.com/Worknest/ I haven't even gotten to securing this website yet, as I won't bother until this is working right for me.

 

If someone is will to help me I would appreciate it. Merry Christmas to all

 

Nacman aka Richard

Share this post


Link to post
Share on other sites
With all the success with this by others, I have to be doing something wrong, missing a step....but, I can't figure it out.

Sounds like you missed the very last step:

In catalog/includes/filenames.php change 

define('FILENAME_PRODUCT_LISTING', 'product_listing.php');

to

define('FILENAME_PRODUCT_LISTING', 'product_listing_col.php');

By changing that define the product_listing_col.php is used whenever FILENAME_PRODUCT_LISTING is included in index.php.

Share this post


Link to post
Share on other sites
Sounds like you missed the very last step:

In catalog/includes/filenames.php change 

define('FILENAME_PRODUCT_LISTING', 'product_listing.php');

to

define('FILENAME_PRODUCT_LISTING', 'product_listing_col.php');

By changing that define the product_listing_col.php is used whenever FILENAME_PRODUCT_LISTING is included in index.php.

 

 

Thanks ALOT!!! Like I said, I missed it. Works perfectly now.

 

Nacman

Share this post


Link to post
Share on other sites

Well, now that I got this contribution to work, I started to slowly tinker with the layout as it pertains to the if "Display Add Multiples with Buy Now column" BUY NOW button. It was a little too tight and close to the quantity field. I located the place to modify the code with a simple HTML code addition for this to work. If interested here it is.....and if this has already been discussed and done, apologies....I couldn't find reference to it.

 

Find this Code in Product_listing_col.php (ver 2.2.3)

 

if ((int)$listing[$x]['total'] == 0) {
$lc_text .= '<br> ';
$lc_text .= tep_draw_hidden_field('products_id', $listing[$x]['products_id']) . tep_image_submit('button_buy_now.gif', TEXT_BUY . $listing[$x]['products_name'] . TEXT_NOW);
$lc_text .= '<br> ';
$lc_text .= '<table border="0" cellpadding="0" cellspacing"0"><tr><td class="main"></td><td></td></tr></table>';
}

 

And change it to this:

 

if ((int)$listing[$x]['total'] == 0) {
$lc_text .= '<br> ';
$lc_text .=  '<br>' . tep_draw_hidden_field('products_id', $listing[$x]['products_id']) . tep_image_submit('button_buy_now.gif', TEXT_BUY . $listing[$x]['products_name'] . TEXT_NOW);
$lc_text .= '<br> ';
$lc_text .= '<table border="0" cellpadding="0" cellspacing"0"><tr><td class="main"></td><td></td></tr></table>';
}

 

It is hard to see on my high res monitor but there is a SPACE PERIOD SPACE between '<br>' and tep_draw

This causes the BUY NOW button to appear with one line break below the Quantity selection box.

 

Use at you own risk, as I am not a PHP programmer. It seems to work for me so far.

 

http://creativenestings.com/osc22rc1/catalog/index.php

 

Nac

Edited by Nacman

Share this post


Link to post
Share on other sites

Hi,

 

I'm having a tough time understanding the tables in osCommerce in general. After the installation of this contribution I would like to put the product title above the image like the "multiples" option is when activated. Would I do this in the file product_listing_col or index.php?

 

 

 

I noticed the Case Multiple in product_listing_col had a valign of top

 

case 'PRODUCT_LIST_MULTIPLE': 
			$lc_align = 'right'; 
			$lc_valign = 'top';

 

So, was hoping it would be as easy as assigning the variable $lc_valign with the value of top in the CASE statement for product_list_name

 

case 'PRODUCT_LIST_NAME':
			$lc_align = '';
			$lc_valign ='top';
			if (isset($_GET['manufacturers_id'])) {
				$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . (int)$_GET['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>';
			$lc_valign ='top';
			} else {
				$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a> ';
			$lc_valign ='top';
			}
			break;

 

 

 

This didn't seem to affect anything. Can anyone point me in the right direction?

 

Thanks!

Share this post


Link to post
Share on other sites
This didn't seem to affect anything. Can anyone point me in the right direction?

Try playing with the number values in Admin->Configuration->Product Listing. The items with 0 are not used for the product listing, but then the order depends on the value entered.

Share this post


Link to post
Share on other sites
Try playing with the number values in Admin->Configuration->Product Listing. The items with 0 are not used for the product listing, but then the order depends on the value entered.

 

Thanks for the post, I've been playing with the product listing values but can't seem to make a difference. Sorry, I just re-read my post, I don't think it was very clear. I would just like to get the product title above the image so it basically goes (from top to bottom) product title, image, price instead of image, product title, price. Is this possible in the product listing?

Share this post


Link to post
Share on other sites
I would just like to get the product title above the image so it basically goes (from top to bottom) product title, image, price instead of image, product title, price. Is this possible in the product listing?

If I choose these settings in admin it just does that:

Display Product Image			  3
Display Product Manufaturer Name   0
Display Product Model			  0
Display Product Name			   2
Display Product Price			  4
Display Product Quantity		   0
Display Product Weight			 0
Display Buy Now column			 0

Now having product title twice in the listing, that would enable some hacking in the code.

Share this post


Link to post
Share on other sites
If I choose these settings in admin it just does that:

Display Product Image			  3
Display Product Manufaturer Name   0
Display Product Model			  0
Display Product Name			   2
Display Product Price			  4
Display Product Quantity		   0
Display Product Weight			 0
Display Buy Now column			 0

Now having product title twice in the listing, that would enable some hacking in the code.

 

Thank you so much Jan! Often times I can be more than a little slow, I really appreciate your time!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×