Plugin Directory

Changeset 1932557


Ignore:
Timestamp:
08/29/2018 05:02:28 PM (8 years ago)
Author:
Easify
Message:

Version 4.12

Location:
easify-server-woocommerce/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • easify-server-woocommerce/trunk/easify.php

    r1900399 r1932557  
    55 * Plugin URI: http://www.easify.co.uk/wordpress/
    66 * Description: Connects Easify Business Management, EPOS (Electronic Point of Sale) and invoicing software to your WooCommerce enabled WordPress website. Allowing you to keep your online and offline shop's orders and stock control synchronised.
    7  * Version: 4.11
     7 * Version: 4.12
    88 * License: GPL2
    99 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • easify-server-woocommerce/trunk/includes/class-easify-wc-shop.php

    r1879096 r1932557  
    2828 *
    2929 * @class       Easify_Generic_Shop
    30  * @version     4.9
     30 * @version     4.12
    3131 * @package     easify-woocommerce-connector
    3232 * @author      Easify
     
    146146            if ($stockLevel > 0)
    147147            {
     148                $this->DeleteOutofStockTermRelationship($ProductId);                 
    148149                update_post_meta($ProductId, '_stock_status', 'instock');               
    149150            }
    150151            else
    151152            {
    152                  update_post_meta($ProductId, '_stock_status', 'outofstock');                   
     153                update_post_meta($ProductId, '_stock_status', 'outofstock');                   
    153154            }
    154155           
     
    292293            if ($stockLevel > 0)
    293294            {
     295                $this->DeleteOutofStockTermRelationship($ProductId);                                 
    294296                update_post_meta($ProductId, '_stock_status', 'instock');               
    295297            }
    296298            else
    297299            {
    298                  update_post_meta($ProductId, '_stock_status', 'outofstock');                   
     300                update_post_meta($ProductId, '_stock_status', 'outofstock');                   
    299301            }
    300302                       
     
    363365            if ($stockLevel > 0)
    364366            {
     367                $this->DeleteOutofStockTermRelationship($ProductId);                             
    365368                update_post_meta($ProductId, '_stock_status', 'instock');               
    366369            }
    367370            else
    368371            {
    369                  update_post_meta($ProductId, '_stock_status', 'outofstock');                   
     372                update_post_meta($ProductId, '_stock_status', 'outofstock');                   
    370373            }
    371374                                 
     
    381384    }
    382385
     386    private function DeleteOutofStockTermRelationship($product_id)
     387    {
     388        // 4.12 - WooCommerce inserts an 'outofstock' term when the final product is sold.
     389        // Delete term_relationships outofstock when stock becomes available...                           
     390        global $wpdb;
     391        $result = $wpdb->get_row("SELECT term_id FROM {$wpdb->terms} WHERE name = 'outofstock'");
     392        $term_id = $result->term_id;               
     393        $wpdb->query("DELETE FROM {$wpdb->term_relationships} WHERE object_id = " . $product_id . " and term_taxonomy_id = " . $term_id);       
     394    }
     395   
    383396    public function DeleteProduct($ProductSKU) {
    384397        Easify_Logging::Log("Easify_WC_Shop.DeleteProduct()");
     
    942955            Easify_Logging::Log('Easify_WC_Shop->SaveProductImagesToWooCommerce() - getting ready to process' . count($Images) . ' images.');
    943956 
    944             // Easify_Logging::Log($Images); // Dumps contents of image array to log         
     957            //Easify_Logging::Log($Images); // Dumps contents of image array to log         
    945958           
    946959            $imageIds = array();
  • easify-server-woocommerce/trunk/readme.txt

    r1900399 r1932557  
    55Requires at least: 4.0
    66Tested up to: 4.9
    7 Stable tag: 4.11
     7Stable tag: 4.12
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    100100
    101101== Changelog ==
     102= 4.12 =
     103* Fixed issue where products that go out of stock, and then come back into stock can be hidden from WooCommerce product search.
    102104= 4.11 =
    103105* Fixed basic authorisation could error out when activating plugin on certain
     
    136138
    137139== Upgrade Notice ==
    138 = 4.11 =
    139 * Fixed basic authorisation could error out when activating plugin on certain
    140 systems.
     140= 4.12 =
     141* Fixed issue where products that go out of stock, and then come back into stock
     142 can be hidden from WooCommerce product search.
Note: See TracChangeset for help on using the changeset viewer.