Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Compare My Price


Jack_mcs

Recommended Posts

Did you try the code I posted? If that doesn't show the problem, post the page you are trying to get the price from and I will take a look.

I have tried both of the code fixes posted. I can get it to display Their Price = My price = and it shows my price but it doesn't show their price. One page I've tried it on is http://www.chutingstargear.com/index.php?main_page=product_info&cPath=6_8&products_id=29

 

There are a couple of places where the price shows up and I've tried several variations of both. I hope you can help me figure this out because I think this is a pretty cool contribution. Thanks for taking a look. BTW, I'd like to pull prices from a page like the following, but I'm guessing a page with multiple products would pose a problem. If my assumption is a bad one, please enlighten me. http://www.paragear.com/templates/parachutes.asp?group=5&level=1

Link to comment
Share on other sites

Which is their page? Which is your page? What comparison code are you using?

Neither one is my page. I listed two competitors' pages, one with a single product listed and one with multiple products listed. I've tried to get a comparison for the Altitrack (which is listed on both pages) to mine. For now, I'll try to focus on what should be the simpler problem, the comparison to the single-product page. Once that is figured out, I'll see if I can master the comparison on the multiple-product page.

 

For this page http://www.chutingstargear.com/index.php?main_page=product_info&cPath=6_8&products_id=29

I'm currently using this search string: <title>Altitrack [Altitrack altimeter] - (.*) :

Link to comment
Share on other sites

Neither one is my page. I listed two competitors' pages, one with a single product listed and one with multiple products listed. I've tried to get a comparison for the Altitrack (which is listed on both pages) to mine. For now, I'll try to focus on what should be the simpler problem, the comparison to the single-product page. Once that is figured out, I'll see if I can master the comparison on the multiple-product page.

 

For this page http://www.chutingstargear.com/index.php?main_page=product_info&cPath=6_8&products_id=29

I'm currently using this search string: <title>Altitrack [Altitrack altimeter] - (.*) :

The code is failing because there is text as part of the price. Try this. In includes/moudles/comparemyprice.php, find

$their_price = str_replace("$", "", strip_tags($price[0]));

and replace it with

         preg_match('/([\d]+)/', strip_tags($price[0]), $match);
        $their_price = $match[0];

The compare string should be

Starting at:(.*)</h2>

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

The code is failing because there is text as part of the price. Try this. In includes/moudles/comparemyprice.php, find

$their_price = str_replace("$", "", strip_tags($price[0]));

and replace it with

         preg_match('/([\d]+)/', strip_tags($price[0]), $match);
        $their_price = $match[0];

The compare string should be

Starting at:(.*)</h2>

That worked. The only thing I noticed was that it shows up at the bottom instead of the top of the listing now.

 

Thanks!!!

Edited by baddog
Link to comment
Share on other sites

That worked. The only thing I noticed was that it shows up at the bottom instead of the top of the listing now.

 

Thanks!!!

I can see that constructing the search string is somewhat of an art form. I have tried a few variations on this page: http://marketplace.amazia.com/para-service/prodinfo.asp?cn=566331&affid=&sku=HA7019&page=34&pagenumber=1&inverrmsg=

 

It's picking up numbers from color codes or something and not the product price. Any suggestions there?

 

Also, am I correct that it would be futile to try to come up with a viable search string on a page like this: http://www.paragear.com/templates/parachutes.asp?group=5&level=1

Edited by baddog
Link to comment
Share on other sites

That worked. The only thing I noticed was that it shows up at the bottom instead of the top of the listing now.

You have to position the comparemyprice code in product_info.php so the comparison displays where you want it to.

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

I can see that constructing the search string is somewhat of an art form. I have tried a few variations on this page: http://marketplace.amazia.com/para-service/prodinfo.asp?cn=566331&affid=&sku=HA7019&page=34&pagenumber=1&inverrmsg=

 

It's picking up numbers from color codes or something and not the product price. Any suggestions there?

 

Also, am I correct that it would be futile to try to come up with a viable search string on a page like this: http://www.paragear.com/templates/parachutes.asp?group=5&level=1

For the first one:

Current Price</b></font></td><td nowrap><font face="verdana, arial, helvetica" size=-1 color="#990033"><b>(.*)</b></

 

For the second one:

It won't work on a page like that, at least, not without specialized coding, since there is more than one price. You need to find the actual product page, if one exists, and take it from there.

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

For the first one:

Current Price</b></font></td><td nowrap><font face="verdana, arial, helvetica" size=-1 color="#990033"><b>(.*)</b></

This one still doesn't work for me. Nothing is displayed. I guess that's better than the thousands of dollars it was showing before. :)

Link to comment
Share on other sites

This one still doesn't work for me. Nothing is displayed. I guess that's better than the thousands of dollars it was showing before. :)

Okay, here's another one. It is showing the competitor's price as $143.00 instead of $143.99.

 

Page: http://metalsunglasses.com/radwrapsunwi4.html

Search string: Sale price: (.*)</span>

 

I hope this feedback is helpful and not annoying. I love this contribution and hope it can be fine-tuned along the way.

Link to comment
Share on other sites

Okay, here's another one. It is showing the competitor's price as $143.00 instead of $143.99.

 

Page: http://metalsunglasses.com/radwrapsunwi4.html

Search string: Sale price: (.*)</span>

 

I hope this feedback is helpful and not annoying. I love this contribution and hope it can be fine-tuned along the way.

Try changing the line I posted as shown. I haven't tested it but I think it will work.

         preg_match('/([\d]+)/', ($price[0]), $match);

to

         preg_match('/([\d.]+)/', ($price[0]), $match);

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

Try changing the line I posted as shown. I haven't tested it but I think it will work.

         preg_match('/([\d]+)/', ($price[0]), $match);

to

         preg_match('/([\d.]+)/', ($price[0]), $match);

Seems to have done the trick. Thanks again!

Link to comment
Share on other sites

  • 1 month later...

Hi Jack, excellent mod. It's working fine in my shop. I want to know is there is a way to know in admin section my price and the other price by a buttom like "check now". In this way i know if my price must change or let it. I apologize for my english. I hope you understand me. I think it's not easy work check products by products in products_info page to compare prices and if i dont see anything mean my price is bigger, but how much bigger is my price?. Think this in a big store with more 5000-10000 items. Thanks.

Link to comment
Share on other sites

Hi Jack, excellent mod. It's working fine in my shop. I want to know is there is a way to know in admin section my price and the other price by a buttom like "check now". In this way i know if my price must change or let it. I apologize for my english. I hope you understand me. I think it's not easy work check products by products in products_info page to compare prices and if i dont see anything mean my price is bigger, but how much bigger is my price?. Think this in a big store with more 5000-10000 items. Thanks.

No, there isn't an option for that but it is a good idea. I will put it on the list for the next version.

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

  • 1 year later...

It hasn't been converted for 2.3 but it should still work for the most part. There's one file in admin that would cause a display error but that would be a relatively simple change. That assumes, of course, that you are comfortable with editiing files. If not, then I wouldn't suggest installing it.

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

ya im ok with editing file as long as i know what to do. im not a coder though, i wouldnt know what needs to be edited....if i install it and see any error could we trouble shoot and see if we can get this to work on 2.3? im ok with being the first ;)

Edited by GoTTi
Link to comment
Share on other sites

having a mysql error right off the bat....

 

Error

SQL query:

CREATETABLE comparemyprice(

unique_id INT( 11)NOTNULLAUTO_INCREMENT ,

url varchar( 255) default'' NOTNULL ,

search_str varchar( 48) default'' NOTNULL ,

site_name varchar( 48) default'' NOTNULL ,

products_id int NOTNULL ,

enabled tinyint( 1) DEFAULT'0' NOTNULL ,

language_id int DEFAULT'1' NOTNULL ,

PRIMARYKEY ( unique_id )

) TYPE=MYISAM ;

 

 

MySQL said:

#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 'TYPE=MyISAM' at line 10

Link to comment
Share on other sites

instructions says:

 

That completes the installation. Go to admin->CompareMyPrice and add the sites

to be checked. See the instructions on that page as to how to do that. Then goto

the product page of your shop that you set up a compare for to see the results.

 

when i go to admin i see CompareMy Price under configuration. I click that and all i see is a way to disbale or enable version checker. is there somewhere else i should be looking for the compare my price link?

Link to comment
Share on other sites

instructions says:

 

That completes the installation. Go to admin->CompareMyPrice and add the sites

to be checked. See the instructions on that page as to how to do that. Then goto

the product page of your shop that you set up a compare for to see the results.

 

when i go to admin i see CompareMy Price under configuration. I click that and all i see is a way to disbale or enable version checker. is there somewhere else i should be looking for the compare my price link?

You're looking at the settings: admin->Configuration->CompareMyPrice. The instructions say to go to admin->CompareMyPrice.

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

  • 6 months later...

It would seem that the comma in 18,000 is causing a problem. I didn't code it for anything over 999, thus the problem. Try this,untested, change. In includes/modules/comparemyprice.php, find

preg_match('/([\d]+)/', strip_tags($price[0]), $match); 

and change it to:

preg_match('/(\d+(,\d+)*(\.\d+)?)/', strip_tags($price[0]), $match); 

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

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