'.em-add-to-card'
window.dataLayer.push({
"ecommerce": {
"add": {
$('.em-add-to-card').mouseup(function(){
window.dataLayer.push({
"ecommerce": {
"add": {
"products": [
{
"id": "4580",
"name" : "Название",
"price": "Цена",
"brand": "Бренд",
"category": "Категория"
}
]
}
}
});
$parts = Part::whereHas('categories', function ($query) use ($category) {
return $query->where('pivot_part_categories.id', $category->id);
})->whereHas('brand', function ($query) use ($brand) {
return $query->where('brand_id', $brand->id);
})->get();
$brand = $this->findBrandBySlug($brand); // Получил бренд
$brand_categories = PartCategory::whereHas('parts', function($query) use ($brand) {
return $query->whereHas('brand', function($query) use ($brand) {
return $query->where('brand_id', $brand->id);
});
})->orderBy('created_at', 'desc')->get();
foreach($brand_categories as $category)
{
dump($category->name);
}
vagrant@homestead:~/projects/autoshop$ git remote -v
origin ssh://git@github.com:пользователь/autoparts.git (fetch)
origin ssh://git@github.com:пользователь/autoparts.git (push)
PING github.com (140.82.118.3) 56(84) bytes of data.
64 bytes from lb-140-82-118-3-ams.github.com (140.82.118.3): icmp_seq=1 ttl=50 time=165 ms
64 bytes from lb-140-82-118-3-ams.github.com (140.82.118.3): icmp_seq=2 ttl=50 time=161 ms
64 bytes from lb-140-82-118-3-ams.github.com (140.82.118.3): icmp_seq=3 ttl=50 time=161 ms
64 bytes from lb-140-82-118-3-ams.github.com (140.82.118.3): icmp_seq=4 ttl=50 time=161 ms
64 bytes from lb-140-82-118-3-ams.github.com (140.82.118.3): icmp_seq=5 ttl=50 time=161 ms
64 bytes from lb-140-82-118-3-ams.github.com (140.82.118.3): icmp_seq=6 ttl=50 time=161 ms
64 bytes from lb-140-82-118-3-ams.github.com (140.82.118.3): icmp_seq=7 ttl=50 time=161 ms
64 bytes from lb-140-82-118-3-ams.github.com (140.82.118.3): icmp_seq=8 ttl=50 time=161 ms
64 bytes from lb-140-82-118-3-ams.github.com (140.82.118.3): icmp_seq=9 ttl=50 time=161 ms
git remote -v