Parcourir la source

[producer] Correction bug fonction absente (base_url)

dev
Guillaume Bourgeois il y a 5 ans
Parent
révision
8651e01aa3
4 fichiers modifiés avec 17 ajouts et 7 suppressions
  1. +7
    -5
      common/models/SubscriptionForm.php
  2. +8
    -0
      producer/web/js/producer.js
  3. +1
    -1
      producer/web/js/vuejs/order-order.js
  4. +1
    -1
      producer/web/js/vuejs/subscription-form.js

+ 7
- 5
common/models/SubscriptionForm.php Voir le fichier

@@ -173,11 +173,13 @@ class SubscriptionForm extends Model
$newProductSubscription->price = $price;
}
else {
foreach($productsSubscriptionsArray as $productSubscription) {
if($productSubscription->id_product == $idProduct) {
$newProductSubscription->unit = $productSubscription->unit ;
$newProductSubscription->step = $productSubscription->step ;
$newProductSubscription->price = $productSubscription->price ;
if(isset($productsSubscriptionsArray) && is_array($productsSubscriptionsArray)) {
foreach($productsSubscriptionsArray as $productSubscription) {
if($productSubscription->id_product == $idProduct) {
$newProductSubscription->unit = $productSubscription->unit ;
$newProductSubscription->step = $productSubscription->step ;
$newProductSubscription->price = $productSubscription->price ;
}
}
}
if(!$newProductSubscription->unit) {

+ 8
- 0
producer/web/js/producer.js Voir le fichier

@@ -104,3 +104,11 @@ function opendistrib_scroll(id) {
scrollTop: $("#"+id).offset().top},
1000);
}

function opendistrib_base_url(with_slug) {
var base_url = $('meta[name=base-url]').attr('content')+'/' ;
if(with_slug) {
base_url += $('meta[name=slug-producer]').attr('content')+'/' ;
}
return base_url ;
}

+ 1
- 1
producer/web/js/vuejs/order-order.js Voir le fichier

@@ -321,7 +321,7 @@ var app = new Vue({
use_credit: Number(this.useCredit)
}).then(function(response) {
if(response.data.status == 'success') {
window.location.href = chat_base_url(true)+'order/confirm?idOrder='+response.data.idOrder ;
window.location.href = opendistrib_base_url(true)+'order/confirm?idOrder='+response.data.idOrder ;
}
});
},

+ 1
- 1
producer/web/js/vuejs/subscription-form.js Voir le fichier

@@ -221,7 +221,7 @@ var app = new Vue({
products: productsArray
}
}).then(function(response) {
window.location.href = chat_base_url(true)+'subscription/index' ;
window.location.href = opendistrib_base_url(true)+'subscription/index' ;
});
}
},

Chargement…
Annuler
Enregistrer