Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Listing in Columns v2.0


djmonkey1

Recommended Posts

This is a great contribution, Thanks! But I have one small problem, I have a background color behind my products, but now the first row is white. How can I fix this?

 

http://www.mariskavos.nl/shop/index.php?cPath=21_25

 

Hi,

I have the same problem with the first row showing white instead of the correct background color of my site. I looked in stylesheets but couldnt figure where to change it. What part did you change in stylesheets?

Link to comment
Share on other sites

  • Replies 456
  • Created
  • Last Reply

Top Posters In This Topic

:thumbsup:

 

I just update this wonderfull contribution to 2.2.

 

What's new?

- You can now set how many column to display in row from the admin instead hard coded in product_listing_col.php

- It will display the default product_listing.php if you set the number of column to 1

- add procentage width in td tag to make the column alignment display correctly

 

Happy Coding!

 

I just installed the 2.2 version and there is a problem with the first row of products. The background is white and does not match the color of the rest of the of the columns. Do you have any idea what would cause this?

The products are listed fine and all the functions work with no errors. Just the first row of 3 is white.

Since there is only 1 background in product listings in stylesheets I cant just change the color because the color is already changed.

Any suggestions on what to do? I know very little about the php thing so any help would be greatly appreciated.

Link to comment
Share on other sites

I just installed the 2.2 version and there is a problem with the first row of products. The background is white and does not match the color of the rest of the of the columns. Do you have any idea what would cause this?

The products are listed fine and all the functions work with no errors. Just the first row of 3 is white.

Since there is only 1 background in product listings in stylesheets I cant just change the color because the color is already changed.

Any suggestions on what to do? I know very little about the php thing so any help would be greatly appreciated.

Hi there...

I've got the same problem happening, about to start playing, might take me a while though, cos I'm new to all this too!

Link to comment
Share on other sites

I just installed the 2.2 version and there is a problem with the first row of products. The background is white and does not match the color of the rest of the of the columns. Do you have any idea what would cause this?

The products are listed fine and all the functions work with no errors. Just the first row of 3 is white.

Since there is only 1 background in product listings in stylesheets I cant just change the color because the color is already changed.

Any suggestions on what to do? I know very little about the php thing so any help would be greatly appreciated.

OK... probably not the best way to do it, because it will change your address book, etc, but the easiest way to get the page to display well...

 

look in stylesheet.css and find

 

TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
 background: #000000;
}

TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
 background: #000000;
}

change #000000 to the same colour as you background...

 

Voila!

 

Hope it works for you too!

 

~Barbara~

Link to comment
Share on other sites

OK... probably not the best way to do it, because it will change your address book, etc, but the easiest way to get the page to display well...

 

look in stylesheet.css and find

 

TR.accountHistory-odd, TR.addressBook-odd, TR.alsoPurchased-odd, TR.payment-odd, TR.productListing-odd, TR.productReviews-odd, TR.upcomingProducts-odd, TR.shippingOptions-odd {
 background: #000000;
}

TR.accountHistory-even, TR.addressBook-even, TR.alsoPurchased-even, TR.payment-even, TR.productListing-even, TR.productReviews-even, TR.upcomingProducts-even, TR.shippingOptions-even {
 background: #000000;
}

change #000000 to the same colour as you background...

 

Voila!

 

 

Hope it works for you too!

 

~Barbara~

 

 

Hi,

Thanks for the reply. I have already changed all of that and still have the same problem. So I'm still stuck. I had all the colors changed a week or so before I installed the product listing in columns contribution. But thanks for trying.

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

Bit of a duh moment this... I installed this contrib on a site which is only one category deep, i.e. user logs on to category (event ceremony) and all the products (photos) are displayed in 3 columns. Fantastic!

 

I am now setting up another site using the first as a starting point (because of numerous other hacks). However this one has standard categories/ subcategories. I am now getting the subcategories displaying in 3 columns, but the products within subcats in just one column. Huh?

 

Can anyone cleverer than myself (lots of you) point me to what I might have done?

 

cheers, Simon B

Edited by simonzebu
Link to comment
Share on other sites

I just installed this awesome contrib and it definitely improves the look and usability of my site. The only problem I have found is that on the product listing page, my "Buy Now" buttons don't work. When I set the number of columns to "1" it reverts back to its original look and the "Buy Now" buttons work fine. I was just wondering if anyone else had the same problem and knew how to fix it. I should mention that I installed the "Buy Now Anchor to Forms" contrib a while back, I'm thinking that this might be the culprit? But it looks as if this contrib has its own code for the buttons. Perhaps more caffeine will provide me an answer... :blink:

 

Lyle's Fabrics, Crafts & Gits

Link to comment
Share on other sites

Ok, a bit of rest helped me solve my problem. I had forgotten to include the code from the "Buy Now buttons to Forms" mod into product_listing_col.php. It's working great now! If anyone has had the same problem, don't forget to stick the code for the other mod in there or else your buy now buttons will be as good as useless:

 

// Begin Buy Now button mod

 

case 'PRODUCT_LIST_BUY_NOW':

 

$lc_align = 'center';

 

$lc_text = '<form name="buy_now_' . $listing_values['products_id'] . '" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now', 'NONSSL') . '"><input type="hidden" name="products_id" value="' . $listing_values['products_id'] . '">' . tep_image_submit('button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . '</form> ';

 

break;

 

// End Buy Now button mod

Link to comment
Share on other sites

I am not sure this thread is the right place to ask, but I'll try anyway...

 

Note - I realize this may be basic OSC admin configuration, but I don't see how to change it via the admin panel

 

OK, Customer wants to alter the product listing page so there are two columns. The left most <td> holds the image. The next <td> is product name <br>price<br>description<br>Buy Now button.

 

Can this contribution do such a thing? I am almost thinking I have to change php code to get this to happen. Ideas?

Link to comment
Share on other sites

I am not sure this thread is the right place to ask, but I'll try anyway...

 

Note - I realize this may be basic OSC admin configuration, but I don't see how to change it via the admin panel

 

OK, Customer wants to alter the product listing page so there are two columns. The left most <td> holds the image. The next <td> is product name <br>price<br>description<br>Buy Now button.

 

Can this contribution do such a thing? I am almost thinking I have to change php code to get this to happen. Ideas?

 

 

Yes you can. And it's actually rather simple to implement since all the hard work is already done in an elegant solution in a contribution devised by Amanda (contr. 3269). Here, it detects the browser resolution and gives a variable either one of two values: high or low (or more if you mod the code). You can now include in your code how many columns you would like to have with each resolution! Customers can even switch between the high or low res value settings! It's a top notch contribution.

 

Voila!

Link to comment
Share on other sites

Hi all,

 

I have setup this contribution (work fine) but i need change original table with this:

 

	<table align="center" border="1" cellpadding="0" cellspacing="0" width="60%">
	<tr>
		<td colspan="2" align="left" valign="top">
			Product name</td>
		<td width="50%" align="right" valign="top">
			Manufacturer</td>
	</tr>
	<tr>
		<td height="80" width="25%" align="center"  valign="top">
			</td>
		<td colspan="2" align="left" valign="top">
			Description</td>
	</tr>
	<tr>
		<td width="25%" align="center" valign="top">
			More...</td>
		<td width="25%" align="left" valign="top">
			Add cart</td>
		<td width="50%" align="right" valign="top">
			Price</td>
	</tr>
</table>

 

Somebody can help me please ?

Link to comment
Share on other sites

screen.gif

 

I dont think it can be done that straight forward...i have been meddeling with this code to display in product listing (to get the default view, not the column view)

 

So far i have been able to bring them in a line i.e

 

image.....Prod.Name.....Price.....Qty.....BuyNow

 

I made the changes here, removed the <br>

 

 if ($products_attributes['total'] == 0) { 
	$lc_text .= '??';//here
	$lc_text .= tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_buy_now.gif', TEXT_BUY . $listing[$x]['products_name'] . TEXT_NOW);
	 $lc_text .= '?';//here 
---
--
// End Add Multiple mod
  }
  $product_contents[] = $lc_text;

}
$lc_text = implode('?', $product_contents);// here

 

Please tell me wht to do, as im tottally stuck...so close yet so far

l8ter

Link to comment
Share on other sites

anyone please help me out with this...

 

 

 

 

 

 

screen.gif

 

I dont think it can be done that straight forward...i have been meddeling with this code to display in product listing (to get the default view, not the column view)

 

So far i have been able to bring them in a line i.e

 

image.....Prod.Name.....Price.....Qty.....BuyNow

 

I made the changes here, removed the <br>

 

 if ($products_attributes['total'] == 0) { 
	$lc_text .= '??';//here
	$lc_text .= tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_buy_now.gif', TEXT_BUY . $listing[$x]['products_name'] . TEXT_NOW);
	 $lc_text .= '?';//here 
---
--
// End Add Multiple mod
  }
  $product_contents[] = $lc_text;

}
$lc_text = implode('?', $product_contents);// here

 

Please tell me wht to do, as im tottally stuck...so close yet so far

l8ter

Link to comment
Share on other sites

Hi Sarath

 

I do not understand what the poblem is: you do not describe what's in the picture (you have or want this???), what you have problems with and what do you mean with "to get the default view, not the column view" ?

Link to comment
Share on other sites

Hi Sarath

 

I do not understand what the poblem is: you do not describe what's in the picture (your current layout or you want to achieve this???), what you have problems with and what do you mean with "to get the default view, not the column view" ?

Link to comment
Share on other sites

Hi Sarath

 

I do not understand what the poblem is: you do not describe what's in the picture (your current layout or you want to achieve this???), what you have problems with and what do you mean with "to get the default view, not the column view" ?

 

Hello Sjaak,

Thanks for the reply..Im sorry if i was being not very clear..let me try to explain again

This is what i want to acheieve, when i meant default view, i meant the (default) Listing of Product listing rather than in columns using this contribution..

something like this

 

pic2.jpg

 

but with the ablitity to put multiple qty

 

Currently with this contribution i can get this far:

 

screen.gif

 

this i acheieve by doing the changes in the product listing_multi_col.php

 

if ($products_attributes['total'] == 0) {

$lc_text .= ' ';//REMOVED <br>?

$lc_text .= tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_buy_now.gif', TEXT_BUY . $listing[$x]['products_name'] . TEXT_NOW);

$lc_text .= ' ';//REMOVED <br>? HERE

---

--

// End Add Multiple mod

}

$product_contents[] = $lc_text;

 

}

$lc_text = implode(' ', $product_contents);// REMOVED <br> HERE

 

also i changed the number of columns from 3 to 1

if ($column >= 1|| $x == ($no_of_listings -1) ) {

$row ++; // we start a new tr here with $list_box_contents

$list_box_contents[$row] = array('params' => $class_for_buy_now);

$column = 0;

 

 

I cannot make it to look like the default product listing as in OSCommerce... please help

 

thanks in advance

l8ter

Link to comment
Share on other sites

Thanks for expanding on that.

 

Are there not other contributions available which do this?

 

eg 2113, 3022, 1129 and maybe others

 

Some are rather old, but have a look at the code and see how you can adapt it for current product_listing.php. I believe that "product listing in columns" actually derives part of the code for the qty box from one of these.

 

Is this helpful?

 

Good luck.

Link to comment
Share on other sites

Hey all

 

I finally fixed it, its posted in the contribution section:

http://www.oscommerce.com/community/contri...ns/search,39650

 

 

 

Support Forum at :

http://www.oscommerce.com/forums/index.php?showtopic=213179

 

This contribution is a hack from djmonkeys Product Listing Multi Col v2.1

 

All the coding and contributions belong to the respective contributers.

l8ter

Link to comment
Share on other sites

Does anyone know how to incorporate this great contribution (i'm using v2.1) with the Product Sort v1.6 contribution. One of the files you need to edit is the product_listing.php file, and i'm not sure how to add the code to the new product_listing_col.php file.

 

Here are the instructions for a fresh product_listing.php file...

 

>>> FIND THIS:

  case 'PRODUCT_LIST_BUY_NOW':
	$lc_text = TABLE_HEADING_BUY_NOW;
	$lc_align = 'center';
	break;

>>> ADD THE FOLLOWING 4 LINES *AFTER* THE ABOVE:

  case 'PRODUCT_SORT_ORDER':
$lc_text = TABLE_HEADING_PRODUCT_SORT;
$lc_align = 'center';
break;



2. Approximately line 131-134,

>>> FIND THIS:

	  case 'PRODUCT_LIST_BUY_NOW':
		$lc_align = 'center';
		$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
		break;

>>> ADD THE FOLLOWING 4 LINES *AFTER* THE ABOVE:

	  case 'PRODUCT_SORT_ORDER';
		$lc_align = 'center';
		$lc_text = ' ' . $listing['products_sort_order'] . ' ';
		break;

 

Since those 2 case statements aren't there, or are way different, i'm not sure where or how to insert that code :( Any help would be VERY much appreciated! Thank you so much!

Link to comment
Share on other sites

could any one help me please, i try to install this contribution many times"Product Listing in Columns 2.2" with no result i try many times i have tow question and i hope you answer me if you please the first in the installtion text i found that i have to overwrite the file witch named"product_listing_col.php" i didn't found this file at all so if any one help me to install this contribution and if you please but it in simple way and step by step i will be so thanfull , thank you in advance

Link to comment
Share on other sites

could any one help me please, i try to install this contribution many times"Product Listing in Columns 2.2" with no result i try many times i have tow question and i hope you answer me if you please the first in the installtion text i found that i have to overwrite the file witch named"product_listing_col.php" i didn't found this file at all so if any one help me to install this contribution and if you please but it in simple way and step by step i will be so thanfull , thank you in advance

 

The installation instructions with v2.2 are confusing. If you follow the steps below step by step you should be able to install the new version with no problems.

 

Here are the instructions

 

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

 

//====================================================

 

 

This contribution will add a column to allow attributes to show in the product listing, as well as allow quantity entries from the listing as well.

 

BACKUP DATABASE AND ALL MODIFIED FILES BEFORE MODIFYING ANYTHING!

 

 

//====================================================

 

1. First off, the database change.

 

Run the following command on your database:

 

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Add Multiples column', 'PRODUCT_LIST_MULTIPLE', '0', 'Do you want to display the Multiple Quantity with Attributes column?', '8', '11', now());

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Add Multiples with Buy Now column', 'PRODUCT_LIST_BUY_NOW_MULTIPLE', '0', 'Do you want to display the Multiple Quantity Buy Now with Attributes column?', '8', '12', now());

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Number of column per row', 'PRODUCT_LIST_NUMCOL', '3', 'How many columns per row to display?', '8', '13', now());

 

Be careful with this one. If you have made changed to your configuration table, the "11", "12", and "13" for sort_order will have to change depending on the last item with the configuration_group_id of "8"

 

//====================================================

 

 

in catalog/index.php

 

around line 120 look for:

 

$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);

 

change to:

 

$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,

//bof column product listing with attributes

'PRODUCT_LIST_MULTIPLE' => PRODUCT_LIST_MULTIPLE,

'PRODUCT_LIST_BUY_NOW_MULTIPLE' => PRODUCT_LIST_BUY_NOW_MULTIPLE,

//eof column product listing with attributes

'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

 

//====================================================

 

 

look for:

 

for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {

 

 

add immediately after it:

 

if ( ($column_list[$col] == 'PRODUCT_LIST_BUY_NOW') || ($column_list[$col] == 'PRODUCT_LIST_PRICE') ) {

continue;

}

 

 

//====================================================

 

 

in /catalog/includes/languages/english/index.php

 

add:

 

define('TABLE_HEADING_MULTIPLE', 'Qty.');

 

and/or any other languages you are using.

 

 

//================================================

 

in /includes/classes/boxes.php

 

around line 39 look for:

 

if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . $contents[$i][$x]['align'] . '"';

 

immediately after that line insert:

 

if (isset($contents[$i][$x]['valign']) && tep_not_null($contents[$i][$x]['valign'])) $tableBox_string .= ' valign="' . $contents[$i][$x]['valign'] . '"';

 

//================================================

 

 

in /includes/application_top.php

 

look for:

// customer adds a product from the products page

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+($HTTP_POST_VARS['cart_quantity']), $HTTP_POST_VARS['id']);

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

 

after that add:

 

case 'buy_now_form' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+($HTTP_POST_VARS['cart_quantity']), $HTTP_POST_VARS['id']);

// replace quantities $cart->get_quantity($HTTP_POST_VARS['products_id'])-($cart->get_quantity($HTTP_POST_VARS['products_id']))+($HTTP_POST_VARS['cart_quantity']), $HTTP_POST_VARS['id']);

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

// customer adds multiple products from the products_listing page

case 'add_multiple' :

while ( list( $key, $val ) = each( $HTTP_POST_VARS ) )

{

if (substr($key,0,11) == "Qty_ProdId_" || substr($key,0,11) == "Qty_NPrdId_")

{

$prodId = substr($key, 11);

$qty = $val;

if ($qty <= 0 ) continue;

if(isset($HTTP_POST_VARS["id_$prodId"]) && is_array($HTTP_POST_VARS["id_$prodId"])) {

// We have attributes

$cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId,$HTTP_POST_VARS["id_$prodId"]))+$qty, $HTTP_POST_VARS["id_$prodId"]);

} else {

// No attributes

$cart->add_cart($prodId, $cart->get_quantity($prodId)+$qty);

}

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

//------------------------------------------------------------------------------------------------

 

Copy the file product_listing_col.php into catalog/includes/modules/ directory

 

//------------------------------------------------------------------------------------------------

 

In filenames.php change

 

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

 

to

 

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

 

 

//====================================================

 

have fun!

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

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