WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Hiding products when stock is zero
  • Print
Pages: [1]   Go Down

Author Topic: Hiding products when stock is zero  (Read 3824 times)

Offline erikp01

  • Posts: 44
  • Gender: Male
Hiding products when stock is zero
« on: April 16, 2011, 08:14:01 AM »
Is it possible to hide the products when stock is zero?
Logged

Offline Bug

  • Posts: 237
Re: Hiding products when stock is zero
« Reply #1 on: May 07, 2011, 01:01:45 PM »
It should be rather simple, if you add small piece of code to the line that manages how the items are called for the overview page you can exclude the products that are out of stock

Somewhere around line 70 of the view_overview page change:
Code: [Select]
// Query items (for this page)
$query_items = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_items WHERE section_id = '$section_id' AND active = '1' AND title != '' ORDER BY position ASC".$limit_sql);
$num_items = $query_items->numRows();

into somthing like:
Code: [Select]

// Query items (for this page)
$query_items = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_showroom_items WHERE section_id = '$section_id' AND active = '1' AND stock > '0' AND title != '' ORDER BY position ASC".$limit_sql);
$num_items = $query_items->numRows();



Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Hiding products when stock is zero
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2