feat: Implement upsell functionality with repository and service layers

This commit is contained in:
2026-05-02 23:30:23 +03:30
parent 4928901a08
commit 5930c1ad6f
26 changed files with 3130 additions and 126 deletions

View File

@@ -5,12 +5,16 @@ if (!defined('ABSPATH')) {
}
use Sodino\Services\PricingService;
use Sodino\Services\TrackingService;
use Sodino\Repositories\RuleRepository;
use Sodino\Repositories\EventRepository;
// Initialize pricing service
global $sodino_pricing_service;
$ruleRepository = new RuleRepository();
$sodino_pricing_service = new PricingService($ruleRepository);
$eventRepository = new EventRepository();
$trackingService = new TrackingService($eventRepository);
$sodino_pricing_service = new PricingService($ruleRepository, $trackingService);
// Hook into WooCommerce price filter
add_filter('woocommerce_product_get_price', 'sodino_apply_dynamic_pricing', 10, 2);