Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Refine Price By Category

  1. #1
    Thread Starter
    Member itsme's Avatar
    Join Date
    Jun 2011
    Posts
    62
    Thanks
    10
    Thanked 13 Times in 6 Posts

    Refine Price By Category

    The price slider display a min, max price based on all the ads that you have. This tutorial will show you how to make the price slider, show the price based on the ad category which will be a lot cleaner, like you don’t have a cellular which costs 1 000 000 but you actually have houses which do.

    open your theme-refine.php, and go to line 59 and replace

    PHP Code:
    cp_refine_search_builder($results); 
    with

    PHP Code:
    cp_refine_search_builder($results,$catid); 
    go to line 69 which is :
    PHP Code:
      function cp_refine_search_builder($results) { 
    and replace it with
    PHP Code:
     function cp_refine_search_builder($results,$catid) { 
    finaly you have to replace line 71 and 72 which are :
    PHP Code:
    $cp_min_price str_replace','''$wpdb->get_var"SELECT min( CAST( meta_value AS UNSIGNED ) ) FROM $wpdb->postmeta WHERE meta_key = 'cp_price'" ) );

    $cp_max_price str_replace','''$wpdb->get_var"SELECT max( CAST( meta_value AS UNSIGNED ) ) FROM $wpdb->postmeta WHERE meta_key = 'cp_price'" ) ); 
    with these two :
    PHP Code:
    $cp_min_price str_replace','''$wpdb->get_var"SELECT min( CAST( meta_value AS UNSIGNED ) ) FROM $wpdb->term_relationships,$wpdb->postmeta WHERE object_id=post_id AND meta_key = 'cp_price' And term_taxonomy_id = $catid;" ) );


    $cp_max_price str_replace','''$wpdb->get_var"SELECT max( CAST( meta_value AS UNSIGNED ) ) FROM $wpdb->term_relationships,$wpdb->postmeta WHERE object_id=post_id AND meta_key = 'cp_price' And term_taxonomy_id = $catid;" ) ); 
    That's it now instead of having the price slider showing for all the ads you have , it will be based on category .

  2. The Following 6 Users Say Thank You to itsme For This Useful Post:

    andrea_s (January 24th, 2012), billis (October 4th, 2011), dikiyforester (January 13th, 2012), luckymohawk (April 30th, 2012), mayed (March 1st, 2012), rozatarra (October 19th, 2012)

  3. #2
    Veteran barukar's Avatar
    Join Date
    Sep 2010
    Location
    Brasil, São Paulo, SP
    Posts
    6,784
    Thanks
    186
    Thanked 742 Times in 623 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    -------------------------------------------------------------------------------------------
    Projects: ClassiNoiva - Classimóveis - vocênoenem - i50 - Clube DETRAN

  4. The Following User Says Thank You to barukar For This Useful Post:

    andrea_s (January 24th, 2012)

  5. #3
    Member billis's Avatar
    Join Date
    Jul 2011
    Posts
    86
    Thanks
    4
    Thanked 7 Times in 7 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. The Following User Says Thank You to billis For This Useful Post:

    andrea_s (January 24th, 2012)

  7. #4
    Junior Member morizio's Avatar
    Join Date
    Jun 2011
    Location
    Dubai
    Posts
    27
    Thanks
    4
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

  8. The Following User Says Thank You to morizio For This Useful Post:

    andrea_s (January 24th, 2012)

  9. #5
    bruunmedia's Avatar
    Join Date
    Jul 2010
    Location
    Denmark
    Posts
    53
    Thanks
    12
    Thanked 10 Times in 5 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  10. The Following User Says Thank You to bruunmedia For This Useful Post:

    andrea_s (January 24th, 2012)

  11. #6
    Member fuzegraphics's Avatar
    Join Date
    Nov 2011
    Location
    South Africa
    Posts
    91
    Thanks
    17
    Thanked 6 Times in 5 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  12. The Following User Says Thank You to fuzegraphics For This Useful Post:

    andrea_s (January 24th, 2012)

  13. #7
    Junior Member andrea_s's Avatar
    Join Date
    Oct 2011
    Posts
    40
    Thanks
    25
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

  14. #8
    Junior Member andrea_s's Avatar
    Join Date
    Oct 2011
    Posts
    40
    Thanks
    25
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

  15. #9
    Junior Member marlonsabala's Avatar
    Join Date
    Feb 2012
    Location
    Portugal
    Posts
    27
    Thanks
    5
    Thanked 9 Times in 5 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  16. The Following User Says Thank You to marlonsabala For This Useful Post:

    timkoch (November 13th, 2012)

  17. #10
    Junior Member marlonsabala's Avatar
    Join Date
    Feb 2012
    Location
    Portugal
    Posts
    27
    Thanks
    5
    Thanked 9 Times in 5 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  18. The Following 3 Users Say Thank You to marlonsabala For This Useful Post:

    marcellino (October 17th, 2012), mayed (March 1st, 2012), pauro (May 4th, 2012)

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Refine Results Category Price
    By webcrafty in forum ClassiPress General Discussion
    Replies: 3
    Last Post: March 30th, 2014, 09:00 AM
  2. Refine search- price 201494834$
    By chas in forum Report ClassiPress Bugs
    Replies: 4
    Last Post: April 25th, 2012, 10:13 AM
  3. refine results price
    By abdulgeorge in forum Help Using ClassiPress
    Replies: 6
    Last Post: August 13th, 2011, 03:36 AM
  4. Moving the Refine Results to the left of the category page
    By projectcaesarea in forum ClassiPress General Discussion
    Replies: 1
    Last Post: July 16th, 2011, 04:50 PM
  5. Refine search by price low to high?
    By greencode in forum Help Using ClassiPress
    Replies: 9
    Last Post: September 10th, 2010, 09:03 PM