MOD to Notify of Listing Price or FREE before Paying
My ClassiPress Price Settings at my test site are
1. Charge for Listing Ads : Yes
2. Price Model: Price per Category
3. % of Sellers Price : 0 (blank value)
So some of my Ads have a price that I have set individually for each category. Most of the Ad categories prices are left blank, 0 for Free Ads. I am also showing the Featured Listings box and a test price of $7 dollars.
So, to my MOD:
I wanted the Form when it first shows up after a Customer has selected their category and clicked the CONTINUE >>> Button to tell them the Price of this Category, or if it is a Free Ad for them to be told that the Ad is Free while also inviting them to check the Featured Listing box and telling them that the Featured Listing is only $ (variable) Dollars (Pesos, Euros, seashells...).
So I wanted this message to show up prominently just after the Image Upload boxes in my form and Before the Featured Listing Box.
For instance, on my test site just after the Image Upload boxes you would see
Your Ad in the Restaurants category will cost only $7 Dollars
If you would like to draw more attention to your listing -- for another $7 you can feature your ad by clicking on the Featured Listing checkbox below.
If the Ad Price in their chosen category has no price, $ 0 then they see on the form--
This Ad is FREE!
If you would like to draw more attention to your listing -- for another $7 you can feature your ad by clicking on the Featured Listing checkbox below.
The following mod is for the Form/step-functions.php
at line 133 in the original version 3.0.2 in step-functions you will see the first comment about
'show the non-custom field...'
for the sake of clarity and making sure the PHP does not get turned off and create errors for you I leave this function unchanged, so you can select from that point at line 133
and paste my code down to line 156
in step-functions where you see ' // show the featured ad box if enabled ´
starting at line 133
Code:
// show the non-custom fields below the main form
function cp_other_fields() {
global $wpdb;
// are images on ads allowed
if(get_option('cp_ad_images') == 'yes')
echo cp_image_input_fields();
// Vienna mod to show Price or Free Ad Confirmation for chosen Ad category in step 2 of the Ad Form Listing process where ClassiPress Price Settings are Charge for Listing = 'Yes' , Price Model: 'Price per Category, and % of Sellers Price: Blank (no value) ?>
<div class="clr"></div>
<?php
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) {
// grab the price number
$myprice = ($result->option_value);
if ($myprice == '0') {
echo '[*]<h2>This Ad is FREE!</h2>[*]'; }
else {
echo '[*]<h2>Your Ad in the ' . $_POST['catname'] . ' category will cost only $' . $myprice .' Dollars</h1>'; }
echo'<h3>If you would like to draw more attention to your listing -- for another '?> <?php echo cp_pos_price(get_option('cp_sys_feat_price'));?> <?php echo ' you can feature your ad by clicking on the Featured Listing checkbox below.</h3> ' ?>
<?php } ?>
<div class="clr"></div>
<?php // end of Vienna mod to show Category price with 1 ad pack and set for price per category ?>
<?php
// show the featured ad box if enabled
ending at and including the previous line 156
Now then, the next thing I am working on is modding this to get rid of the Payment Dropdown menu if the Price is Free and the Featured Listing is not checked yet or at all.