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