Преглед изворни кода

[Boutique] Abonnements : correctif

feature/souke
Guillaume Bourgeois пре 9 месеци
родитељ
комит
4b0d5b3816
2 измењених фајлова са 11 додато и 2 уклоњено
  1. +10
    -1
      producer/controllers/SubscriptionController.php
  2. +1
    -1
      producer/views/subscription/_form.php

+ 10
- 1
producer/controllers/SubscriptionController.php Прегледај датотеку

@@ -122,7 +122,7 @@ class SubscriptionController extends ProducerBaseController
}

/**
* Crée une commande récurrente.
* Crée un abonnement
*/
public function actionForm(int $id = 0)
{
@@ -131,6 +131,15 @@ class SubscriptionController extends ProducerBaseController
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', [
'idSubscription' => $id
]);

+ 1
- 1
producer/views/subscription/_form.php Прегледај датотеку

@@ -261,7 +261,7 @@ $orderModule = OrderModule::getInstance();
<?php if($idSubscription): ?>
<?php
$subscription = $subscriptionModule->findOneSubscriptionById($idSubscription);
$ordersIncomingSubscriptionArray = $orderModule->findOrdersIncomingBySubscription($subscription);
$ordersIncomingSubscriptionArray = $subscription ? $orderModule->findOrdersIncomingBySubscription($subscription) : null;
?>
<?php if($subscription && $ordersIncomingSubscriptionArray): ?>
<div class="alert alert-warning">

Loading…
Откажи
Сачувај