Skip to content
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1038 from KrzysztofBorbis/master
Browse files Browse the repository at this point in the history
hide out of stock products
  • Loading branch information
Krzysztof Kasowski committed Apr 15, 2015
2 parents af1b9fc + ac029a1 commit 972beec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,8 @@
* Improved: Display "Out of stock" for variable products without any available variation.
* Improved: PHP Execution Time in System Info page.
* Improved: Cart items check before displaying.
* Improved: All out of stock products, can be properly removed from shop page.
* Improved: Invalid license key can be properly deactivated.
* Fixed: "Apply coupon" button in checkout no longer places the order.
* 1.16.1 - 2015-03-18:
* Improved: Ability to enable/disable HTML emails.
Expand Down
2 changes: 1 addition & 1 deletion classes/jigoshop_licence_validator.class.php
Expand Up @@ -481,7 +481,7 @@ private function save_licence_keys()
// Deactivate this key as it was removed
if (empty($licence_key) && isset($keys[$product_id]['status']) && $keys[$product_id]['status'] && $licence_active) {
$response = $this->deactivate($product_id, $keys[$product_id]['licence_key'], $activation_email);
if (isset($response->success) && $response->success) {
if ((isset($response->success) && $response->success) || (isset($response->code) && $response->code == 101)) {
$messages[] = array(
'success' => true,
'message' => sprintf(__('<b>Key deactivated.</b> License key for <i>%s</i> has been <b>deactivated</b>.', 'jigoshop'), self::$plugins[$product_id]['title'])
Expand Down
8 changes: 8 additions & 0 deletions classes/jigoshop_query.class.php
Expand Up @@ -189,6 +189,14 @@ private function meta_query( $request ) {
'value' => $in,
'compare' => 'IN'
);

if(Jigoshop_Base::get_options()->get( 'jigoshop_hide_no_stock_product' ) == 'yes'){
$meta[] = array(
'key' => 'stock_status',
'value' => 'outofstock',
'compare'=> '!='
);
}

return $meta;
}
Expand Down

0 comments on commit 972beec

Please sign in to comment.