You are here:  » Skip 0.00 items


Skip 0.00 items

Submitted by ccgale on Fri, 2013-08-16 16:23 in

Hi

Had a search around the forum for this, I'm sure I came across a modified file the other day to do what I'm after, but for the life of me, I cannot find it again.

What is the easiest way to skip products if the price is 0.00? My site already has a pricing message but 0.00 products make the site look unprofessional more than anything

Thanks
Carl

Submitted by support on Fri, 2013-08-16 16:35

Hi Carl,

A price field can end up as 0.00 if it is empty, actually contains "0.00", or doesn't parse to a valid price by the decimalise function.

The best way to handle this without separately accounting for each different condition would be to move the decimalisation process prior to filters being applied. To do this, in includes/admin.php look for the following code at line 326:

    /* decimalise price */
    $importRecord["price"] = tapestry_decimalise($importRecord["price"]);

CUT the code from this point, and PASTE it back into the same file above the following comment at line 218:

    /* apply user filters */

With that in place, go to Global Filters (/admin/ menu) and add a new Drop Record filter to the Price field, and in the text box on the configuration page for the filter enter "0.00" (without the quotes) and that will drop all zero prices however they occur.

Cheers,
David.
--
PriceTapestry.com

Submitted by sirmanu on Fri, 2017-03-03 15:00

Hi. I have a few pages with 0 products. Mostly gifs buying other items.
What it is best to remove them
This method, or as pointed in node 2890?

  $importRecord["price"] = tapestry_decimalise($importRecord["price"]);
  if ($importRecord["price"] == "0.00") return;

Submitted by support on Fri, 2017-03-03 15:35

Hi,

Use the node 2890 method, so for 15/09A and later, edit includes/admin.php and look for the following code at line 466:

    $importRecord["price"] = tapestry_decimalise($importRecord["price"]);

...and REPLACE with:

    $importRecord["price"] = tapestry_decimalise($importRecord["price"]);
    if ($importRecord["price"] == "0.00") return;

Cheers,
David.
--
PriceTapestry.com