Results 1 to 6 of 6

Thread: Get Only Price of Ad

  1. #1
    Thread Starter
    Expired Customer arisma's Avatar
    Join Date
    Mar 2017
    Posts
    84
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Get Only Price of Ad

    Hi everyone!

    Thinking about how to put only the price (without currency) of an Ad inside a PHP variable?

    I've seen this: cp_get_price( $post->ID, 'cp_price' );
    But this function outputs also the currency. Tried also with:

    $string = cp_get_price( $post->ID, 'cp_price' );
    preg_replace( '/[^0-9]/', '', $string );

    But I can't get the price without the currency!

    Is there a function? I just want a variable like

    $price = 199;

  2. #2
    Moderator ovidiubica's Avatar
    Join Date
    Mar 2011
    Posts
    5,749
    Thanks
    240
    Thanked 1,062 Times in 1,000 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    Thread Starter
    Expired Customer arisma's Avatar
    Join Date
    Mar 2017
    Posts
    84
    Thanks
    9
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    Thread Starter
    Expired Customer arisma's Avatar
    Join Date
    Mar 2017
    Posts
    84
    Thanks
    9
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. #5
    Moderator ovidiubica's Avatar
    Join Date
    Mar 2011
    Posts
    5,749
    Thanks
    240
    Thanked 1,062 Times in 1,000 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #6
    Thread Starter
    Expired Customer arisma's Avatar
    Join Date
    Mar 2017
    Posts
    84
    Thanks
    9
    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. Remove precise price checkbox in price slider
    By anjumbhat in forum Help Using ClassiPress
    Replies: 0
    Last Post: January 18th, 2016, 01:57 PM
  2. How to make price field disappear if no price is entered
    By gordon in forum ClassiPress General Discussion
    Replies: 7
    Last Post: October 19th, 2013, 02:09 PM
  3. How can I hide the price and yellow button when price is not required?
    By manilaboy in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: December 28th, 2012, 07:13 PM
  4. Replace price slider with min and max price boxes in refine results
    By einstein in forum ClassiPress General Discussion
    Replies: 0
    Last Post: November 17th, 2012, 10:36 AM