Fetching products with discount

Author Message

Nicolas OTTAVI

Friday 06 January 2006 2:36:21 am

Hi there,

In order to display in a specific toolbar products with have a discount I looking a way to fetch products with a discount. How would you do this ?

Thanks for your help,
C.

Mads Ovesen

Friday 06 January 2006 6:02:49 am

Maybe the most easy way to do this, is to fetch all products that has a price with discount. $object.data_map.price.has_discount returns true if the price (and product) has a discount and false otherwise.

/m

Nicolas OTTAVI

Friday 06 January 2006 6:43:12 am

Hi Mads,

This is how I did (this doesn't look nice to me ...)

I do a fetch on all the products.
Then I do a foreach and display only if data_map.price.content.has_discount ...

That's not fine. The best would be to do a fetch with an extended filter I think. I will try to do so. I will keep you updated.

Thanks,
C.

H-Works Agency

Thursday 14 June 2007 4:50:34 am

Did you find a way to do this with "extended_filter" ?

Thanx

EZP is Great

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:30:23
Script start
Timing: Jan 18 2025 11:30:23
Module start 'layout'
Timing: Jan 18 2025 11:30:23
Module start 'content'
Timing: Jan 18 2025 11:30:24
Module end 'content'
Timing: Jan 18 2025 11:30:24
Script end

Main resources:

Total runtime0.9616 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9141152.6250
Module start 'layout' 0.00540.0033 740.539139.4609
Module start 'content' 0.00870.9509 780.0000573.2734
Module end 'content' 0.95960.0019 1,353.273412.4766
Script end 0.9616  1,365.7500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.3894160.0002
Check MTime0.00140.1468160.0001
Mysql Total
Database connection0.00070.072510.0007
Mysqli_queries0.913194.9542620.0147
Looping result0.00060.0616600.0000
Template Total0.927296.420.4636
Template load0.00220.229820.0011
Template processing0.925096.195320.4625
Template load and register function0.00020.025610.0002
states
state_id_array0.00130.136910.0013
state_identifier_array0.00150.155420.0007
Override
Cache load0.00190.1932210.0001
Sytem overhead
Fetch class attribute can translate value0.00050.055230.0002
Fetch class attribute name0.00090.088950.0002
XML
Image XML parsing0.00070.075430.0002
class_abstraction
Instantiating content class attribute0.00000.000950.0000
General
dbfile0.00080.0841170.0000
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs