Changeset 3336438
- Timestamp:
- 07/30/2025 09:08:41 AM (8 months ago)
- Location:
- product-feeder
- Files:
-
- 13 added
- 2 edited
-
tags/4.1.0/includes/product-feeder.php (modified) (1 diff)
-
tags/4.1.1 (added)
-
tags/4.1.1/includes (added)
-
tags/4.1.1/includes/css (added)
-
tags/4.1.1/includes/css/product-feeder.css (added)
-
tags/4.1.1/includes/javascript (added)
-
tags/4.1.1/includes/javascript/product-feeder.js (added)
-
tags/4.1.1/includes/product-feeder.php (added)
-
tags/4.1.1/languages (added)
-
tags/4.1.1/languages/product-feeder-nl_NL.mo (added)
-
tags/4.1.1/languages/product-feeder-nl_NL.po (added)
-
tags/4.1.1/product-feeder.php (added)
-
tags/4.1.1/readme.txt (added)
-
tags/4.1.1/uninstall.php (added)
-
trunk/includes/product-feeder.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
product-feeder/tags/4.1.0/includes/product-feeder.php
r3199369 r3336438 8 8 //cd product-feeder 9 9 //COPY NEW VERSION FILES TO /tags/{VERSION} 10 //svn add /tags/{VERSION}10 //svn add tags/{VERSION} 11 11 //svn status 12 12 //svn commit -m "Updated to version X" -
product-feeder/trunk/includes/product-feeder.php
r3199369 r3336438 1 1 <?php 2 3 //TODO REMOVE4 //https://developer.woocommerce.com/docs/hpos-extension-recipe-book/?_gl=1*1886zt6*_gcl_au*MTM0NTQzNjEwMS4xNzMyMjg0NTI5*_ga*MTEwNzU0OTg3NC4xNzMyMjcyMjU2*_ga_98K30SHWB2*MTczMjcyODkzMC4yLjAuMTczMjcyODkzMC4wLjAuMA..5 6 2 use Automattic\WooCommerce\Utilities\OrderUtil; 7 3 use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController; … … 12 8 //cd product-feeder 13 9 //COPY NEW VERSION FILES TO /tags/{VERSION} 14 //svn add /tags/{VERSION}10 //svn add tags/{VERSION} 15 11 //svn status 16 12 //svn commit -m "Updated to version X" … … 340 336 } 341 337 342 private function APIError($Error, $Code = 400 ) {338 private function APIError($Error, $Code = 400, $Data = array()) { 343 339 if ($Code == 0) $Code = 400; 344 340 header("Content-type: application/json"); 345 341 if (preg_match("/(200|^4|^5)/", $Code)) http_response_code($Code); 346 wp_send_json(array("Status" => "Error", "Error" => $Error, 'Version' => $this->Version), $Code); 342 if (!empty($Data)) wp_send_json(array("Status" => "Error", "Error" => $Error, 'Data' => $Data, 'Version' => $this->Version), $Code); 343 else wp_send_json(array("Status" => "Error", "Error" => $Error, 'Version' => $this->Version), $Code); 347 344 } 348 345 … … 370 367 371 368 public function Connect($Request) { 369 $MissingSettings = array(); 372 370 $this->ValidateAPIKey($Request); 373 if ( 374 empty(get_option("product-feeder-product-statuses")) || 375 empty(get_option("product-feeder-sizes")) || 376 empty(get_option("product-feeder-brand")) || 377 empty(get_option("product-feeder-default-order-status")) || 378 empty(get_option("product-feeder-accepted-order-statuses")) || 379 empty(get_option("product-feeder-rejected-order-statuses")) 380 ) $this->APIError('Invalid settings', 403); 371 foreach (['product-feeder-product-statuses', 'product-feeder-sizes', 'product-feeder-brand', 'product-feeder-default-order-status', 'product-feeder-accepted-order-statuses', 'product-feeder-rejected-order-statuses'] as $Name) { 372 if (empty(get_option($Name))) $MissingSettings[] = $Name; 373 } 374 if (!empty($MissingSettings)) $this->APIError('Invalid settings', 403, $MissingSettings); 381 375 $this->APISuccess(); 382 376 }
Note: See TracChangeset
for help on using the changeset viewer.