You are here:  » Feeds without prices

Support Forum



Feeds without prices

Submitted by wdekreij on Sun, 2006-12-17 18:00 in

Hi,

I have some feeds without prices.. But I can't import these (if there isn't a "price-column" I get an error with importing, when there is a price-column all the products without a price will not be imported).

How can I make this work? How can I create something that every product without price will get a "unknown-price", but it IS imported? And if that isn't possible, then just a feature that every product without price will be priced for 0,00 or such..

Thanks in advance,

Wilco de Kreij

Submitted by support on Sun, 2006-12-17 18:50

Hi Wilco,

2 small modifications will be required to do this.

Firstly, in admin/feeds_register_step2.php, comment out or delete the following code on line 33:

widget_required("fieldPrice");

This will make the price an optional field.

Secondly, in includes/admin.php, look for the following code in the admin__importRecordHandler() function (lines 153/154):

    /* check product record for minimum required fields */
    if (!$record[$admin_importFeed["field_name"]] || !$record[$admin_importFeed["field_buy_url"]] || !$record[$admin_importFeed["field_price"]]) return;

Change this as follows to remove the check against the price field:

    /* check product record for minimum required fields */
    if (!$record[$admin_importFeed["field_name"]] || !$record[$admin_importFeed["field_buy_url"]]) return;

That should do the trick...
Cheers,
David.

Submitted by wdekreij on Sun, 2006-12-17 22:45

Thnx david,

The feeds with an empty price column do work!

However, I can't get the feeds without any price column working. The error is gone, but it won't register either..

Submitted by support on Mon, 2006-12-18 09:32

Sorry Wilco,

There's one more mod required...! In includes/admin.php in the admin_register() function (right at the top of the script) you need to remove the following code (starting at line 32):

    if (!$fieldPrice)
    {
      return "fieldPrice missing";
    }

You will then be able to register feeds without a price field, and because of the data type in the database they will be imported with a zero price...

Cheers,
David.