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

Thread: MOD to SHOW Ad Price or FREE AD in Step 1 NEW AD FORM

  1. #1
    Thread Starter
    Veteran vienna's Avatar
    Join Date
    May 2010
    Location
    Vienna, Austria
    Posts
    718
    Thanks
    19
    Thanked 177 Times in 118 Posts

    MOD to SHOW Ad Price or FREE AD in Step 1 NEW AD FORM

    I thought the AD FORM that displays with form fields when a User first decides to Create an Ad needed some confirmation-- in other words, once the user has selected the Category of Ad and hit the Submit Button they now get the appropriate form BUT it lacks something.

    What the present form lacks, in my opinion, is a "hand-holding assurance" of the PRICE before they even begin to fill out the form. And if the price is ZERO for this ad then it is nice to encourage them by reflecting boldly that this AD is FREE....whoopeee....fill out the form below with confidence.

    What I created for myself and am offering at this time is a Mod to do the following:

    If the Price for the Ad is 0, nothing, nada the user will see the following at the TOP of the form in step one--
    This Ad in the "Artists in Residence" category is FREE!

    If you would like to draw MORE ATTENTION to YOUR AD -- for just $7 you can feature your ad by clicking on the Featured Listing checkbox below.

    The code dynamically reflects whatever category the user selected for their Ad and dynamically (if you are running the FEATURED AD option) continues with the Encouragement to consider making this Ad a FEATURED AD and tells the user how much you are charging for the Featured Listing option.

    If in the ClassiPress dashboard you have NOT selected the Featured Listing option then that second paragraph will not display.

    On the other hand, if the Ad category the user has selected has a Price and is NOT free, then the user sees the following header at the top of the Form fields--
    Your Ad in the "Bars" category will cost only $7 Dollars

    If you would like to draw MORE ATTENTION to YOUR AD -- for just $7 you can feature your ad by clicking on the Featured Listing checkbox below.

    And, again, the Second Paragraph regarding the Featured Listing box will not show up if you do NOT offer the Featured Listing Option.

    To me this makes me feel more confident that I am doing the "right thing" -- from the time I selected a Category that I thought was without cost, Free, and clicked the Submit button to the time the Form appears I will feel relieved that YES, INDEED, the Ad IS FREE.

    And if the Ad is NOT Free then it will still confirm that I am where I wanted to be and the Ad will cost me XX dollars, pesos, euros, rubles, whatever.

    Proceed at your own risk. Make a duplicate copy of step1.php before you begin and make sure it is named "copy of step1.php" or something to keep it from being overwritten while you modify step1.php.

    And if you are new to modifying php files, remember from now on--PHP is NOT FORGIVING.
    Code:
     If you remove or add a <php?   or a  ?> here and there it WILL error and not produce the page you are expecting.
    That's why you should make sure you paste exactly what I describe below.

    Here is the mod for the last two versions--3.0.2 and 3.0.3 :

    from the folder INCLUDES-- look for the folder FORM--

    Inside the Form folder, open step1.php and around line 80 you will see this code--

    Code:
                    // show the form based on the category selected
                    // get the cat nice name and put it into a variable
                    $_POST['catname'] = get_cat_name($_POST['cat']);
                ?>
    DO NOT DO ANYTHING with that code above...leave it alone!

    IN the very next line, an EMPTY line, about line 84, you will PASTE the following complete code AFTER you have made sure that you are NOT DELETING that last ?> from the above code" -- Groovy...NOW do a Control-A or equivalent inside the following code and Control-C or equivalent to get everything---

    Code:
    <?php
    // Vienna mod to show price or Free Ad confirmation
     global $wpdb;
        $thiscatid = $_POST['cat'];
    // go get the option value or price
     $sql = "SELECT option_value"
            . " FROM wp_options"
            . " WHERE option_name = 'cp_cat_price_$thiscatid '";
               $results = $wpdb->get_results($sql);
            foreach($results as $result) {
    // put the form_cats into an array
                $myprice = ($result->option_value);
                if ($myprice == '0') {
                echo '<h1>This Ad in the "' . $_POST['catname'] . '" category is <em>FREE!</em></h1>'; }
                else { 
                echo '<h1>Your Ad in the "' . $_POST['catname'] . '" category will cost only <i>$' . $myprice .' Dollars</i></h1>'; }
    if(get_option('cp_sys_feat_price')) {            
    echo'<li><h2>If you would like to draw <em>MORE ATTENTION to YOUR AD</em> -- for just '?> <?php echo cp_pos_price(get_option('cp_sys_feat_price'));?> <?php echo  ' you can feature your ad by clicking on the <u>Featured Listing</u> checkbox below.</h2> </li><br>' ?> 
    <?php  } 
    } ?>        
    <div class="clr"></div> 
    <?php    // end of Vienna mod to show Category price with 1 ad pack and set for price per category ?>
    Once it is pasted in and step1.php is saved just MAKE SURE THAT THE FOLLOWING LINE OF CODE STARTS EXACTLY LIKE THIS --

    Code:
                  
    <form name="mainform" id="mainform" class="form_step" action="" method="post" enctype="multipart/form-data">
    IF SO, then you should be safe and all of the code should work. At least, it does for me using PHP 5.

  2. The Following 4 Users Say Thank You to vienna For This Useful Post:

    dannybnc (November 21st, 2014), mione (February 3rd, 2015), timkoch (October 6th, 2011), veloso (August 9th, 2010)

  3. #2
    veloso's Avatar
    Join Date
    Aug 2010
    Location
    Portugal
    Posts
    39
    Thanks
    7
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #3
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    39,569
    Thanks
    163
    Thanked 3,292 Times in 3,163 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  5. #4
    listingalways's Avatar
    Join Date
    Jul 2010
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #5
    rubencio's Avatar
    Join Date
    May 2010
    Location
    Spain
    Posts
    3,804
    Thanks
    268
    Thanked 316 Times in 278 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

    r u b e n c i o . c o m


    Since 2010 providing AppThemes solutions,
    Plugins and the best childthemes...



  7. #6
    Junior Member timkoch's Avatar
    Join Date
    May 2011
    Location
    South Africa
    Posts
    41
    Thanks
    7
    Thanked 2 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  8. #7
    Thread Starter
    Veteran vienna's Avatar
    Join Date
    May 2010
    Location
    Vienna, Austria
    Posts
    718
    Thanks
    19
    Thanked 177 Times in 118 Posts

    Tutorial -- be nice & give some extra hand holding to the User Posting an Ad

    You must be an AppThemes customer and logged in to view this response. Join today!

  9. #8
    Thread Starter
    Veteran vienna's Avatar
    Join Date
    May 2010
    Location
    Vienna, Austria
    Posts
    718
    Thanks
    19
    Thanked 177 Times in 118 Posts

    Coupons and Member packs with this Mod

    You must be an AppThemes customer and logged in to view this response. Join today!

  10. The Following 2 Users Say Thank You to vienna For This Useful Post:

    mione (February 3rd, 2015), timkoch (October 6th, 2011)

  11. #9
    Junior Member timkoch's Avatar
    Join Date
    May 2011
    Location
    South Africa
    Posts
    41
    Thanks
    7
    Thanked 2 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  12. #10
    Thread Starter
    Veteran vienna's Avatar
    Join Date
    May 2010
    Location
    Vienna, Austria
    Posts
    718
    Thanks
    19
    Thanked 177 Times in 118 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

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. Free ads still show the Price field
    By jakemelon in forum Report ClassiPress Bugs
    Replies: 3
    Last Post: January 29th, 2012, 08:04 PM
  2. MOD to Notify of Listing Price or FREE before Paying
    By vienna in forum ClassiPress General Discussion
    Replies: 0
    Last Post: June 22nd, 2010, 08:13 PM
  3. ads forms - step 1 - categories without price
    By ricricucit in forum Report ClassiPress Bugs
    Replies: 8
    Last Post: April 9th, 2010, 12:16 AM
  4. Latest sneak peek of 3.0: Multi-Step Ad Form Demo
    By pepsi in forum ClassiPress General Discussion
    Replies: 6
    Last Post: March 23rd, 2010, 03:29 PM
  5. Show Name hidden field in registration form
    By aledan in forum ClassiPress General Discussion
    Replies: 0
    Last Post: October 12th, 2009, 05:21 AM