Page 1 of 14 12311 ... LastLast
Results 1 to 10 of 132

Thread: Add a "Sold Tag" to the Ad listing

  1. #1
    Thread Starter
    dmyers's Avatar
    Join Date
    Oct 2010
    Location
    United States, Texas
    Posts
    103
    Thanks
    5
    Thanked 83 Times in 11 Posts

    Lightbulb Add a "Sold Tag" to the Ad listing

    This is part two of my tutorial on adding "SOLD" stamps and icons to your ClassiPress Theme. You can see part one by clicking here.

    In part one I demostrated how you add a "SOLD" stamp to the top of the clasified ad to show your users the item has already been sold. In part two I will show you how to add a "sold tag" after the name of the item when the item appears under the "Just Listed", "Most Popular" and "Random" tabs, as well as when viewing search results and browsing categories.

    This will give all of your users the ability to browse categories and immediately know if an item is still available without having to click on the link to see the entire ad.

    Here is a screenshot of what your posts will look like after the mod is completed. As you can see, the coffee pot has been sold while the alarm clock has not.



    INSTRUCTIONS

    Step 1: The first thing you need to do is download the attached image (sold_tag.gif) to your local computer somewhere you can find it later.

    Step 2: Make a backup copy of "classipress/index.php" and "classipress/loop-ad.php".

    Step 3: Find this code in the classipress/index.php file.

    Code:
    <div class="ad-right">
    <h3><a href="<?php the_permalink(); ?>"><?php if (mb_strlen(get_the_title()) >= 75) echo mb_substr(get_the_title(), 0, 75).'...'; else the_title(); ?></a></h3>
     
    <div class="price-wrap">
    <span class="tag-head">&nbsp;</span><p class="ad-price"><?php if(get_post_meta($post->ID, 'price', true)) cp_get_price_legacy($post->ID); else cp_get_price($post->ID); ?></p>
    </div>

    Step 4: Replace the code above with this code and save the file.

    Code:
    <div class="ad-right">
     
    <h3><a href="<?php the_permalink(); ?>"><?php if (mb_strlen(get_the_title()) >= 75) echo mb_substr(get_the_title(), 0, 75).'...'; else the_title(); ?></a>
     
    <span><?php if (get_post_meta($post->ID, 'cp_ad_sold', true) == 'yes') : ?>
    <img src="/wp-content/themes/classipress/images/sold_tag.gif"></span>
    <?php endif; ?></h3>
     
    <div class="price-wrap">
    <span class="tag-head">&nbsp;</span><p class="ad-price"><?php if(get_post_meta($post->ID, 'price', true)) cp_get_price_legacy($post->ID); else cp_get_price($post->ID); ?></p>
    </div>

    Step 5: Find this code in the classipress/loop-ad.php file.

    Code:
    <div class="ad-right <?php echo get_option('cp_ad_right_class'); ?>">
     
    <h3><a href="<?php the_permalink(); ?>"><?php if (mb_strlen(get_the_title()) >= 75) echo mb_substr(get_the_title(), 0, 75).'...'; else the_title(); ?></a></h3>
     
    <div class="price-wrap">
    <span class="tag-head">&nbsp;</span><p class="ad-price"><?php if(get_post_meta($post->ID, 'price', true)) cp_get_price_legacy($post->ID); else cp_get_price($post->ID); ?></p>
    </div>

    Step 6: Replace the code above with this code and save the file.

    Code:
    <div class="ad-right <?php echo get_option('cp_ad_right_class'); ?>">
     
    <h3><a href="<?php the_permalink(); ?>"><?php if (mb_strlen(get_the_title()) >= 75) echo mb_substr(get_the_title(), 0, 75).'...'; else the_title(); ?></a>
     
    <span><?php if (get_post_meta($post->ID, 'cp_ad_sold', true) == 'yes') : ?>
    <img src="/wp-content/themes/classipress/images/sold_tag.gif"></span>
    <?php endif; ?></h3>
     
    <div class="price-wrap">
    <span class="tag-head">&nbsp;</span><p class="ad-price"><?php if(get_post_meta($post->ID, 'price', true)) cp_get_price_legacy($post->ID); else cp_get_price($post->ID); ?></p>
    </div>

    Step 7: Upload the index.php file and the loop-ad.php file to your classipress root folder.

    Step 8: Upload the sold_tag.gif file to "/wp-content/themes/classipress/images/" folder.

    Now, every ad you or your members mark as sold will have the sold tag added to the end of the item name.

    Hope everyone enjoys this...
    Attached Images Attached Images
    Last edited by pepsi; November 17th, 2010 at 03:48 PM.

  2. The Following 20 Users Say Thank You to dmyers For This Useful Post:

    aedwin (August 16th, 2011), ahikmahin (November 25th, 2010), annonse (June 5th, 2011), aw1zard (November 25th, 2010), bruunmedia (December 2nd, 2011), bseabs (November 18th, 2010), eaport (March 21st, 2012), free (September 19th, 2011), hazara (February 2nd, 2011), jdwired (February 23rd, 2011), joniboy (February 28th, 2011), kenton (February 18th, 2011), lcolley (November 30th, 2010), liewzy (June 16th, 2011), mr_xx (April 14th, 2011), osquid (February 22nd, 2011), pepsi (November 17th, 2010), shopcenter (September 18th, 2011), sumaxx (December 17th, 2010), tinnud (January 24th, 2011)

  3. #2
    pepsi's Avatar
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    14,887
    Thanks
    91
    Thanked 807 Times in 721 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #3
    Thread Starter
    dmyers's Avatar
    Join Date
    Oct 2010
    Location
    United States, Texas
    Posts
    103
    Thanks
    5
    Thanked 83 Times in 11 Posts

    Changes needed if using 3.0.5.2

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

  5. The Following 5 Users Say Thank You to dmyers For This Useful Post:

    bluecafe (November 26th, 2010), dquelhas (April 12th, 2011), matt9250 (September 19th, 2011), ssmedia (January 6th, 2011), tech9 (February 2nd, 2011)

  6. #4
    Veteran pinocchio's Avatar
    Join Date
    Sep 2010
    Location
    United Kingdom
    Posts
    633
    Thanks
    83
    Thanked 21 Times in 16 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  7. #5
    Amateur maryz's Avatar
    Join Date
    Jul 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

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

  8. #6
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    39,327
    Thanks
    161
    Thanked 3,242 Times in 3,113 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.

  9. #7
    Thread Starter
    dmyers's Avatar
    Join Date
    Oct 2010
    Location
    United States, Texas
    Posts
    103
    Thanks
    5
    Thanked 83 Times in 11 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  10. #8
    Marketplace Seller ahikmahin's Avatar
    Join Date
    Aug 2010
    Location
    Australia
    Posts
    504
    Thanks
    32
    Thanked 52 Times in 42 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  11. #9
    Veteran bluecafe's Avatar
    Join Date
    Apr 2010
    Location
    Berlin
    Posts
    1,563
    Thanks
    58
    Thanked 359 Times in 273 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  12. #10
    Thread Starter
    dmyers's Avatar
    Join Date
    Oct 2010
    Location
    United States, Texas
    Posts
    103
    Thanks
    5
    Thanked 83 Times in 11 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Page 1 of 14 12311 ... LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [TUTORIAL] Creating a "SOLD" stamp for your ads.
    By dmyers in forum ClassiPress General Discussion
    Replies: 63
    Last Post: March 3rd, 2013, 07:40 AM
  2. Convert listing to "featured" after the fact?
    By lhd333 in forum ClassiPress General Discussion
    Replies: 4
    Last Post: June 26th, 2009, 02:49 AM
  3. Add "SOLD" to items that are gone
    By tiffany in forum ClassiPress General Discussion
    Replies: 3
    Last Post: May 29th, 2009, 01:32 AM