You are here:  » Is there any way to import products and prices separately?

Support Forum



Is there any way to import products and prices separately?

Submitted by kempo on Thu, 2010-12-16 12:41 in

Hi David,
I have 2 kinds of feeds which I cannot implemeted a way to import them. One of the feed contains more than 300.000 hotels which contains hotelID, hotelname, description, address, facilites etc. and this file contains no price information. And the size of the file is around 1GB. Second file contains hotelID, merchant, and price information and the size of this file is 80MB. So, the best way is importing the hotels to database as persistent and importing the second file in everyday for price update. But as far as I know PT always deletes all the products and reimports them.
And there is another problem about the currency: The price feed contains different currencies for different hotels. I mean USD for a hotel in USA and EUR for a hotel in EUROPE.
David why don't you release a script as PriceTapestry for Hotel Price Comparison? I think it sells very well...
Thanks in advance...
Kempo.

Submitted by support on Thu, 2010-12-16 13:36

Hi Kempo,

Because of the vast size of data available, plus the array of different availability and rate information affiliate travel comparison tends to be done by way of real-time APIs, and the big providers (e.g. IAN and Expedia) provide affiliates with dynamic content units that enable you to query hotel and flight information in real time.

That's not to say it's not worth backing that up with content from static hotel data for example, which would be a less complex script; with the "Check prices and availability" links etc. being those provided by the affiliate network / program specifically for that purpose. You could for example just import the hotels feed (not prices) into Price Tapestry with a little modification to the import routine, e.g. making the price a non-required field. To do this, in admin/feeds_register_step2.php, look for the following code at line 35:

    widget_required("field_price");

...and either comment out or delete that line.

Next, in includes/admin.php first at line 28:

      return "price field missing";

Again, either comment out or delete that line, and then finally look for the following code beginning at line 268:

    /* check product record for minimum required fields */
    if (!$importRecord["name"] || !$importRecord["buy_url"] || !$importRecord["price"]) return;

...and replace that with just:

    /* check product record for minimum required fields */
    if (!$importRecord["name"] || !$importRecord["buy_url"]) return;

That will enable you to register and import feeds without a price, but of course modifications to the template would then be required to accommodate the lack of price - this could be as simple as removing all references to price within html/searchresults.php, html/product.php and html/prices.php (remove price column header at line 6, and price column itself at line 13) - let me know if you'd like to try this and not sure about any of the visual changes - lots of flexibility of course!

Either way thanks for your comments - I'll bear it in mind as I agree a "Travel Remix" would be popular!

Cheers,
David.
--
PriceTapestry.com