Browse Source

[Boutique] Abonnements : correctif

feature/souke
Guillaume Bourgeois 9 months ago
parent
commit
4b0d5b3816
2 changed files with 11 additions and 2 deletions
  1. +10
    -1
      producer/controllers/SubscriptionController.php
  2. +1
    -1
      producer/views/subscription/_form.php

+ 10
- 1
producer/controllers/SubscriptionController.php View File

} }


/** /**
* Crée une commande récurrente.
* Crée un abonnement
*/ */
public function actionForm(int $id = 0) public function actionForm(int $id = 0)
{ {
return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id])); return $this->redirect($this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producer', 'id' => $producer->id]));
} }


$subscriptionModule = $this->getSubscriptionModule();
if($id) {
$subscription = $subscriptionModule->getRepository()->findOneSubscriptionById($id);
if(!$subscription) {
$this->setFlash('error', 'Abonnement introuvable');
return $this->redirect(['subscription/index']);
}
}

return $this->render('form', [ return $this->render('form', [
'idSubscription' => $id 'idSubscription' => $id
]); ]);

+ 1
- 1
producer/views/subscription/_form.php View File

<?php if($idSubscription): ?> <?php if($idSubscription): ?>
<?php <?php
$subscription = $subscriptionModule->findOneSubscriptionById($idSubscription); $subscription = $subscriptionModule->findOneSubscriptionById($idSubscription);
$ordersIncomingSubscriptionArray = $orderModule->findOrdersIncomingBySubscription($subscription);
$ordersIncomingSubscriptionArray = $subscription ? $orderModule->findOrdersIncomingBySubscription($subscription) : null;
?> ?>
<?php if($subscription && $ordersIncomingSubscriptionArray): ?> <?php if($subscription && $ordersIncomingSubscriptionArray): ?>
<div class="alert alert-warning"> <div class="alert alert-warning">

Loading…
Cancel
Save