aa
This commit is contained in:
190
routes/web.php
190
routes/web.php
@@ -703,7 +703,7 @@ Route::get('/artlibronuovo', function () {
|
|||||||
echo "Finito";
|
echo "Finito";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
Route::get('/artlibrousato', function () {
|
Route::get('/artlibrousato', function () {
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
$articles = Article::join(DB::raw('(SELECT IdArticolo, MAX(DataOra) AS data FROM T_WEB_Articoli GROUP BY IdArticolo) b'), function ($join) {
|
$articles = Article::join(DB::raw('(SELECT IdArticolo, MAX(DataOra) AS data FROM T_WEB_Articoli GROUP BY IdArticolo) b'), function ($join) {
|
||||||
@@ -816,196 +816,12 @@ Route::get('/artlibrousato', function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//echo $isbnproduct . ' '. $article->Ean13 .'<br>';
|
|
||||||
/*
|
|
||||||
if(substr($isbnproduct,5) == substr($article->Ean13,5))
|
|
||||||
{
|
|
||||||
echo $product['id']. ' '.$product['name'].' '.$isbnproduct. ' '.$article->Ean13.' '. $titolo . ' ' .$article->IdArticolo. '<br>' ;
|
|
||||||
/*
|
|
||||||
$data1 = [
|
|
||||||
|
|
||||||
'regular_price' => $article->PrezzoIvato,
|
|
||||||
'sku' => $article->IdArticolo,
|
|
||||||
'sale_price' => $article->PrezzoIvatoScontatoCampagna,
|
|
||||||
'date_on_sale_from' => $article->DataInizioCampagna,
|
|
||||||
'date_on_sale_to' => $article->DataFineCampagna,
|
|
||||||
'manage_stock' => true,
|
|
||||||
'stock_quantity' => $article->stock,
|
|
||||||
|
|
||||||
'attributes' => [
|
|
||||||
[
|
|
||||||
'name' => 'Versione Libro',
|
|
||||||
'option' => 'Usato'
|
|
||||||
]
|
|
||||||
|
|
||||||
],
|
|
||||||
'meta_data' => [
|
|
||||||
[
|
|
||||||
'key' => 'ISBN',
|
|
||||||
'value' => $article->Ean13
|
|
||||||
]
|
|
||||||
]
|
|
||||||
];
|
|
||||||
Variation::create($product['id'],$data1);
|
|
||||||
*/
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
$productsku = Product::where('sku',$article->IdArticolo)->first();
|
|
||||||
if($productsku->count() == 0){
|
|
||||||
$category = Category::where('name',$article->argomento);
|
|
||||||
if($category->count() > 0 ) {
|
|
||||||
$categoria = $category->first();
|
|
||||||
$categoriaid =$categoria['id'];
|
|
||||||
} else {
|
|
||||||
$categoriaid = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$data = [
|
|
||||||
|
|
||||||
'name' => $article->Titolo,
|
|
||||||
'type' => 'variable',
|
|
||||||
|
|
||||||
'categories' => [
|
|
||||||
[ 'id' => $categoriaid ]
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
//'description' => 'Simple product full description.',
|
|
||||||
//'short_description' => 'Simple product short description.',
|
|
||||||
|
|
||||||
|
|
||||||
'attributes' => [
|
|
||||||
|
|
||||||
[
|
|
||||||
'name' => 'Versione Libro',
|
|
||||||
'position' => 0,
|
|
||||||
'visible' => true,
|
|
||||||
'variation' => true,
|
|
||||||
'options' => [
|
|
||||||
'Nuovo',
|
|
||||||
'Usato'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
|
|
||||||
[
|
|
||||||
'id' => 5,
|
|
||||||
'visible' => true,
|
|
||||||
|
|
||||||
'options' =>
|
|
||||||
$article->authors
|
|
||||||
|
|
||||||
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'id' => 2,
|
|
||||||
'visible' => true,
|
|
||||||
|
|
||||||
'options' => [
|
|
||||||
$article->editore
|
|
||||||
|
|
||||||
]
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'name' => 'Tipologia',
|
|
||||||
'visible' => true,
|
|
||||||
|
|
||||||
'options' => [
|
|
||||||
$article->DescrizioneTipologia
|
|
||||||
|
|
||||||
]
|
|
||||||
]
|
|
||||||
],
|
|
||||||
|
|
||||||
'default_attributes' => [
|
|
||||||
[
|
|
||||||
'name' => 'Versione Libro',
|
|
||||||
'option' => 'Nuovo'
|
|
||||||
]
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
'meta_data' => [
|
|
||||||
[
|
|
||||||
'key' => 'pagine',
|
|
||||||
'value' => $article->Pagine
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'key' => 'edizione',
|
|
||||||
'value' => $article->Edizione
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'key' => 'ristampa',
|
|
||||||
'value' => $article->Ristampa
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'key' => 'misure',
|
|
||||||
'value' => $article->Misure
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'key' => 'isbn',
|
|
||||||
'value' => $article->Ean13
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'key' => 'formato',
|
|
||||||
'value' => $article->DescrizioneFormato
|
|
||||||
],
|
|
||||||
]
|
|
||||||
|
|
||||||
];
|
|
||||||
if($productsku->count() == 0){
|
|
||||||
$product = Product::create($data);
|
|
||||||
|
|
||||||
$idprodotto= $product['id'];
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$idprodotto = $productsku['parent_id'];
|
|
||||||
Product::update($idprodotto,$data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$data1 = [
|
|
||||||
|
|
||||||
'regular_price' => $article->PrezzoIvato,
|
|
||||||
'sku' => $article->IdArticolo,
|
|
||||||
'sale_price' => $article->PrezzoIvatoScontatoCampagna,
|
|
||||||
'date_on_sale_from' => $article->DataInizioCampagna,
|
|
||||||
'date_on_sale_to' => $article->DataFineCampagna,
|
|
||||||
'manage_stock' => true,
|
|
||||||
'stock_quantity' => $article->stock,
|
|
||||||
|
|
||||||
'attributes' => [
|
|
||||||
[
|
|
||||||
'name' => 'Versione Libro',
|
|
||||||
'option' => 'Nuovo'
|
|
||||||
]
|
|
||||||
|
|
||||||
],
|
|
||||||
'meta_data' => [
|
|
||||||
[
|
|
||||||
'key' => 'ISBN',
|
|
||||||
'value' => $article->Ean13
|
|
||||||
]
|
|
||||||
]
|
|
||||||
];
|
|
||||||
if($productsku->count() > 0){
|
|
||||||
$variation = Variation::update($idprodotto,$productsku['id'], $data1);
|
|
||||||
} else {
|
|
||||||
$variation = Variation::create($idprodotto, $data1);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
echo "Finito";
|
echo "Finito";
|
||||||
});
|
}); */
|
||||||
|
|
||||||
Route::get(
|
Route::get(
|
||||||
'/test2',
|
'/test2',
|
||||||
function () {
|
function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user