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