Results 1 to 1 of 1

Thread: Custom price display

  1. #1
    Thread Starter
    bugeja's Avatar
    Join Date
    Jun 2013
    Location
    Malta
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Custom price display

    I have a services section which I didnt want to force a price on but I wanted to display text instead of price. All the other sections have a form with the price being a requirement.

    I have modified the theme-functions.php as below note the $price_out = 'Call for a quotation'; if the price is nill. My question is: Is it possible to tie this to a specific category? In the sense of if the price is null and category is 'Services Offered' display 'Call for a quotation'


    Code:
    // get the ad price and position the currency symbol
    if ( !function_exists('cp_get_price') ) {
    	function cp_get_price($postid, $meta_field) {
    		global $cp_options;
    
    		if ( get_post_meta($postid, $meta_field, true) ) {
    
    			$price_out = get_post_meta($postid, $meta_field, true);
    			$price_out = cp_price_format($price_out);
    			$price_out = cp_pos_currency($price_out, 'ad');
    
    		} else {
    			if ( $cp_options->force_zeroprice )
    				$price_out = cp_pos_currency(0, 'ad');
    			else
    				$price_out = 'Call for a quotation';
    		}
    
    		echo $price_out;
    	}
    }
    Thank you very much!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to display price in single ad details
    By tupecik in forum ClassiPress General Discussion
    Replies: 2
    Last Post: August 5th, 2012, 04:36 PM
  2. [SOLVED] display price in the author page
    By cyberpaul in forum ClassiPress General Discussion
    Replies: 3
    Last Post: April 29th, 2012, 02:30 AM
  3. [MOD NEEDED] Select two Currency and display in price.
    By zandunga in forum ClassiPress General Discussion
    Replies: 1
    Last Post: August 12th, 2011, 07:52 AM
  4. [MOD NEEDED] Display custom string instead of price
    By nene in forum ClassiPress General Discussion
    Replies: 4
    Last Post: December 21st, 2010, 08:05 AM
  5. [HELP] Custom Field Display MOD, I want to display icons
    By teller in forum ClassiPress General Discussion
    Replies: 1
    Last Post: October 11th, 2010, 08:58 AM