You are here:  » default images and 0.00 price

Support Forum



default images and 0.00 price

Submitted by enrique on Mon, 2009-03-02 20:49 in

Hi i would like to put a default image if is empty
and hide all the products with 0.00 price,
i try with a script that I read (with amazon.....) but not works :(

can you help me?

Submitted by support on Tue, 2009-03-03 11:14

Hello Enrique,

The easiest way to hide product with 0.00 price is not to import them. To do this, in includes/admin.php you will find this code on line 168:

$record[$admin_importFeed["field_price"]] = tapestry_decimalise($record[$admin_importFeed["field_price"]]);

...to make it not import the product if the price is zero, REPLACE that with:

$record[$admin_importFeed["field_price"]] = tapestry_decimalise($record[$admin_importFeed["field_price"]]);
if ($record[$admin_importFeed["field_price"]] == 0) return;

To make a default image show where there is no image from the feed, one way is to change everywhere that displays the image and make it use a default image, but it will be easier to, like above, do it at import time. To do this, on line 275 you will find:

database_safe(isset($record[$admin_importFeed["field_image_url"]])?$record[$admin_importFeed["field_image_url"]]:""),

...simply REPLACE this with:

database_safe(isset($record[$admin_importFeed["field_image_url"]])?$record[$admin_importFeed["field_image_url"]]:"/images/noimage.gif"),

...where /images/noimage.gif is the relative URL of your "no image" picture...

Cheers,
David.

Submitted by enrique on Tue, 2009-03-03 13:52

thx! :)

Submitted by Bakalinge on Thu, 2011-11-03 11:22

Hello,

Sorry to pull this post up, but is this information still active . I can't find this code line 275...

Thanks

Submitted by support on Thu, 2011-11-03 11:45

Hi,

Instead of the above method (as the import process has changed in more recent distributions) look for the following code at line 342 of includes/admin.php

    if (!$importRecord["merchant"]) return;

...and REPLACE with:

    if (!$importRecord["merchant"]) return;
    if (!$importRecord["image_url"]) $importRecord["image_url"] = $config_baseHREF."images/noimage.gif";

Cheers,
David.
--
PriceTapestry.com

Submitted by Bakalinge on Thu, 2011-11-03 12:02

Thanks David !