Topic RSS
I figured out how to do this with a easy amount of time. I hope this will help anyone else. This should hopefully be a good way to approach this with minimal effort. I'm sure theres another way to do it, but it does work, and it's not bad at all!
So the idea here is to make items out of stock not display on main page/search.
I have my main page as a frontdoor page (Just items displayed, no news), But I would think it would be the same in the main index file for the default template. But for my changes:
Open up Frontdoor.php and search.php in the mk3 theme directory.
FIND IN BOTH FILES (Or any other file you want to do this with):
$pli = get_post_meta($post->ID, 'pli', $single = true); // check for item price
$price = get_post_meta($post->ID, 'price', $single = true);?>
CHANGE TO:
$pli = get_post_meta($post->ID, 'pli', $single = true); // check for item price
$price = get_post_meta($post->ID, 'price', $single = true);
$quantity = get_post_meta($post->ID, 'mkt_stock_quantity', $single = true);
$oversell = get_post_meta($post->ID, 'mkt_stock_oversell_ok', $single = true);
$outstock = get_post_meta($post->ID, 'outstock', $single = true);
if (($quantity == 0 && $oversell != 1) || $outstock == 1) continue; ?>
====
What the new coding means:
$quantity: Item amount of quantity left
$oversell : If you can keep selling after quantity is 0.
$outstock: Manual out of stock enable/disable.
So the if check is if quantity is empty, but oversell is not enabled, OR if manual out of stock is enabled, bypass this item (continue; skips though the php while loop, so it bypasses the item!) These are all meta tag variables that markettheme already handles so you don't need any additional changes.
Pretty simple I think ![]()
Most Users Ever Online: 40
Currently Online:
18 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Member Stats:
Guest Posters: 428
Members: 2252
Moderators: 1
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 2983
Posts: 16042
Newest Members: Allsed, deleteduser, shanm, slidesketch, jimharrison, vmi
Moderators: Market Admin (5051)
Administrators: Market Admin (5051)

Log In
Register
Home
Offline

