Plugin Details
Home / Plug-in market / Product Inventory Change Monitoring and Management
Product Inventory Change Monitoring and Management
Plugin Overview
The plugin automatically records the history of product inventory changes, ensuring accuracy and transparency of inventory data. When the administrator adjusts inventory in the backend or when a customer completes a purchase, the system will update the inventory records in real-time.
Merchants can clearly view the inventory changes for each product, helping them achieve more refined product management and improving operational efficiency.
Key Features
-
Real-time Inventory Record: Automatically records every inventory change, including adjustments made by the administrator and purchases made by customers, ensuring data integrity.
-
Historical Query: Provides detailed historical inventory changes, supporting queries by time, product, and other dimensions for easy traceability.
Plugin Usage Preview
-
Inventory Change Information View Page
-
Product Management Page
Installation and Configuration Instructions
Note: This plugin is compatible with BeikeShop versions 1.6.0.4 and above. If your BeikeShop version is 1.6.0.3 or below, please follow the steps below to modify the code:
-
Open the file
\beike\Services\StateMachineService.php
, search for the line:$productSku->decrement('quantity', $orderProduct->quantity);
Then, add the following code:
hook_action('service.state_machine.sub_stock.after', ['sku' => $orderProduct->productSku, 'quantity' => -$orderProduct->quantity]);
-
Open the file
\beike\Admin\Services\ProductService.php
, search for the line:DB::beginTransaction();
Then, add the following code:
hook_action('admin.service.product.create_or_update.before', ['product' => $product, 'data' => $data]);
After completing these modifications, the plugin will work normally in your system.