Results 1 to 6 of 6

Thread: Coupon Display/Query Error

  1. #1
    Thread Starter
    Amateur leedharis's Avatar
    Join Date
    Aug 2011
    Location
    United States
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Coupon Display/Query Error

    Under the "coupon categories" page [tpl-coupon-cats.php] there is a count next to the categories link; when such a link is selected you are taken to the page for that category [taxonomy-coupon_category.php] which has two sections labeled "Active Coupons" and "Unreliable Coupons" both of which are empty.

    Inside the [taxonomy-coupon_category.php] page the function for retrieving the Active Coupons is as follows:
    PHP Code:
                        query_posts(array(
                                
    'post_type' => APP_POST_TYPE,
                                
    APP_TAX_CAT => $term->slug,
                                
    'caller_get_posts' => 1,
                                
    'paged' => $paged,
                                
    'not_expired_coupons' => true,
                                
    'meta_query' => array(
                                                                
    'relation' => 'OR',

                                                                
    // Get rid of low success
                                                                
    array(
                                                                        
    'key' => 'clpr_votes_percent',
                                                                        
    'value' => array( 050 ),
                                                                        
    'compare' => 'NOT BETWEEN',
                                                                        
    'type' => 'numeric',
                                                                ),

                                                                
    // 0% Coupons with no votes are new coupons
                                                                
    array(
                                                                        
    'key' => 'clpr_votes_down',
                                                                        
    'value' => array(0,0),
                                                                        
    'compare' => 'BETWEEN',
                                                                        
    'type' => 'numeric'
                                                                
    )
                                                            )
                        )); 
    This should return the coupons which are either at 0% w/ no down-votes OR between (50,100], which we can call the expected-set, but for some reason it does not and instead returns nothing. {We have a few coupons with a single up-vote (and therefore at 100%) that we are testing; that vote is from the admin if that is of any import.}

    When the above is altered to remove the meta_query key/value pair from the array all coupons are shown, as expected. When the the meta_query takes the value of one of its two subarrays the result is the null set instead of the expected subportion of the expected-set.

    Furthermore, the portion of code to return "Unreliable Coupons" also returns nothing; it is as follows:
    PHP Code:
                        // show all coupons with <= than 50% success (excluding 0%) for this category and setup pagination
                        
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                
                        
    query_posts(array(
                                
    "filter_unreliable" => true,
                                
    'post_type' => APP_POST_TYPE,
                                
    APP_TAX_CAT => $term->slug,
                                
    'caller_get_posts' => 1,
                                
    'paged' => $paged
                        
    )); 

  2. #2
    Thread Starter
    Amateur leedharis's Avatar
    Join Date
    Aug 2011
    Location
    United States
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    Junior Member moazam's Avatar
    Join Date
    Jul 2011
    Location
    United Kingdom
    Posts
    42
    Thanks
    6
    Thanked 2 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    Junior Member webyguy's Avatar
    Join Date
    Aug 2010
    Location
    India
    Posts
    22
    Thanks
    1
    Thanked 8 Times in 7 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. #5
    Junior Member moazam's Avatar
    Join Date
    Jul 2011
    Location
    United Kingdom
    Posts
    42
    Thanks
    6
    Thanked 2 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #6
    Junior Member abclisting's Avatar
    Join Date
    Dec 2011
    Location
    United States
    Posts
    22
    Thanks
    6
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Where does coupon expiration display?
    By reford in forum Help Using Clipper
    Replies: 6
    Last Post: October 23rd, 2011, 06:15 PM
  2. Replies: 2
    Last Post: October 18th, 2011, 07:55 PM
  3. Facebook Error plus Coupon!!!!!!!!!!!
    By tiger09019 in forum Report ClassiPress Bugs
    Replies: 2
    Last Post: October 5th, 2011, 04:24 PM
  4. WordPress database error: [Query was empty]
    By luehning in forum Report ClassiPress Bugs
    Replies: 5
    Last Post: July 31st, 2011, 09:48 AM
  5. Display job listings on post/page using custom field as query.
    By pabl70 in forum JobRoller General Discussion
    Replies: 6
    Last Post: April 26th, 2011, 12:30 PM