Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

RSS Feed contribution support thread


Ralph2

Recommended Posts

  • Replies 372
  • Created
  • Last Reply

Top Posters In This Topic

Hi

 

some issues:

- can't add products to cart with CHEMO's urls: the product ID is not appended in the url.

- set the feed limit to 20, but 80 are showing up.

- some products have images, other don't.

Link to comment
Share on other sites

Just wondering, why this piece of code is needed?

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

Open all the php files within the catalog folder / root of your website (e.g. index.php, contact_us.php etc):

 

###Add before / above the </head> tag:

 

<?php

if (!isset($lng) || (isset($lng) && !is_object($lng))) {

include(DIR_WS_CLASSES . 'language.php');

$lng = new language;

}

 

reset($lng->catalog_languages);

while (list($key, $value) = each($lng->catalog_languages)) {

?>

<link rel="alternate" type="application/rss+xml" title="<?php echo STORE_NAME . ' - ' . BOX_INFORMATION_RSS; ?>" href="<?php echo tep_href_link(FILENAME_RSS, 'language=' . $key, 'NONSSL', false); ?>">

<?php

}

?>

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

I installed all without the above and all seems to work correctly, and without any bug, Do I need to install the above? what is it for?

Link to comment
Share on other sites

Hi

 

some issues:

- can't add products to cart with CHEMO's urls: the product ID is not appended in the url.

- set the feed limit to 20, but 80 are showing up.

- some products have images, other don't.

 

was a cache problem for the number of products and images.

 

The only thing not working for me is the add to cart button, I get the following error (whether ultimate SEO url is on or off)

 

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 '' at line 1

select products_price from products where products_id = 

[TEP STOP]

 

the products_id is not retrieved by the query???

Link to comment
Share on other sites

good contribution!

 

Quick bug:

 

1) i added 1 item 10 mins ago, but it showing like 15 hours ago for that item on the rss list!?

 

2) click on the green arrow next to the "15 hours ago", the product link is not valid "Product not found. Please try again with another search keywords."

 

clue?

Edited by chee
Link to comment
Share on other sites

Just wondering, why this piece of code is needed?

 

The code places a line like:

<link rel="alternate" type="application/rss+xml" title="Myshop.com - Catalogus Feed" href="http://myshop.com/rss.php?language=en">

 

within the head of your webshop's pages containing the code. As soon as RSS supporting browsers like IE7 and Firefox read such a line in a page header, they notify a visitor of your website that there's a RSS feed available to them. The notification itself is usually done via an orange RSS icon which shows up (Firefox) or starts to glow (IE7).

 

Since the notification is only activated if a page contains the code in its head, it's recommandable to place the php code in all the pages (with a head tag!) located within your catalog folder. Since the pages located in your catalog folder can be seen by visitors.

 

So, if you want to maximize the change of visitors noticing your shop's RSS feed, it's recommandable to use the code. But you don't have to.

Link to comment
Share on other sites

was a cache problem for the number of products and images.

 

The only thing not working for me is the add to cart button, I get the following error (whether ultimate SEO url is on or off)

 

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 '' at line 1

select products_price from products where products_id = 

[TEP STOP]

 

the products_id is not retrieved by the query???

 

I'm glad you solved the first problem.

 

I'm just wondering; are you using the rss.php file as inluded with the v1.0 package or did you only update the rss.php which you were already using?

 

You see, I noticed "products_price" within your error. While all references to the products_price, $price etc are actually removed since v1.0.

 

Possible solution: try it with the original v1.0 rss.php. I hope that that'll solve your last problem.

Link to comment
Share on other sites

good contribution!

 

Quick bug:

 

1) i added 1 item 10 mins ago, but it showing like 15 hours ago for that item on the rss list!?

 

2) click on the green arrow next to the "15 hours ago", the product link is not valid "Product not found. Please try again with another search keywords."

 

clue?

 

It looks like the feed is pulling the time / data from a wrong or possibly deleted database record.

 

I've a few questions for you:

 

1 - Are you using an updated version of your old rss.php? Is so, try the original rss.php as included with v1.0.

 

2 - Green arrow... I suppose you're using IE7. If you hold the mouse cursor over the green arrow, does the URL / link which shows up at the bottom of your browser look something like:

 

http://yourwebshop.com/product_info.php?products_id=93

 

If not, could you please show me the URL / link which your browser comes up with when holding the cursor over the green arrow?

 

3 - Is the product still in your database or did you remove it? If the message you stated is displayed on the product_info.php, which pretty much means the green arrow link itself is working fine, you might want to verify this. I'm asking this because IE7 displays removed products as old articles in the feed, until they are pushed away by new products / articles. This means that when you click on such an old feed article, your shop's database can't find the product which leads to the message being displayed on product_info.php.

 

In order to get an up to date feed in IE7, you have to unsubscribe from your shop's feed and reload the feed without being subscribed to it. That way you'll prevent deleted products from being displayed as old (and thus not working) articles in your feed. If the links work correctly after you did that, then your feed is working fine.

Link to comment
Share on other sites

I've just installed this and when I click on the feed button it takes me to a page with a pulldown menu showing "Live Bookmarks" (I'm using Firefox), a mysterious looking checkbox and a "Subscribe now" button. Clicking the Subscribe button does nothing, whether the checkbox is clicked or not. Any ideas?

 

I'm running this locally on my computer at the moment, so I don't know if that has any bearing on the issue but naturally I'm nervous about uploading anything to the real site until I know it's all working properly.

Link to comment
Share on other sites

I've updated and can not get it working.

 

in IE7, all I see is a nessage saying this feed contains errors, with this for details: "The following tags were not closed: rss, channel.

Line: 0 Character: 0"

 

in FF, I see a page with the subscribe box, but just my store name title and thats it.

 

I also just noticed that the SQL addition is not appearing in my Configuration -> Maximum Values. I did run it with success reported and did not get an error...

 

any ideas?

Edited by Roaddoctor

-Dave

Link to comment
Share on other sites

I've updated and can not get it working.

 

in IE7, all I see is a nessage saying this feed contains errors, with this for details: "The following tags were not closed: rss, channel.

Line: 0 Character: 0"

 

in FF, I see a page with the subscribe box, but just my store name title and thats it.

 

I also just noticed that the SQL addition is not appearing in my Configuration -> Maximum Values. I did run it with success reported and did not get an error...

 

any ideas?

 

Did a merge of new to old file and got it working. Seems the sql file is not doing what it should for me. So I worked around that by keeping quantity of items listed as MAX_DISPLAY_SEARCH_RESULTS and all is well. Great look to the feed and much improved. Thanks!!

-Dave

Link to comment
Share on other sites

Great contribution.. I thought I had it all working good, but had problem reported and verified it. The feed works fine in Firefox, but if I (or anybody else) try the link or button in IE 7, it gives an error.. 'Internet Explorer can not display this feed.. this feed contains errors'. Works great in Firefox tho. Any ideas??

Link to comment
Share on other sites

Great contribution.. I thought I had it all working good, but had problem reported and verified it. The feed works fine in Firefox, but if I (or anybody else) try the link or button in IE 7, it gives an error.. 'Internet Explorer can not display this feed.. this feed contains errors'. Works great in Firefox tho. Any ideas??

 

I did a careful merge of the new rss to the old rss file, making a few tweaks to match my stores environment and got it working in both FF and IE7.

 

I do not have $price working yet, and could use some help with that, but the rest works well.

 

It will work fine with a little tweaking. I can send/post my revised version if it would help.

Edited by Roaddoctor

-Dave

Link to comment
Share on other sites

I did a careful merge of the new rss to the old rss file, making a few tweaks to match my stores environment and got it working in both FF and IE7.

 

I do not have $price working yet, and could use some help with that, but the rest works well.

 

It will work fine with a little tweaking. I can send/post my revised version if it would help.

 

Thanks, I finally got it working, it was some characters in the listings that IE couldn't handle for some reason. Under more information it kept giving me line and character references for character errors, so I changed the product listings and tags in HTC until it accepted them. It may have been " symbols.

Link to comment
Share on other sites

1 - Are you using an updated version of your old rss.php? Is so, try the original rss.php as included with v1.0.

 

I am using your version of rss.php

 

2 - Green arrow... I suppose you're using IE7. If you hold the mouse cursor over the green arrow, does the URL / link which shows up at the bottom of your browser look something like:

 

http://yourwebshop.com/product_info.php?products_id=93

 

If not, could you please show me the URL / link which your browser comes up with when holding the cursor over the green arrow?

Yes showing correct and the product is not disabled, very strange ...

 

3 - Is the product still in your database or did you remove it? If the message you stated is displayed on the product_info.php, which pretty much means the green arrow link itself is working fine, you might want to verify this. I'm asking this because IE7 displays removed products as old articles in the feed, until they are pushed away by new products / articles. This means that when you click on such an old feed article, your shop's database can't find the product which leads to the message being displayed on product_info.php.

 

In order to get an up to date feed in IE7, you have to unsubscribe from your shop's feed and reload the feed without being subscribed to it. That way you'll prevent deleted products from being displayed as old (and thus not working) articles in your feed. If the links work correctly after you did that, then your feed is working fine.

Link to comment
Share on other sites

1 - Are you using an updated version of your old rss.php? Is so, try the original rss.php as included with v1.0.

 

I am using your version of rss.php

 

2 - Green arrow... I suppose you're using IE7. If you hold the mouse cursor over the green arrow, does the URL / link which shows up at the bottom of your browser look something like:

 

http://yourwebshop.com/product_info.php?products_id=93

 

If not, could you please show me the URL / link which your browser comes up with when holding the cursor over the green arrow?

Yes showing correct and the product is not disabled, very strange ...

 

That's indeed a bit strange. Well, I guess you've already tried the unsubscribe thing and that that didn't solve the problem either.'

 

Did you try an older version of this contribution? Because if an older version works then at least we can be sure that your problem is version related.

 

I'll keep an eye on this thread...

Link to comment
Share on other sites

That's indeed a bit strange. Well, I guess you've already tried the unsubscribe thing and that that didn't solve the problem either.'

 

Did you try an older version of this contribution? Because if an older version works then at least we can be sure that your problem is version related.

 

I'll keep an eye on this thread...

 

i reverted all back to old version, it is still same! both "xxx hours ago" and "link issue"! :angry:

Link to comment
Share on other sites

i reverted all back to old version, it is still same! both "xxx hours ago" and "link issue"! :angry:

 

Ok, at least we now know for sure that the problem isn't version related. I still think it has something to do with the database / sql... maybe you can check whether the sql parts in rss.php are calling the correct tables.

 

I'm very sorry, but at this point I don't know of any other possible solutions. Maybe you can give me a link to your site? Because I might get some new ideas when I see it for myself.

Link to comment
Share on other sites

Ok, at least we now know for sure that the problem isn't version related. I still think it has something to do with the database / sql... maybe you can check whether the sql parts in rss.php are calling the correct tables.

 

I'm very sorry, but at this point I don't know of any other possible solutions. Maybe you can give me a link to your site? Because I might get some new ideas when I see it for myself.

 

ok very strange that this few days i install it again and again. The product link seems some are okay and some are not ... no idea ...

 

The time issue still the same though. Products updated 1 hour ago it will show 10+ hours before ... it seems to me it has something to do with the time-zone difference? Is the coding based on timezone setting!?

 

Thanks!

Link to comment
Share on other sites

Is the coding based on timezone setting!?

 

That there could be something wrong with the time setting, did cross my mind too. But I reasoned that such a problem woudn't effect the functioning of the links. But who knows, maybe it does in some way.

 

So, you might want to focus on:

 

$added = date(r,strtotime($row['products_date_added']));

 

And maybe on:

 

<lastBuildDate><?php echo date(r); ?></lastBuildDate>

 

The first line obviously formats and outputs the "product's added to the shop on" date. The second is pretty obvious too, as it outputs the build date of your feed.

 

Before you're going to make any modifications to these lines of code, I would like to suggest that you first verify whether the dates within your feed are indeed incorrect. To do that, just go to your feed with (I guess) IE7 and check the source of your feed. I suspect you know how to check the source of a website which is displayed by IE. In case someone doesn't know: right click on the website / feed and click on "View source".

 

Once the source of your feed is being displayed, check whether the dates are correct for your timezone. For example; I'm in the GMT +01:00 timezone, which makes the dates in the source look like:

 

generated on Thu, 22 Mar 2007 10:03:53 +0100 (the date at which the feed was build for that last time)

 

and:

 

<pubDate>Sun, 28 Jan 2007 22:21:29 +0100</pubDate> (the date at which a product was added to the feed/shop)

 

Notice the +0100 at the end of both dates, this shows that the dates within my feed are correct for the GMT +01:00 timezone. If your timezone and the +0100 part of your feed's dates do not match, then you can be quite sure that your feed is indeed experiencing timezone issues.

 

This is quite possible since with some PHP versions the time code of rss.php (strtotime and possibly date( r)) functions incorrectly.

 

Since I don't know whether your feed displays an incorrect build date, I'll focus on the "product added" date.

 

Find:

 

$added = date(r,strtotime($row['products_date_added']));

 

Replace with:

 

$added = $row['products_date_added'];

 

If your feed's dates are indeed incorrect because of strtotime, then the above suggestion might solve the problem. The only disadvantage is that your feed's dates will no longer validate as proper rss 2.0, but it should be working fine. In fact, the original script uses the same code, though it'll validate with the original script since it ouputs a feed based on an older rss version.

 

I hope this helps.

Link to comment
Share on other sites

thanks for the details solution.

 

1) after checking, the GMT setting is correct, in my case +8GMT

2)

 

original one showing +18 hours ago

with $added = $row['products_date_added'];

it changes to +10 hours ago.

 

Both are wrong as the item i just added it 3 hours ago ... :blush:

Link to comment
Share on other sites

thanks for the details solution.

 

1) after checking, the GMT setting is correct, in my case +8GMT

2)

 

original one showing +18 hours ago

with $added = $row['products_date_added'];

it changes to +10 hours ago.

 

Both are wrong as the item i just added it 3 hours ago ... :blush:

 

Since the timezone is correct in your feed's source, I think that the timezone of your database or server is incorrect. This causes the feed to display the incorrect time for each article, despite the fact that your feed is using the correct timezone. It's just a matter of a wrong input (e.g. database time) which results in a wrong output (e.g. feed time).

 

Anyway, I've just tried something which might correct the incorrect dates of your feed. You can set the timezone for rss.php with a little bit of php. But first I would like to advice you to change:

 

$added = $row['products_date_added'];

 

Back to:

 

$link = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $id, 'NONSSL', false);

 

So your feed is rss 2.0 valid again.

 

After that you need to find the following in rss.php:

 

$navigation->remove_current_page();

 

Replace it with:

 

$navigation->remove_current_page();

putenv("TZ=US/Eastern");

 

Notice that in the above code the TZ (timezone) is US/Eastern. I've tried this piece of code myself with rss.php and it does indeed change the timezone.

 

The only thing you've to do is to replace US/Eastern with a +8GMT timezone, e.g.: Asia/Hong_Kong.

 

If the time is still incorrect, then try some other timezones until you've found one which sets the correct time in your feed. Oh, and make sure you're using the proper timzone formats, otherwise the code won't work properly.

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