Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
bruyndoncx

[Contribution] Compare Products Side-By-Side

Recommended Posts

This contribution offers a side-by-side comparison feature from the product_listing page

 

Purpose: Contribution to osCommerce for shop owners that want to offer online dynamic database driven side-by-side product comparison feature to their customers.

 

Features:

- language support

- currency support

- special price displayed if available

- Clicking on product name and image brings up product_info page

 

Supported/compatible with following contributions:

- option_types_feature v1.6 contribution

- static attributes contribution

 

Parameters:

Note: all parameters follow the following naming convention: COMPARE_PRODUCTS_SIDEBYSIDE_XXX and are set via the admin configuration interface

- DEBUG: if set to true; shows some debug info on top of the page

- NAME: if set to true shows in the header

- IMAGE: if set to true shows in the header

- PRICE: if set to true shows in the header

- MODEL: if set to true shows in the data body

- MANUFACTURER: if set to true shows in the data body

- DESCRIPTION: if set to true shows in the data body

- QUANTITY: if set to true shows in the data body

- WEIGHT: if set to true shows in the data body

- STATIC: if set to true shows all static attributes in the data body

- OPTIONS: if set to true shows all available options in the data body

- COLUMN_LEFT: if set to true shows standard left column

- COLUMN_RIGHT: if set to true shows standard right column

- FOOTER: if set to true shows standard footer

- BUY_NOW: Not yet implemented

 

 

Demo

Edited by Johnson

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites

Here's the link to the contribution:

 

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


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites

Sounds like a really intresting contribution!

 

Is there a demo available some place?


----===~~oOo~~===----

// Bjarne Varoystrand aka Black Skorpio

Do to others what you want them to do to you

- �� Lek och Lust F�r Vuxna

Share this post


Link to post
Share on other sites

Thnx, man!

 

Will check it out asap...


----===~~oOo~~===----

// Bjarne Varoystrand aka Black Skorpio

Do to others what you want them to do to you

- �� Lek och Lust F�r Vuxna

Share this post


Link to post
Share on other sites

Very nice, but will it work with the proct listing in colums mod?


----===~~oOo~~===----

// Bjarne Varoystrand aka Black Skorpio

Do to others what you want them to do to you

- �� Lek och Lust F�r Vuxna

Share this post


Link to post
Share on other sites

? had install the contrib, but when I selected the Products and click on "Continue" - nothing happens.

 

 

Greetings

Oliver

Share this post


Link to post
Share on other sites

I?ve tried it on your Page, but when I selected no products there is an error:

 

Warning: implode(): Bad arguments. in /home/bruyndo/public_html/catalog/compare.php on line 104

 

Warning: implode(): Bad arguments. in /home/bruyndo/public_html/catalog/compare.php on line 116

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') and pd.language_id = '1' order by p.products_id asc' at line

 

select p.products_quantity, p.products_image, pd.products_description, pd.products_name, m.manufacturers_name, p.products_model, 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 products_description pd join products p using (products_id) left join manufacturers m using (manufacturers_id) left join specials s on p.products_id = s.products_id where p.products_id in () and pd.language_id = '1' order by p.products_id asc

 

[TEP STOP]

Share this post


Link to post
Share on other sites
Very nice, but will it work with the proct listing in colums mod?

The current version only has the instructions to modify the standard product_listing.php MS2 version.

However, based on this, it shouldn't be too hard to modify the columns mod and add the checkboxes. If you check the readme.txt you'll see there are actually very little changes in the file.


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites

Give me some time tomorrow, and i install it on my store...

It is a MS2.2 store with "some" contributions installed already, so if it works there with out any big glitches; it sure as H**l is a solid contrib :D


----===~~oOo~~===----

// Bjarne Varoystrand aka Black Skorpio

Do to others what you want them to do to you

- �� Lek och Lust F�r Vuxna

Share this post


Link to post
Share on other sites
? had install the contrib, but when I selected the Products and click on "Continue" - nothing happens.

do you get a hand icon when you hover over Continue ? ie does it recognize it's linked and a submit button ?


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites
I?ve tried it on your Page, but when I selected no products there is an error:

Thanks for pointing this out, added additional code to catch this and showing an error msg.

I was wondering though what the standard way for this kind of msg is.

 

If someone has a sample of proper error msg code to use; please post here

 

Thanks


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites

How about making a check that they atleast have choosen two products for comparison?

 

If >2 products = "You have to choose a minimum of two products to be able to make a comparison"

 

Just my two cents


----===~~oOo~~===----

// Bjarne Varoystrand aka Black Skorpio

Do to others what you want them to do to you

- �� Lek och Lust F�r Vuxna

Share this post


Link to post
Share on other sites

There is one thing i noticed when visiting your store, the contrib cant handle categories with multible pages!

 

I tested this in your Cooking cat, where i marked 2 products on the first page; then whent on to the secound page where i marked the third product to compare. Then clicked "Continue"

Result: i was only comparing the last product! :(

 

Is there any way to fix this, so it can handle categories that spans several pages?

 

// Me feels like i'm spamming this thread ;)


----===~~oOo~~===----

// Bjarne Varoystrand aka Black Skorpio

Do to others what you want them to do to you

- �� Lek och Lust F�r Vuxna

Share this post


Link to post
Share on other sites
Is there any way to fix this, so it can handle categories that spans several pages?

 

// Me feels like i'm spamming this thread ;)

I'm not sure how this could be done; I'll have to think about that one, can't immediately think of a smart way to achieve that.

Maybe I just need a fresh mind and the answer might come overnight ...

 

Thanks for all your feedback ! Keep the ideas coming !

 

Cheers


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites
Guest
I?ve tried it on your Page, but when I selected no products there is an error:

Thanks for pointing this out, added additional code to catch this and showing an error msg.

I was wondering though what the standard way for this kind of msg is.

 

If someone has a sample of proper error msg code to use; please post here

 

Thanks

The standard method is to us the $messageStack class:

 

 ? ?if ($variable) != PARAMETER) {
? ? ?$error = true;

? ? ?$messageStack->add('form_identity', ERROR_TEXT);
? ?}

 

and it is displayed:

 

<?php
?if ($messageStack->size('form_identity') > 0) {
?>
? ? ?<tr>
? ? ? ?<td><?php echo $messageStack->output('form_identity'); ?></td>
? ? ?</tr>
? ? ?<tr>
? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
? ? ?</tr>
<?php
?}
?>

 

Look at create_account.php to see it in use :)

 

or, another way is:

 

<?php
?if (tep_db_num_rows($your_db_query) < 1) {
?>
? ? ?<tr>
? ? ? ?<td><?php new infoBox(array(array('text' => YOUR_ERROR_MESSAGE))); ?></td>
? ? ?</tr>
? ? ?<tr>
? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
? ? ?</tr>

 

 

Matti

Edited by Johnson

Share this post


Link to post
Share on other sites
Guest
Is there any way to fix this, so it can handle categories that spans several pages?

 

// Me feels like i'm spamming this thread ;)

I'm not sure how this could be done; I'll have to think about that one, can't immediately think of a smart way to achieve that.

Maybe I just need a fresh mind and the answer might come overnight ...

 

Thanks for all your feedback ! Keep the ideas coming !

 

Cheers

You can do this by using the splitPageResults class - take a look at includes/module/product_listing.php to see this in action :)

 

Matti

Share this post


Link to post
Share on other sites
? had install the contrib, but when I selected the Products and click on "Continue" - nothing happens.

do you get a hand icon when you hover over Continue ? ie does it recognize it's linked and a submit button ?

Yes, but when I click on the button, nothing happens.

Share this post


Link to post
Share on other sites
? had install the contrib, but when I selected the Products and click on "Continue" - nothing happens.

do you get a hand icon when you hover over Continue ? ie does it recognize it's linked and a submit button ?

Yes, but when I click on the button, nothing happens.

Bug in the product_listing.php instructions, it doesn't generate the FORM tags when you are not showing the navigation bar on top, the closing bracket should be before the Compare mod.

 

Corrected installation instructions are:

 

    3.1 Find (~line 22)

 

</table>

<?php

  }

 

 

        Replace With

 

</table>

<?php

  }

  /* BoF Compare Products side-by-side */

  echo tep_draw_form('compare', tep_href_link("compare.php", tep_get_all_get_params(array('action')))); ?> </td>

<?php

  /* EoF Compare Products side-by-side */


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites

not work

 

1064 - You have an error in your SQL syntax near 'using (products_id) left join manufacturers m using (' at line 1

select p.products_quantity, p.products_image, pd.products_description, pd.products_name, m.manufacturers_name, p.products_model, 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 products_description pd join products p using (products_id) left join manufacturers m using (manufacturers_id) left join specials s on p.products_id = s.products_id where p.products_id in (3313,3388) and pd.language_id = '4' order by p.products_id asc

[TEP STOP]

Share this post


Link to post
Share on other sites

Hi Dimarik,

I don't understand why this isn't working for you. The same query works fine on my site which is running MS2 version.

 

- Which osC version do you have installed ?

- It looks like manufacturers_id isn't existing in your products, or manufacturers table, seems strange to me, but that's what I understand from the error.

 

Is there anyone else having the same issue ?


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites
Give me some time tomorrow, and i install it on my store...

It is a MS2.2 store with "some" contributions installed already, so if it works there with out any big glitches; it sure as H**l is a solid contrib :D

Did you have any luck in installing and modifying it to work with the product listing in columns ?


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites

Uploaded new full package v1.01: Bug fixes

- compare form wasn't generated when navigation bar on top wasn't showing

(step 3.1 in installation instructions)

- $columns size wasn't checked causing error when nothing was selected

( check for minimum nbr of products (new parameter) and error msg added


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites
Did you have any luck in installing and modifying it to work with the product listing in columns ?

Well, no it was a bit harder then i thought :blink:

 

It will take some thinking before i can have it running on my product listing :(

To bad, this would almost make my store complete *sigh*

 

Will catch some sleep, and give it yet another try with a freash mind ;)

Edited by Black_Skorpio

----===~~oOo~~===----

// Bjarne Varoystrand aka Black Skorpio

Do to others what you want them to do to you

- �� Lek och Lust F�r Vuxna

Share this post


Link to post
Share on other sites

I installed the new version but every time I get an error:

 

Nothing to compare

Please select a minimum of 2 products to compare on previous page

Edited by o.entinger

Share this post


Link to post
Share on other sites

I think this might be a register globals issue.

Can you insert the following code in compare.php ?

Let me know how it goes

~carine

 

// v1.02 if register globals is off, need to fetch $columns explicitly
if (!isset($columns)) {
$columns = array();
$columns = $HTTP_POST_VARS['columns'];
}
   
if (COMPARE_PRODUCTS_SIDEBYSIDE_DEBUG == 'true') {
   echo 'columns ';
   print_r($columns);
}

 

BEFORE this line

	
// v1.01 if $columns is not set, there is nothing to compare, show appropriate message instead
if (count($columns) >= COMPARE_PRODUCTS_SIDEBYSIDE_MINIMUM) {


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

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  

×