Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Compare Products Side-By-Side


Recommended Posts

Sorry didn't see your earlier post, glad you were able to sort it out yourself.

 

Do you by any chance also use product extra fields ?

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

Link to comment
Share on other sites

Hi Carine,

 

There is a completely rewritten Products Extra Fields contribution, which is now also mulit-language compatible.

 

Is your contribution compatible with this one too?

 

Thanks in advance.

No, the contribution that you are linking to is product properties. This is different from product extra fields, as the data is stored in different tables.

I'll need to figure out how the data is exactly stored.

Do you want to sponsor this development :D

Just kidding, shouldn't be too hard, just need time to implement and some systems to test it.

 

Do you have product properties installed where a new compare version could be tested ?

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

Link to comment
Share on other sites

No, the contribution that you are linking to is product properties. This is different from product extra fields, as the data is stored in different tables.

I'll need to figure out how the data is exactly stored.

Do you want to sponsor this development :D

Just kidding, shouldn't be too hard, just need time to implement and some systems to test it.

 

Do you have product properties installed where a new compare version could be tested ?

 

Not yet. I planned to install them both if they were compatible.

But for now I will install the Products Extra Fields v2 (just to see if it works for me) and when your contribution is compatible, also yours.

 

I'll wait untill your ready, or when I can test.

Link to comment
Share on other sites

Not yet. I planned to install them both if they were compatible.

But for now I will install the Products Extra Fields v2 (just to see if it works for me) and when your contribution is compatible, also yours.

 

I'll wait untill your ready, or when I can test.

OK, give me a couple days

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

Link to comment
Share on other sites

I use MS2.2 and product comparison 1.1. I edited all the files mentioned in the readme.txt and placed the compare.php in the specified directories. I am getting the check box on the index.php but when I click on the checkbox it does not refresh but accepts all the checks. When I click on Select Items & Click Here to Compare Continue" button. It goes to compare.php. But this is the message I get.

 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_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]

 

I tried Suggestion given by GOC66(GCAMACHO) on this page page. It doesnot bring any error message it just brings a blank page. but the web address comes as http:// localhost/catalog/compare.php/cPath/1/sort/2a?osCsid=81b8aaaad844110a83532f0d471383bc

&columns_1=1&columns_3=3&osCsid=81b8aaaad844110a83532f0d471383bc&currency=CAD&cPath=1&sort=2a

&osCsid=81b8aaaad844110a83532f0d471383bc&x=32&y=14.

 

Hope somebody could point me to the right direction to make this work.

 

thankyou

Link to comment
Share on other sites

Hi,

does any one tries to install this contrib with B2B Suite?

There is the following problem:

If i switch off Buynow the module works fine. If i switch Buynow on, Compare side by side not only doesn't work but also when i press buynow buttom it tries to compare products. B2BSuite uses forms for buynow (it allows to enter quantity) as well as Side by side compare, but Side by side compare module seems to declare "globally" its file compare.php, so further declaration of links become unusable.

 

The problem is in step 3.1 code:

/* BoF Compare Products side-by-side */
echo tep_draw_form('compare', tep_href_link("compare.php", tep_get_all_get_params(array('action'))), 'get'); ?>
<?php
/* EoF Compare Products side-by-side */

 

Any ideas how to correct this issue?

 

Thanks for help.

 

Alexander

Edited by alex_rus
Link to comment
Share on other sites

alex_rus, varkey,

 

I have not used B2B suite nor the "/" which I guess is search engine friendly URLs.

 

For the B2B suite, it will be a matter of positioning the closing form tag I think, looks like the problem is similar to the one we had early on with the quantity boxes.

 

I'm leaning towards a rewrite of the selection engine to make it similar to the shopping cart, I think that way the overall design will be much better and the code more robust to handle different osC versions. But that's still science fiction now, haven't started yet.

 

varkey,

how are parameters normally passed with the "/" style delimeter ?

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

Link to comment
Share on other sites

I think this could be a nice contribution, altough I never got the chance to see and test it in action

 

Dutyfully I have applied every patch and fix sugested in this forum but to no avail. I am still receiving the "..please select 2.. " error after comparing 2 or more products. :(

 

That's one thing, the other thing is that my site layout goes terribly wrong, I mean the centering of my site is corrupted and column_right is pulled out of it's own frame. :'(

 

I am using a very heavily modified osc 2.2 ms 2 version.

The buy now button as well as other product listing options have been opted out in admin\configuration\product listing. But this didn't resolve anything.

I have used my own product listing and an original stock osc product listing. (didn't resolve anything.)

 

I am not using the contributions wich are supported by this contrib, maybe that's the reasen i haven't come across the mysql errors described in this forum or maybe these are the next ones to come up when could get rid of the first error.

 

BTW when using debug i got the message array()

 

anyway I have spend 5 hours working modifing experimenting with this contrib and i must say it could be nice, but not for me, because i can't get it to work.

 

I hope somebody else can learn from my errors and maybe a tip for all contribution makers out there, start with building contribs based on stock osc files and later make extra add-ons /enhancements for this stock osc contrib.

 

Furthermore I have the utmost respect for the creator of this contrib and the support she is giving all those people with care and considerance, thank you very much :thumbsup:

Kind regards

 

Hakan Haknuz

Link to comment
Share on other sites

Hi carine,

 

varkey,

how are parameters normally passed with the "/" style delimeter ?

I did not follow what you have mentioned here. but the url for categories comes as

http://localhost/giosascurrent/index.php/cPath/1 and for product it comes as

http://localhost/giosascurrent/product_inf...1/products_id/1.

I hope this is what you meant.

thankyou for looking into the problem

 

varkey

Link to comment
Share on other sites

to all having trouble getting this contribution to work

the typical problem is that your product listing page is already customized and the form tags are not properly positioned in your layout.

 

To troubleshoot this, call up the product listing and look at the source from your browser. For the comparison to work, the checkbox has an onchange event that triggers the submission of the form. You have to check if there isn't another form surrounding the checkbox.

 

As for the worry about not having any of the other contributions mentioned. As long as you don't enable static attributes in the admin, you will not get any errors for this. For the option types contribution I don't think this will cause errors as the comparision doesn't look at the actual option types, just fetches the different selected values.

Same for PEF, if you've added the code, it will only execute if you enable it in the admin (after you ran the sql statement also mentioned a few posts back)

 

To troubleshoot, it would be extremely helpful if you could forward a link to your site so I can have a closer look and help further. Without it, I can't really do much to help.

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

Link to comment
Share on other sites

Hi carine,

I did not follow what you have mentioned here. but the url for categories comes as

http://localhost/giosascurrent/index.php/cPath/1 and for product it comes as

http://localhost/giosascurrent/product_inf...1/products_id/1.

I hope this is what you meant.

thankyou for looking into the problem

 

varkey

Have you tried using a configuration without the "/" ? Can you disable this and test again ?

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

Link to comment
Share on other sites

hakan

 

when the pages don't render properly it means that you either made a mistake in adding the comparison column, or that your product listing is so heavily modified that it is incompatible with this mod.

 

My product listing is a stock osC layout, nothing fancy.

It's also tested on an MS2 with the quantity box addition.

 

If you send me the source of your modules/product_listing.php (after you made the necessary changes) I can have a look and see if I can spot the problem easily.

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

Link to comment
Share on other sites

hi carine

Have you tried using a configuration without the "/" ? Can you disable this and test again ?

 

 

I have made little progress. I dont get the sql error. Now when I select two products to compare I get on top of the page Array()

and on the page this message Nothing to compare

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

Link to comment
Share on other sites

First I want to thank the designer of this contribution. It is a wonderful addition to my store. Great job!!!

 

I do have one question. On my product listing pages the right column now falls to the bottom of the page (wraps). I have narrowed it down to this section of the code that is added. Does anybody happen to know how to update this code to keep the right column from dropping to the bottom? Here is one of the pages to show you what I mean. http://www.defensesupplier.com/index.php/cPath/39_38

 

Thanks!!!

 

 

3.1 Find (~line 22) of product_listing.php

 

</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 */

Link to comment
Share on other sites

First I want to thank the designer of this contribution.  It is a wonderful addition to my store.  Great job!!!

 

I do have one question.  On my product listing pages the right column now falls to the bottom of the page (wraps).  I have narrowed it down to this section of the code that is added.  Does anybody happen to know how to update this code to keep the right column from dropping to the bottom?  Here is one of the pages to show you what I mean.  http://www.defensesupplier.com/index.php/cPath/39_38

 

Thanks!!!

 

I think that's because of the tag coloured in red, when i removed this </td> the normal layout came back on my site.

/* 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 */

Kind regards

 

Hakan Haknuz

Link to comment
Share on other sites

I think that's because of the tag coloured in red, when i removed this </td> the normal layout came back on my site.

  /* 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 */

 

 

Thanks a million!! This fixed my problem. :D

Link to comment
Share on other sites

it can not run

when i ckicked the continue (select more then 3 proudcts)

it apper

 

Nothing to compare

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

 

 

in the install files

/////////////////////////////////

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 */

/////////////////////////////////////////////////////////////////

why ? have a </td>

if it the table is bad

 

 

I hope you can give the all files to download in your zipfiles

include your Modified files "product_listing.php"

osCommerce

Link to comment
Share on other sites

I have to trace back my steps to see what's up with the </td>

 

As for including all modified files, most people that install this (rather advanced) contribution already have a heavily modified product listing page, so it's not of much help.

It's not that many edits that you need to do, plus this way it spells out exactly what needs to be done and provides some more insight in the mechanism which can only help in understanding the code and troubleshooting later.

Yes, sometimes you have to work a little to get a contribution to work :)

This way, there is also little chance that you accidentally overwrite your modified files.

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

Link to comment
Share on other sites

I have to trace back my steps to see what's up with the </td>

 

As for including all modified files, most people that install this (rather advanced) contribution already have a heavily modified product listing page, so it's not of much help.

It's not that many edits that you need to do, plus this way it spells out exactly what needs to be done and provides some more insight in the mechanism which can only help in understanding the code and troubleshooting later.

Yes, sometimes you have to work a little to get a contribution to work :)

This way, there is also little chance that you accidentally overwrite your modified files.

Yes that is absolutely true, but i must agree with the former post .

If i had an example (let's say a clean osc product_listing.php, with compare code implementations )i could compare this file with mine and find out where I have made a mistake. Or better i can rename mine and use yours instead, if it is still not working like it should the problem is somewhere else to find.

Altough your readme.txt is written in a nice manner, there is still the fact that humans make mistakes and i am also human .

A given example can help in the learning process

Kind regards

 

Hakan Haknuz

Link to comment
Share on other sites

Hello!

 

Trying to get this potentially Awesome contribution to work on my extremely modified MS2 version of osC...here is what I've got so far:

 

I'm getting the same error most people are getting

'Nothing to compare

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

Along with a debug message at the top of the screen of 'columns Array ( ) columns Array ( ) '

 

I've compared the origional demo's source to my source and found my form tag closed shortly after the 'continue' image but never reopened for the check box - - I made a change to the contribution to at least get a new form tag opened just before each checkbox with the proper name and value.

 

I'm still missing the onclick="this.form.submit();" and the ending form tag.

I also think I'm missing some hidden values...?

 

The most agressive change I've made to my store is changing the product_id feilds to allow variable characters instead of integers. I'm wondering if the $key Variable automatically expects an integer?...if so that could be the cause of my issues. That may have nothing to do with it though.

 

Really all I need is to know how to add the onclick command and where to stick the closing form tag...I hope :blink:

 

if you want to check out my store its Here

 

The test products i've created are under the hardware category...

 

Any help would be greatly appreciated!

 

BTW Carine...Thanks for building this contirbution!

 

Rob

Link to comment
Share on other sites

All,

 

I've uploaded a new version of the contribution which tackles the issues listed.

 

Includes product_listing_MS2sample.php

Corrected installation instructions for the above error - looks like I completely missed this step - SORRY :

 ? ? 3.5 Find (~line 85)

? ? ?$cur_row = sizeof($list_box_contents) - 1;


? ? ? ? Replace with

? ? ?$cur_row = sizeof($list_box_contents) - 1;

? ? ?/* BoF Compare Products side-by-side
? ? ? ? ? ? Add checkbox to compare products */
? ? ?$lc_align = 'center';
? ? ?$lc_text = tep_draw_form('compare', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) ), 'get');
? ? ?$lc_text .= tep_draw_checkbox_field('columns_'.$listing['products_id'],$listing['products_id'],false,'onclick="this.form.submit();"');
? ? ?$lc_text .= $hidden_get_variables;
? ? ?$lc_text .= $hidden_get_columns;
? ? ?$lc_text .= tep_hide_session_id();
? ? ?$lc_text .= '</form>';

? ? ?$list_box_contents[$cur_row][] = array('align' => $lc_align,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'params' => 'class="productListing-data"',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'text' ?=> $lc_text);
? ? ?/* EoF Compare Products side-by-side */

 

Added support for product extra fields (configuration option added in sql file; but by default off)

 

Enjoy

Edited by bruyndoncx

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

Link to comment
Share on other sites

That makes sense! It even seams to work except for the fact that I'm getting the same sql error as others in the thread were getting:

 

columns Array ( [0] => 123T [1] => 232-941 [2] => 231 ) 1064 - You have an error in your SQL syntax near 'using (products_id) left join manufacturers m using (m' at line 1

select p.products_model, pd.products_name, m.manufacturers_name, pd.products_description, p.products_quantity, p.products_image, 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 (123T,232-941,231) and pd.language_id = '1' order by p.products_id asc

 

 

Don't let my VarChars in my array scare you...I tested it with some standard osC products using integers and got the same error.

 

Wish I was better at this...then maybe I could offer some real assistance :(

 

I'll work at it some more to see if I can get it to work...Let me know if any one else can tell me how to fix it.

 

When I'm done with this project...I'm going to take a few weeks off :blink:

Link to comment
Share on other sites

GOT IT!!! :'(

 

 

Found there were some issues with the sql syntax and my version of mysql:

 

Had to change a 'join on' to 'left join'

and

added 'left' infront of a couple of joins

 

AND IT WORKED!

 

 

still doesn't work on my VARCHARS products though... >_<

 

But that's my problem. Unless anyone has any tips??

 

Awesome contribution Carine! Thanks!

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