Bladeren bron

[producer] Correction bug fonction absente (base_url)

refactoring
Guillaume Bourgeois 5 jaren geleden
bovenliggende
commit
8651e01aa3
4 gewijzigde bestanden met toevoegingen van 17 en 7 verwijderingen
  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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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' ;
});
}
},

Laden…
Annuleren
Opslaan