You are here:  » import_slow.php


import_slow.php

Submitted by karakartal on Fri, 2011-07-01 15:59 in

David,

I am using the following command to automatically import my feeds. There is a problem with using @MODIFIED this way. I have multiple feed files per merchant. When I use this command to import my feeds I had the impression that everytime the function is called it empties the products belonging to that merchant (As opposed to the feed file) in the database. Thus, when the entire operation is completed I only have products from the last feed processed. Could there be some glitch somewhere in the code?

wget --max-redirect=9999 -O /dev/null http://www.walletbuddy.com/scripts/import_slow.php?filename=@MODIFIED

Submitted by support on Fri, 2011-07-01 16:23

Hello karakartal,

You are absolutely correct scripts/import_slow.php is deleting by `merchant` and not `filename`.

To fix this, look for the following code at line 23:

    $sql = "DELETE FROM `".$config_databaseTablePrefix."products` WHERE merchant='".database_safe($admin_importFeed["merchant"])."'";

...and REPLACE with:

    $sql = "DELETE FROM `".$config_databaseTablePrefix."products` WHERE filename ='".database_safe($admin_importFeed["filename"])."'";

Cheers,
David.
--
PriceTapestry.com

Submitted by karakartal on Fri, 2011-07-01 16:51

Thanks so much.

Submitted by mally on Sat, 2011-07-02 11:28

Hi David, ref the code to cron slow_import.php, I get this error, can you assist?

/usr/bin/wget: unrecognized option `--max-redirect=9999'
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

Submitted by support on Sat, 2011-07-02 12:14

Hi Mally,

It does seem that --max-redirect isn't widely supported; as an alternative have a go with

  --tries=0

...but it's unclear if this applies to redirects, unfortunately i'm mobile at the moment so can't test easily, I will do later but in either case the hard coded limit seems to be 20, so one thing to do is to make sure that $config_slowImportBlock (config.advanced.php) is set to approximately the total number of products on your site divided by 19 and that should let the process complete - perhaps in conjunction with a larger $config_slowImportSleep also...

Hope this helps!

Cheers,
David.
--
PriceTapestry.com