This commit is contained in:
paoloar77
2024-05-20 08:38:48 +02:00
parent 7ea01d7b35
commit abca889fc0
2 changed files with 34 additions and 5 deletions

View File

@@ -75,8 +75,11 @@ function setPreOrder($sku, $aggiornapreordine, $debug)
// showarray($article);
if ($debug)
if ($debug) {
echo "Product: " . $sku;
showarray($product);
}
$campoPreOrder = '_wpro_variable_is_preorder';
@@ -157,7 +160,7 @@ function setPreOrder($sku, $aggiornapreordine, $debug)
}
$variation = Variation::update($idprodotto, $product['id'], $data);
// Product::update($idprodotto, $data);
if ($variation) {
if ($debug)
echo "Aggiornato Preorder: [ParentId=" . $idprodotto . '] ProdId= ' . $product['id'] . ' ' . $variation['name'] . "<br>";
@@ -173,11 +176,11 @@ function setPreOrder($sku, $aggiornapreordine, $debug)
}
}
function isArticleInPrevendita($idarticolo) {
function isArticleInPrevendita($sku) {
$product = Product::where('sku', $idarticolo)->first();
$product = Product::where('sku', $sku)->first();
$article = Article::where('IdArticolo', $idarticolo)->first();
$article = Article::where('IdArticolo', $sku)->first();
$qtaneg = $article->QtaDisponibile < 0;