This commit is contained in:
ludo
2024-02-19 23:51:32 +01:00
parent 15a6621a56
commit 869b148e20
18 changed files with 440 additions and 85 deletions

View File

@@ -3,11 +3,9 @@
namespace App\Repositories\Shop;
use App\Models\Shop\Article;
use App\Models\Shop\Merchandise;
use App\Repositories\Botanic\Species;
use App\Repositories\Botanic\Varieties;
use App\Repositories\Core\Comments;
use App\Repositories\Core\Tag;
use App\Traits\Model\Basic;
use App\Traits\Repository\Imageable;
use Illuminate\Support\Str;
@@ -27,6 +25,11 @@ class Articles
return $export;
}
public static function getIDBySlug($slug)
{
return Article::bySlug($slug)->first()->id;
}
public static function getOffersGroupedByNature($id, $saleChannelId = false)
{
$articleIds = ArticleSiblings::getSiblingsIds($id);
@@ -178,6 +181,7 @@ class Articles
'product_name' => $article->product->name,
'parent_name' => trim(str_replace($article->product->name, '', $article->name)),
'offers' => $article->offers->toArray(),
'slug' => $article->slug,
];
}