Bläddra i källkod

[producer] Correction bug fonction absente (base_url)

dev
Guillaume Bourgeois 5 år sedan
förälder
incheckning
8651e01aa3
4 ändrade filer med 17 tillägg och 7 borttagningar
  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 Visa fil

@@ -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 Visa fil

@@ -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 Visa fil

@@ -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 Visa fil

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

Laddar…
Avbryt
Spara