Browse Source

[producer] Correction bug fonction absente (base_url)

dev
Guillaume Bourgeois 5 years ago
parent
commit
8651e01aa3
4 changed files with 17 additions and 7 deletions
  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 View File

$newProductSubscription->price = $price; $newProductSubscription->price = $price;
} }
else { 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) { if(!$newProductSubscription->unit) {

+ 8
- 0
producer/web/js/producer.js View File

scrollTop: $("#"+id).offset().top}, scrollTop: $("#"+id).offset().top},
1000); 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 View File

use_credit: Number(this.useCredit) use_credit: Number(this.useCredit)
}).then(function(response) { }).then(function(response) {
if(response.data.status == 'success') { 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 View File

products: productsArray products: productsArray
} }
}).then(function(response) { }).then(function(response) {
window.location.href = chat_base_url(true)+'subscription/index' ;
window.location.href = opendistrib_base_url(true)+'subscription/index' ;
}); });
} }
}, },

Loading…
Cancel
Save