Add Woo Manager Pro with multi-store switching and free-tier limits.
Deploy Ladill Woo Manager / deploy (push) Successful in 51s
Deploy Ladill Woo Manager / deploy (push) Successful in 51s
Free: 1 store and 20 products. Pro/Business mirrors Invoice pricing (GHS 49/149) with wallet renewals, Paystack prepay, session-based store switcher, and scoped UI. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Woo\ProSubscription;
|
||||
use App\Services\Woo\SubscriptionService;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class RenewProSubscriptionsCommand extends Command
|
||||
{
|
||||
protected $signature = 'woo:pro-renew';
|
||||
|
||||
protected $description = 'Renew due Woo Manager Pro/Business subscriptions from wallet balance';
|
||||
|
||||
public function handle(SubscriptionService $subscriptions): int
|
||||
{
|
||||
if (! $subscriptions->gatingActive()) {
|
||||
$this->info('Woo Pro gating is disabled or billing is not configured.');
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
|
||||
$due = ProSubscription::query()
|
||||
->where('status', ProSubscription::STATUS_ACTIVE)
|
||||
->where('auto_renew', true)
|
||||
->whereNotNull('current_period_end')
|
||||
->where('current_period_end', '<=', now())
|
||||
->get();
|
||||
|
||||
foreach ($due as $subscription) {
|
||||
$subscriptions->renewIfDue($subscription);
|
||||
}
|
||||
|
||||
$this->info('Processed '.$due->count().' subscription(s).');
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user