Changeset 2891776
- Timestamp:
- 04/01/2023 10:26:45 AM (3 years ago)
- Location:
- sitepack-connect
- Files:
-
- 5 edited
- 13 copied
-
tags/1.0.2 (copied) (copied from sitepack-connect/trunk)
-
tags/1.0.2/assets (copied) (copied from sitepack-connect/trunk/assets)
-
tags/1.0.2/class.sitepack-connect-admin.php (copied) (copied from sitepack-connect/trunk/class.sitepack-connect-admin.php)
-
tags/1.0.2/class.sitepack-connect-rest-api.php (copied) (copied from sitepack-connect/trunk/class.sitepack-connect-rest-api.php)
-
tags/1.0.2/class.sitepack-connect-stock.php (copied) (copied from sitepack-connect/trunk/class.sitepack-connect-stock.php)
-
tags/1.0.2/class.sitepack-connect.php (copied) (copied from sitepack-connect/trunk/class.sitepack-connect.php)
-
tags/1.0.2/images (copied) (copied from sitepack-connect/trunk/images)
-
tags/1.0.2/index.php (copied) (copied from sitepack-connect/trunk/index.php)
-
tags/1.0.2/models (copied) (copied from sitepack-connect/trunk/models)
-
tags/1.0.2/readme.txt (copied) (copied from sitepack-connect/trunk/readme.txt)
-
tags/1.0.2/services (copied) (copied from sitepack-connect/trunk/services)
-
tags/1.0.2/sitepack-connect.php (copied) (copied from sitepack-connect/trunk/sitepack-connect.php)
-
tags/1.0.2/views (copied) (copied from sitepack-connect/trunk/views)
-
trunk/class.sitepack-connect.php (modified) (1 diff)
-
trunk/models/class.sitepack-category.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/services/class.sitepack-woocommerce.php (modified) (2 diffs)
-
trunk/sitepack-connect.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sitepack-connect/trunk/class.sitepack-connect.php
r2891775 r2891776 4 4 { 5 5 6 private static ?SitePackConnect $instance = null; 7 8 public static function getInstance(): SitePackConnect 6 public static function init() 9 7 { 10 if (!isset(self::$instance)) {11 self::$instance = new SitePackConnect();12 13 self::$instance->init();14 }15 16 return self::$instance;17 8 } 18 9 19 public static function init()10 public function fetchLiveStock(string $importSource, string $ean) 20 11 { 21 22 }23 24 public function fetchLiveStock(string $importSource, string $ean): array25 {26 27 28 12 } 29 13 -
sitepack-connect/trunk/models/class.sitepack-category.php
r2891775 r2891776 76 76 } 77 77 78 /**79 * @return string80 */81 public function getCategoryMain(): string82 {83 return $this->categoryMain;84 }85 86 /**87 * @return string88 */89 public function getCategorySub(): string90 {91 return $this->categorySub;92 }93 94 /**95 * @return string96 */97 public function getCategorySubSub(): string98 {99 return $this->categorySubSub;100 }101 102 78 public function jsonSerialize(): array 103 79 { -
sitepack-connect/trunk/readme.txt
r2891775 r2891776 4 4 Requires at least: 5.0 5 5 Tested up to: 6.1.1 6 Stable tag: 1. 1.06 Stable tag: 1.0.2 7 7 License: GPLv2 or later 8 8 … … 21 21 22 22 == Changelog == 23 24 = 1.1.0 =25 26 Release date: 2023-04-0327 28 #### Enhancements29 30 * You can use the spGetProductStockInformation(int $productId) method to get the live stock information of a product and their related stock locations31 32 #### Bugfixes33 34 * Stock implementation call bugfix in REST API35 23 36 24 = 1.0.2 = -
sitepack-connect/trunk/services/class.sitepack-woocommerce.php
r2891775 r2891776 72 72 $product->set_stock_quantity(0); 73 73 $product->set_stock_status('outofstock'); 74 if ( (bool)$data['hasStock'] === true || (int)$data['inStock'] >= 1) {74 if ($data['hasStock'] === true) { 75 75 $product->set_stock_status('instock'); 76 76 … … 79 79 } 80 80 81 $product->set_stock_quantity( (int)$data['inStock'] + (int)$data['stockSupplier']);81 $product->set_stock_quantity($data['inStock'] + $data['stockSupplier']); 82 82 83 83 if ($product->get_stock_quantity() < 1) { -
sitepack-connect/trunk/sitepack-connect.php
r2891775 r2891776 8 8 Plugin URI: https://sitepack.nl/integraties 9 9 Description: Connect your eCommerce store with external APIs, using SitePack Connect. Import products with stock information and export orders to your favorite third party software. 10 Version: 1. 1.010 Version: 1.0.2 11 11 Author: SitePack B.V. 12 12 Author URI: https://sitepack.nl … … 49 49 } 50 50 } 51 52 if (!function_exists('spGetProductStockInformation')) {53 /**54 * Fetch the live stock information55 *56 * @param int $productId57 * @return array58 */59 function spGetProductStockInformation(int $productId): array60 {61 $connect = SitePackConnect::getInstance();62 63 $product = new WC_Product_Simple($productId);64 var_dump($product->read_meta_data());65 exit;66 67 return $connect->fetchLiveStock('w', 'ewf');68 }69 }70 71 add_action('init', 'fetchStock');72 73 function fetchstock()74 {75 // spGetProductStockInformation(42);76 }77
Note: See TracChangeset
for help on using the changeset viewer.