feat: Implement Siti Stock Plugin for WooCommerce integration
- Added core plugin structure with main class Siti_Stock_Plugin. - Implemented settings management through Siti_Stock_Settings. - Developed admin interface for settings configuration via Siti_Stock_Admin. - Created inventory management with external stock handling in Siti_Stock_Inventory_Manager. - Integrated synchronization service to fetch and apply stock updates from external API in Siti_Stock_Sync_Service. - Added custom product data store to manage combined stock values in Siti_Stock_Product_Data_Store. - Registered hooks for admin menus, settings, and synchronization processes. - Implemented REST API endpoint for triggering stock sync. - Added cron scheduling for automatic stock synchronization. - Included localization support for Dutch language.
This commit is contained in:
50
siti-stock-plugin.php
Normal file
50
siti-stock-plugin.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: Siti Stock Plugin
|
||||
* Plugin URI: https://github.com/SitiWeb/siti-stock-plugin
|
||||
* Description: Synchroniseert WooCommerce voorraad met het externe Siti voorraadplatform.
|
||||
* Version: 0.1.0
|
||||
* Author: Siti Web
|
||||
* Author URI: https://www.siti.nl
|
||||
* Requires PHP: 8.1
|
||||
* Requires at least: 6.4
|
||||
* Text Domain: siti-stock-plugin
|
||||
* Domain Path: /languages
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
define( 'SITI_STOCK_PLUGIN_VERSION', '0.1.0' );
|
||||
define( 'SITI_STOCK_PLUGIN_FILE', __FILE__ );
|
||||
define( 'SITI_STOCK_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
||||
|
||||
require_once __DIR__ . '/includes/class-siti-stock-plugin.php';
|
||||
require_once __DIR__ . '/SitiWebUpdater.php';
|
||||
|
||||
register_activation_hook( __FILE__, array( 'Siti_Stock_Plugin', 'activate' ) );
|
||||
register_deactivation_hook( __FILE__, array( 'Siti_Stock_Plugin', 'deactivate' ) );
|
||||
|
||||
add_action(
|
||||
'init',
|
||||
function () {
|
||||
load_plugin_textdomain( 'siti-stock-plugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
|
||||
}
|
||||
);
|
||||
|
||||
Siti_Stock_Plugin::instance();
|
||||
|
||||
add_action(
|
||||
'admin_init',
|
||||
function () {
|
||||
if ( ! class_exists( 'SitiWebUpdater' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$updater = new SitiWebUpdater( __FILE__ );
|
||||
$updater->set_username( 'SitiWeb' );
|
||||
$updater->set_repository( 'siti-stock-plugin' );
|
||||
$updater->initialize();
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user