Plugin Directory

Changeset 3152807


Ignore:
Timestamp:
09/16/2024 03:57:59 PM (19 months ago)
Author:
shelfplanner
Message:

2.3.3

  • Fixed timestamp retrieval bug for empty values
Location:
shelf-planner/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • shelf-planner/trunk/readme.txt

    r3152227 r3152807  
    44Tested up to: 6.6
    55Requires PHP: 5.3
    6 Stable tag: 2.3.2
     6Stable tag: 2.3.3
    77Tags: Inventory Management,ABC Analysis,Demand Forecasting,Replenishment,Purchasing
    88License: GPLv2 or later
     
    9696== Changelog ==
    9797
     98= 2.3.3 =
     99- Fixed timestamp retrieval bug for empty values
     100
    98101= 2.3.2 =
    99102- Minor fixes
  • shelf-planner/trunk/shelf-planner.php

    r3152227 r3152807  
    1010 * Description:         AI-driven Stock Management, Demand Forecasting, Replenishment and Order Management for WooCommerce, all in one powerful tool.
    1111 *
    12  * Version:             2.3.2
     12 * Version:             2.3.3
    1313 * Author:              Shelf Planner
    1414 * Author URI:          https://www.shelfplanner.com
     
    3333 * Use SemVer - https://semver.org
    3434 */
    35 $shelf_planner_connector_version = "2.3.2";
     35$shelf_planner_connector_version = "2.3.3";
    3636define('SHELF_PLANNER_CONNECTOR_VERSION', $shelf_planner_connector_version);
    3737update_option('shelf_planner_connector_version', $shelf_planner_connector_version);
     
    284284
    285285        $tmpOrder['Id'] = '' . $orderId;
    286         $tmpOrder['DateCreated'] = $data['date_created']->getTimestamp();
    287         $tmpOrder['DateModified'] = $data['date_modified']->getTimestamp();
     286        $tmpOrder['DateCreated'] = isset($data['date_created']) ? $data['date_created']->getTimestamp() : null;
     287        $tmpOrder['DateModified'] = isset($data['date_modified']) ? $data['date_modified']->getTimestamp() : null;
    288288        $tmpOrder['CustomerId'] = '' . $data['customer_id'];
    289289        $tmpOrder['BillingCity'] = $data['billing']['city'];
     
    330330
    331331    /*return array(
    332                                                            'orderby'    => 'date',
    333                                                            'order'      => 'DESC',
    334                                                            'post_type'  => 'shop_order',
    335                                                            'limit'      => 2,
    336                                                            'meta_query' => [
    337                                                                [
    338                                                                    'key'     => "SHELF-PLANNER-CONNECTOR-SYNC",
    339                                                                    'value'   => 0,
    340                                                                    'compare' => 'NOT EXISTS',
    341                                                                ],
    342                                                            ],
    343                                                            'include' =>  $params['IDS']
    344                                                        );*/
     332                                                              'orderby'    => 'date',
     333                                                              'order'      => 'DESC',
     334                                                              'post_type'  => 'shop_order',
     335                                                              'limit'      => 2,
     336                                                              'meta_query' => [
     337                                                                  [
     338                                                                      'key'     => "SHELF-PLANNER-CONNECTOR-SYNC",
     339                                                                      'value'   => 0,
     340                                                                      'compare' => 'NOT EXISTS',
     341                                                                  ],
     342                                                              ],
     343                                                              'include' =>  $params['IDS']
     344                                                          );*/
    345345    /*$orders = wc_get_orders(array(
    346                                                            'include'    =>  array{106,207,83},
    347                                                            'orderby'    => 'date',
    348                                                            'order'      => 'DESC',
    349                                                            'post_type'  => 'shop_order',
    350                                                            'limit'      => 10
    351                                                           
    352                                                            
    353                                                        ));*/
     346                                                              'include'     =>  array{106,207,83},
     347                                                              'orderby'    => 'date',
     348                                                              'order'      => 'DESC',
     349                                                              'post_type'  => 'shop_order',
     350                                                              'limit'      => 10
     351                                                             
     352                                                               
     353                                                          ));*/
    354354
    355355    if ($orders) {
     
    386386
    387387    /*$args = array(
    388                                                'orderby' => 'name',
    389                                                'limit' => -1, // Retrieves all products
    390                                            );
    391                                            $products = wc_get_products($args);
    392                                        */
     388                                                  'orderby' => 'name',
     389                                                  'limit' => -1, // Retrieves all products
     390                                              );
     391                                              $products = wc_get_products($args);
     392                                          */
    393393    $tmpProduct = [];
    394394    $tmpSubProducts = [];
     
    405405        $tmpProduct['DateCreated'] = $product->get_date_created();
    406406        $tmpProduct['DateModified'] = $product->get_date_modified();
    407         $tmpProduct['DateCreatedTimestamp'] = $product->get_date_created()->getTimestamp();
    408         $tmpProduct['DateModifiedTimestamp'] = $product->get_date_modified()->getTimestamp();
     407        $tmpProduct['DateCreatedTimestamp'] = isset($tmpProduct['DateCreated']) ? $tmpProduct['DateCreated']->getTimestamp() : null;
     408        $tmpProduct['DateModifiedTimestamp'] = isset($tmpProduct['DateModified']) ? $tmpProduct['DateModified']->getTimestamp() : null;
    409409        $tmpProduct['SKU'] = $product->get_sku();
    410410        $tmpProduct['Price'] = $product->get_price();
Note: See TracChangeset for help on using the changeset viewer.