Showing "Sold" on sold items

I will be listing single sale (one-off) items on a website but need to display "sold" across the images of sold items, can Marketpress be configured to display a sold banner across items that are sold? And does it have a way to list sold items under a specific category?

  • aecnu
    • WP Unicorn

    Greetings DDV,

    can Marketpress be configured to display a sold banner across items that are sold?

    Thanks for bringing this up, it certainly sounds like a useful customization to the plugin.
    Unfortunately it is not currently available - but we would love to put it into consideration for future development.

    You can now make plugin and feature requests here:
    http://wpmudev.uservoice.com/
    The more popular a request is and the more votes it gets, the more likely it will be considered.
    It might have already been suggested. It is worth a quick search to add your votes before submitting a new suggestion.

    It might take a bit longer than useful but I'll see if I can get the lead developer in here to assist / give you some advice... in the meantime if you could post the results / problems you've come across doing it yourself here that would definitely help too.

    Alternatively, you could see if there's a developer available at wpmu jobs who could get onto it right this minute, but we're aiming to get you sorted ourselves.

    And does it have a way to list sold items under a specific category?

    The answer is the same as above.

    Thank you for being a WPMU Dev member!

    If we can be of further assistance please let us know.

    Cheers, Joe :slight_smile:

  • DDV
    • Design Lord, Child of Thor

    Thank you, Joe, for your very quick reply.

    I'm just about to eat breakfast. Will add/search the feature request at the above link when I return. I can't believe it hasn't been thought about before!

  • DDV
    • Design Lord, Child of Thor

    Rest assured, I will do that. If the plugin displays items as "Sold Out" and the image for sold out items uses a different CSs class or ID then I will be able to add an overlay just to those images without too much editing to the plugin's code.

    I've not looked at the code yet or installed the plugin (which I will do in a few minutes) but once I know whether it's possible to add an if statement to check whether an item's sold I will be able to get the image of sold items to use a different CSS class/ID if one does not already exist. then it'll just be a simple case of adding the banner overlay - a quick and dirty fix. Depends how the plugin works. I'm sure the developer will be able to point me in the right direction.

    PS Just updated my nic to Lee from DDV so if it changes halfway through this thread.... now you know why.

  • DDV
    • Design Lord, Child of Thor

    It's been a while since my last post but I've finally gotten round to looking into this. Because of time constraints, I'm taking what I believe to be the quickest way to demonstrate that an item is sold, namely, I've created a 'sold' category that I place all sold items into. The next bit involves a bit of PHP to detect the category and inject some HTML into posts of that category,

    I want to display "SOLD" or a "sold banner" above the post or somewhere within the post without needing to go in and edit the post to do it. The 'simplest' way is to get WordPress to detect the category. Here is the code I'm using:

    <?php
    if ( is_singular( 'sold' )  ) {
    echo '<div id="solditem"><h2>SOLD</h2></div>';
    }
    ?>

    But it doesn't seem to work

    It works if I leave the category out such that the code is;

    <?php
    if ( is_singular()  ) {
    echo '<div id="solditem"><h2>SOLD</h2></div>';
    }
    ?>

    But leaving out the category causes "SOLD" to display above all listed items.

    If you're wondering, I've used is_singular() because that is supposed to detect custom posts.

    Anyone have any ideas?

  • aecnu
    • WP Unicorn

    Greetings Lee,

    You probably marked it as resolved earlier because it is obviously a feature request to have this possibly integrated into the code.

    However, I am also happy that you marked it as not resolved or else we would not have seen your additions to this thread.

    I will go ahead and ask the developer to come in here to offer advice/advise on this thread though I know he will not be back to work until Thursday this coming week if he does not make it in hear before Monday.

    Cheers, Joe :slight_smile:

  • DDV
    • Design Lord, Child of Thor

    Thank you Joe and Aaron.

    The Out of Stock button is not really an option because I'm using the plugin in inventory mode and were I using it as a shopping cart the out of stock button would not be obvious enough.

    I have been playing with is_object_in_term() but gotten nowhere. Here is "a" snippet from many I've tried:

    <?php
    
    if (is_object_in_term($post->ID,'product_category','sold')) {
    echo '<div id="solditem"><h2>SOLD</h2></div>';
    }
    
    ?>

    It displays "sold" above every post, whether assigned to the sold category or not!

    I'm missing something obvious, I know it, but just cannot see it.

    Would like to use jQuery to overlay a sold banner on product images in the sold category but I'd need to learn jQuery to do that. Good suggestion, though, thank you.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.