Browse Source

Fix : erreur 500 ajax page commande

L'url ne comprenait pas le slug du producteur.
dev
keun 6 years ago
parent
commit
baf0d85239
2 changed files with 9 additions and 4 deletions
  1. +1
    -0
      producer/views/layouts/main.php
  2. +8
    -4
      producer/web/js/lechatdesnoisettes.js

+ 1
- 0
producer/views/layouts/main.php View File

<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="base-url" content="<?= Yii::$app->urlManager->baseUrl ; ?>"> <meta name="base-url" content="<?= Yii::$app->urlManager->baseUrl ; ?>">
<meta name="slug-producer" content="<?= $producer->slug ; ?>">
<?= Html::csrfMetaTags() ?> <?= Html::csrfMetaTags() ?>
<link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon4.png" /> <link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon4.png" />
<?php $this->head() ?> <?php $this->head() ?>

+ 8
- 4
producer/web/js/lechatdesnoisettes.js View File

}) ;*/ }) ;*/
} }


function chat_base_url() {
return $('meta[name=base-url]').attr('content')+'/' ;
function chat_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 ;
} }


function chat_systeme_commande() { function chat_systeme_commande() {
$('#modal-code form').submit(function() { $('#modal-code form').submit(function() {
var id_pv = $('#modal-code #id-point-vente').val() ; var id_pv = $('#modal-code #id-point-vente').val() ;
var code = $('#modal-code #code').val() ; var code = $('#modal-code #code').val() ;
$.get(chat_base_url()+'commande/verif-code-point-vente',{
$.get(chat_base_url(true)+'commande/verif-code-point-vente',{
id_point_vente: id_pv, id_point_vente: id_pv,
code: code code: code
}, function(ok) { }, function(ok) {


function chat_systeme_commande_produits_dispos(str_date, date) { function chat_systeme_commande_produits_dispos(str_date, date) {
// produits dispos à la vente à cette date // produits dispos à la vente à cette date
$.get(chat_base_url()+'commande/infos-production',{
$.get(chat_base_url(true)+'commande/infos-production',{
id_production: $('#commande-id_production').val() id_production: $('#commande-id_production').val()
}, function(data) { }, function(data) {

Loading…
Cancel
Save