Jump to content
Jack_mcs

Compare My Price

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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] - (.*) :

Share this post


Link to post
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>

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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. :)

Share this post


Link to post
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.

Share this post


Link to post
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);

Share this post


Link to post
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!

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Hi Jack,

Comparemyprice works great, but I'm trying to compare competitors price 18,000.00 and only i can see as the competitors price 18.00. There's something that i can do to fix this ?

Thanks in advanced

Share this post


Link to post
Share on other sites

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

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

×