Market lets you sell products online using the Wordpress platform.

You must be logged in to post Login

Search Forums:


 






Displaying "Coming Soon"

UserPost

8:54 am
January 27, 2010


mhackney

Groton, MA USA

Member

posts 35

Post edited 8:56 am - January 27, 2010 by mhackney
Post edited 8:57 am - January 27, 2010 by mhackney
Post edited 8:57 am - January 27, 2010 by mhackney
Post edited 8:58 am - January 27, 2010 by mhackney



My new book is in print and I wanted to list it in my store but not take orders for it yet (http://www.eclecticangler.com/store).

I tried creating my product like normal but not setting a price. Then I said something like "This book is coming soon..." in the product description. However, in places where the product is listed (categories, grid) the "SOLD OUT" message is displayed. Not what I wanted!

So, I added a few lines of code to frontdoor.php (and all derivatives if you've made any), mkt_language.php, and style.css to check if the item's price is "" and display the message "Coming Soon".  Here's the code:


style.css - it doesn't matter where you put these but search for "sold" and place these there

#content .grid .comingsoon {

background-color: #cfa925;

color: #000000;

width: 108px;

margin: 0px auto;

text-align: center;

font-weight: bold;

padding-top: 2px;

padding-bottom: 2px;

margin-bottom: 9px;

}


#content h2 .comingsoon {

background-color: #ca1717;

color: #444444;

padding-right: 2px;

padding-left: 2px;

margin-left: 5px;

}

mkt_language.php - it doesn't matter where you put this but search for "mkt_THEME_TEMPLATE_FRONTDOOR_SOLDOUT" and place this there


define('mkt_THEME_TEMPLATE_FRONTDOOR_COMINGSOON', 'Coming Soon');

frontdoor.php - this needs to be inserted in the proper place. Search for "// if there is a price at the moment show it"

This is the start of the code that displays the price. The original code displays a price if $price is not equal to 0. Otherwise it displays "Sold Out". We're just going to do an extra check to see if the price is null ("") and display "Coming Soon" if it is.

Replace the "if" ... "else" code with this:


<?php // if there is a price at the moment show it

if($price !== '') { ?>

<div class="price"><strong><?php echo $mkt_currency_symbol; ?></strong><?php echo $price; ?></div>

<?php } // end if statement


// if there is no price, display not yet available message

else if($price == '') { echo '<div class="comingsoon">' . mkt_THEME_TEMPLATE_FRONTDOOR_COMINGSOON . '</div>'; }


// if the item is sold out

else { echo '<div class="sold">' . mkt_THEME_TEMPLATE_FRONTDOOR_SOLDOUT . '</div>'; } ?>

Don't forget to add this block to all of the files you copied from frontdoor.php - to support product categories in the menubar for instance.

You can see this in operation on my site at http://www.eclecticangler.com/store and click on the Reelsmithing menu (at least until I price the book!).

Hope this helps some people.


Cheers,

Michael

Note: my store location is going to change to the root, so if the above links don't work, use http://www.eclecticangler.com


1:47 pm
January 27, 2010


Market Admin

Admin

posts 2765

Post edited 1:48 pm - January 27, 2010 by Market Admin


Another easier method for those less code-savvy is to change the text of "Sold Out" to something like "Coming soon".  Then you can just manually disable the item in your Product Manager area for that product.  (located under inventory settings)


To change the text, there are two lines that need to be modifed in the "mkt_language.php" file.

Lines #51 and #78

1:54 pm
January 27, 2010


mhackney

Groton, MA USA

Member

posts 35

Thanks. I had considered that but I also wanted to have a Sold Out capability too. I hand-make small batches of my reels and furling engines so having sold-out is important for those.

cheers,

Michael