Jump to content

Ralph2

Members
  • Content count

    29
  • Joined

  • Last visited

Profile Information

  • Real Name
    Ralph

Recent Profile Visitors

10,802 profile views
  1. I fixed RSS Feed v2.0ecommerce, but it does not work in STS. I want to know the reason and solution. Help me, could you reply me or sent me an email rs2manager@gmail.com. Thanks!

  2. Sure, just open catalog/admin/includes/languages/english/categories.php and find: define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:'); Add under it: define('TEXT_PRODUCTS_RSS', 'Add this product to the RSS feed:'); Regarding the unchecked products, verify whether an unchecked / checked checkbox stays unchecked / checked after you've updated / saved the settings of a product. If the checkbox "remembers" its last setting, then your DB and the catalog\admin\categories.php file are working correctly. In that case you might want to try to replace the following (in rss.php): $sql = 'SELECT p.products_id, products_model, products_image, products_date_added FROM products p, products_to_categories pc WHERE p.products_id = pc.products_id AND pc.categories_id = \'' . $category . '\' AND products_status=1 ORDER BY RAND() DESC LIMIT ' . MAX_RSS_ARTICLES; } else { $sql = 'SELECT products_id, products_model, products_image, products_date_added FROM products WHERE products_status=1 ORDER BY RAND() DESC LIMIT ' . MAX_RSS_ARTICLES; } With: $sql = 'SELECT p.products_id, products_model, products_image, products_date_added FROM products p, products_to_categories pc WHERE p.products_id = pc.products_id AND pc.categories_id = \'' . $category . '\' AND products_status=1 AND products_to_rss=1 ORDER BY RAND() DESC LIMIT ' . MAX_RSS_ARTICLES; } else { $sql = 'SELECT products_id, products_model, products_image, products_date_added FROM products WHERE products_status=1 AND products_to_rss=1 ORDER BY RAND() DESC LIMIT ' . MAX_RSS_ARTICLES; Success!
  3. Hey, I checked your feed output with a validator and it says the following: This feed is valid, but may cause problems for some users. We recommend fixing these problems. Don't worry, it works fine. I wouldn't bother to dive into the code for this. I've seen big websites with the same validator result. About the '&' symbol, if you don't like using 'and' then try to use: & Maybe the validator takes it.
  4. You're welcome. I'm glad it works :thumbsup:
  5. @ David: Via a .htaccess rewrite: didn't work. Via a SEO contribution (e.g. Ultimate SEO URLs): should be possible, but I don't have the time to figure out how. With some php: works, though it doesn't come up with a .html URL (like Ultimate SEO URLs does for example). But it does get rid of the "?language=en" part and it's very easy to implement. I don't have the time to work it out completely, but the following should get you started (and it looks like it's working fine): Open catalog/includes/filenames.php and add the following code to it (for each language): define('FILENAME_RSS_EN', 'rss-english.php'); Then rename / copy rss.php to rss-english.php (repeat this step for each language). Open for example catalog/index.php, go to the link rel code and replace: <?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 FILENAME_RSS, '?language=' . $key; ?>"> <?php } ?> With: <?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)) { if ($key == 'en') { $rss_link = FILENAME_RSS_EN ?> <link rel="alternate" type="application/rss+xml" title="<?php echo STORE_NAME . ' - ' . BOX_INFORMATION_RSS; ?>" href="<?php echo $rss_link; ?>"> <?php } } ?> Now the browser RSS icon should be linking to an URL which looks like: http://www.kjhsdflskdflsjkdf.com/rss-english.php. The only thing you've to do is to get it working with multiple languages and the info box link. Good luck :) @ Michael: Good luck :)
  6. @ Michael (mkelly1) I'm glad that random products works correct :D Nope, if you've updated your DB and the files correctly, then it should work. I'm not using an English shop, so I'm not really sure about the names of the settings. But you'll get an idea of where to look: Just go to your admin section -> Catalog -> Articles -> and edit or add an article. On the edit/add article page there should be a checkbox (Add this product to the RSS feed:) under the 'weight' textfield. It's that bit of code above the </head> tag within your php files of the catalog directory. The code that makes browsers light up or show their RSS icon. You need to change all of the files which contain the old code. Look for the files with the following bit of code in them: <link rel="alternate" type="application/rss+xml" title=" Oh, I think you've made a copy/paste mistake. No problem, according to Roaddoctor the code wasn't working correctly anyway. Just read my answer to Roaddoctor for the correct code. @ David (Roaddoctor) At least the link rel is working correct now :thumbsup: The new info box problem is probably caused because its whole code is now within the code of the language code. And the lang. code makes as many links as there are languages, which is now happening to the whole info box. Anyway, I've some new code for the info box which automatically selects the current language as selected by the user. Start with a 'fresh' information.php file and follow the following steps: Find: ?> <!-- information //--> Replace with: // Recover the code (en, fr, etc) of the current language if ($HTTP_GET_VARS['language'] == '') { $lang_query = tep_db_query('select code from ' . TABLE_LANGUAGES . ' where directory = \'' . $language . '\''); } else { $cur_language = tep_db_output($HTTP_GET_VARS['language']); $lang_query = tep_db_query('select code from ' . TABLE_LANGUAGES . ' where code = \'' . $cur_language . '\''); } $lang_a = tep_db_fetch_array($lang_query); $lang_code = $lang_a['code']; ?> <!-- information //--> Find: '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>'); Replace with: '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a><br>' . '<a href="' . FILENAME_RSS . '?language=' . $lang_code . '">' . BOX_INFORMATION_RSS . '</a>'); Despite the fact that I believe that this code works fine, could you please let me know whether that's also the case with a multi language shop? Thanks in advance :thumbsup: BTW, could you / someone please check whether the footer link works correctly with multiple languages? It should display 1 RSS icon (with a link based on the selected language) in the footer, but I've a feeling it'll display 1 RSS icon for each available language. If the code from the installation guide (@ step 7) indeed causes multiple icons to appear in the footer, you might try the following code: Open a 'fresh' catalog/includes/footer.php file and find: require(DIR_WS_INCLUDES . 'counter.php'); Replace with: require(DIR_WS_INCLUDES . 'counter.php'); if ($HTTP_GET_VARS['language'] == '') { $lang_query = tep_db_query('select code from ' . TABLE_LANGUAGES . ' where directory = \'' . $language . '\''); } else { $cur_language = tep_db_output($HTTP_GET_VARS['language']); $lang_query = tep_db_query('select code from ' . TABLE_LANGUAGES . ' where code = \'' . $cur_language . '\''); } $lang_a = tep_db_fetch_array($lang_query); $lang_code = $lang_a['code']; Find: <td class="footer"> <?php echo strftime(DATE_FORMAT_LONG); ?> </td> <td align="right" class="footer"> <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?> </td> Replace with: <td class="footer"> <?php echo strftime(DATE_FORMAT_LONG); ?> </td> <td align="center" class="footer"><a href="<?php echo FILENAME_RSS, '?language=' . $lang_code; ?>" title="<?php echo BOX_INFORMATION_RSS; ?>"><?php echo tep_image(DIR_WS_IMAGES . "icons/rss_icon.jpg" , STORE_NAME . " - " . BOX_INFORMATION_RSS); ?></a></td> <td align="right" class="footer"> <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?> </td> It would be really great if someone can verify whether this piece of code works correctly with a multi language shop! If the code works correct, then I can update the contribution knowing that it works correctly in combination with multi language shops. Thanks in advance!
  7. Solutions: Random products: Find (in rss.php): $sql = 'SELECT p.products_id, products_model, products_image, products_date_added FROM products p, products_to_categories pc WHERE p.products_id = pc.products_id AND pc.categories_id = \'' . $category . '\' AND products_status=1 ORDER BY products_id DESC LIMIT ' . MAX_RSS_ARTICLES; } else { $sql = 'SELECT products_id, products_model, products_image, products_date_added FROM products WHERE products_status=1 ORDER BY products_id DESC LIMIT ' . MAX_RSS_ARTICLES; } Replace with: $sql = 'SELECT p.products_id, products_model, products_image, products_date_added FROM products p, products_to_categories pc WHERE p.products_id = pc.products_id AND pc.categories_id = \'' . $category . '\' AND products_status=1 ORDER BY RAND() DESC LIMIT ' . MAX_RSS_ARTICLES; } else { $sql = 'SELECT products_id, products_model, products_image, products_date_added FROM products WHERE products_status=1 ORDER BY RAND() DESC LIMIT ' . MAX_RSS_ARTICLES; } Add or remove products from a feed: Please, check out v1.2. NOTE: In case you've already ran adminsetting.sql, your DB might not accept adminsettings.sql because of duplicate data. In that case you can run the following sql in your DB: ALTER TABLE products ADD products_to_rss TINYINT default '1' NOT NULL Problematic link rel: Replace the following: <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); ?>"> With: <link rel="alternate" type="application/rss+xml" title="<?php echo STORE_NAME . ' - ' . BOX_INFORMATION_RSS; ?>" href="<?php echo FILENAME_RSS, '?language=' . $key; ?>"> The tep_href_link function might be the cause of the problematic link rel, I removed it and it seems to work fine. Please note that I can't test it on a shop with multiple languages, since my shop utilizes only 1 language. Could you / someone please let me know whether the link rel works correctly with multiple languages now? Thanks! Information box link: Open catalog/includes/boxes/information.php file: Find: ?> <!-- information //--> Replace with: 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)) { ?> <!-- information //--> Find: $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' . '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' . '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' . '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>'); Replace with: $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' . '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' . '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' . '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a><br>' . '<a href="' . FILENAME_RSS . '?language=' . $key . '">' . BOX_INFORMATION_RSS . '</a>'); Find: new infoBox($info_box_contents); Replace with: new infoBox($info_box_contents); } The info box link appears to be working fine with a 1 language shop. Could you / someone please let me know whether the info box link works correctly with multiple languages now? Thanks! Many thanks to all of you for your patience :thumbsup:
  8. Ok, time for a new round of advice :) @ mkelly1: I'm sorry, but I didn't have the time to work out something regarding the randomization of the feed. But I'll check it out as promised. Nice looking shop by the way. Anyway, tomorrow I'll add a new feature to the contribution, which will give the admin the possibility to decicde whether or not a certain product should be added to the feed simply by checking or unchecking a checkbox. Tomorrow I'll look for a solution. Regarding the info box issue: that particular link is build in an array, which makes it impossible to add the code needed for the verification of the languages. There are 2 solutions for this problem: 1 - Each language gets its own link. 2 (this'll look better) - Take the link out of the array and build it in a similar way as the footer link.
  9. Ah, that should be possible. I'll try it this week. I'll keep you posted.
  10. Hello people, I see it's getting busy here :) Sorry for my late reply, but I didn't have the time to get back here sooner. My answers to your questions: Just follow effisk's advice (Post: #35), and you'll solve the problem. Another solution: Open the file adminsetting.sql and look for '80', just gradually increase this number (and run the SQL again after each increase) until your DB takes it. Each time you add new products to your shop, these will be automatically added to your feed. So, the feed updates automatically. It should be possible to hard code something like that in rss.php. But in the end it's the user's feed reader which sorts everything out based on the user's settings. Maybe there're feed readers out there which make it possible to randomize feeds. I know for sure that some feed readers can filter on categories, IE7's feed reader can do that for example. In order to make it possible for feed readers to filter products on categories, I just updated the contribution: contribution
  11. 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.
  12. 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.
  13. 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.
  14. 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...
  15. 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.
×