Merge branch 'elektronika' of http://git.digital-tps.tk/TPS/elektronika_bagisto into elektronika
This commit is contained in:
commit
62d7dc9d7f
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Set your MeiliSearch API key
|
||||
API_KEY="YoUrV3ry-S3cur3-aP1k3Y"
|
||||
|
||||
# Set your MeiliSearch instance URL
|
||||
MEILISEARCH_URL="http://127.0.0.1:7700"
|
||||
|
||||
# Set the index name
|
||||
INDEX_NAME="products"
|
||||
|
||||
# Set the attribute you want to make sortable
|
||||
SORTABLE_ATTRIBUTE='"id","created_at","name","price","min_price"'
|
||||
|
||||
# Create JSON payload for settings update
|
||||
SETTINGS_JSON='{
|
||||
"sortableAttributes": ['$SORTABLE_ATTRIBUTE']
|
||||
}'
|
||||
|
||||
# Update index settings using cURL
|
||||
curl -X PATCH "$MEILISEARCH_URL/indexes/$INDEX_NAME/settings" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $API_KEY" \
|
||||
-d "$SETTINGS_JSON"
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Set your MeiliSearch API key
|
||||
API_KEY="YoUrV3ry-S3cur3-aP1k3Y"
|
||||
|
||||
# Set your MeiliSearch instance URL
|
||||
MEILISEARCH_URL="http://127.0.0.1:7700"
|
||||
|
||||
# Set the index name
|
||||
INDEX_NAME="products"
|
||||
|
||||
# Get index settings using cURL
|
||||
curl "$MEILISEARCH_URL/indexes/$INDEX_NAME/settings" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $API_KEY"
|
||||
|
|
@ -1 +0,0 @@
|
|||
../vendor/bin/codecept
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
* Codeception CLI
|
||||
*/
|
||||
|
||||
require __DIR__ . '/app.php';
|
||||
|
|
@ -28,11 +28,12 @@
|
|||
"konekt/concord": "^1.2",
|
||||
"laravel/framework": "^9.0",
|
||||
"laravel/sanctum": "^2.12",
|
||||
"laravel/scout": "^9.0",
|
||||
"laravel/scout": "^10.2",
|
||||
"laravel/socialite": "^5.0",
|
||||
"laravel/tinker": "^2.0",
|
||||
"laravel/ui": "^3.0",
|
||||
"maatwebsite/excel": "^3.1.26",
|
||||
"meilisearch/meilisearch-php": "^1.3",
|
||||
"paypal/paypal-checkout-sdk": "1.0.1",
|
||||
"prettus/l5-repository": "^2.6",
|
||||
"pusher/pusher-php-server": "^7.0",
|
||||
|
|
@ -159,7 +160,10 @@
|
|||
"config": {
|
||||
"preferred-install": "stable",
|
||||
"sort-packages": true,
|
||||
"optimize-autoloader": true
|
||||
"optimize-autoloader": true,
|
||||
"allow-plugins": {
|
||||
"php-http/discovery": true
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -188,22 +188,6 @@ for (let i = 0; i < accordionTrigger.length; i++) {
|
|||
|
||||
// ACCORDION SCRIPT end ==========================
|
||||
|
||||
// ITEM SELECT ADDITIONAL INPUT ==========================
|
||||
let sBox = document.querySelector('.item-select');
|
||||
let addedInputBlock = document.querySelector('.part-hidden');
|
||||
let addedInput = document.querySelector('.focused');
|
||||
|
||||
sBox.addEventListener('change', (e) => {
|
||||
if (e.target.selectedIndex === 10) {
|
||||
addedInputBlock.classList.add('active');
|
||||
addedInput.focus();
|
||||
} else {
|
||||
addedInputBlock.classList.remove('active');
|
||||
}
|
||||
});
|
||||
|
||||
// ITEM SELECT ADDITIONAL INPUT end ======================
|
||||
|
||||
// CAT DROPDOWN
|
||||
|
||||
const catParent = document.querySelector('.service-li.active');
|
||||
|
|
@ -268,3 +252,13 @@ lis.forEach((el) => {
|
|||
el.classList.add('active');
|
||||
});
|
||||
});
|
||||
|
||||
// NEW SCRIPT
|
||||
|
||||
const button_1 = document.querySelector('.buttons_1 button');
|
||||
const service_1 = document.querySelector('.service_1');
|
||||
const service_2 = document.querySelector('.service_2');
|
||||
button_1.addEventListener('click', () => {
|
||||
service_1.classList.remove('active');
|
||||
service_2.classList.add('active');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,145 +1,281 @@
|
|||
.spaced {
|
||||
display: block;
|
||||
margin: 1rem 0;
|
||||
.service-main {
|
||||
padding: 5rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.input-required {
|
||||
color: red;
|
||||
.service {
|
||||
padding: 0;
|
||||
pointer-events: none;
|
||||
overflow: hidden;
|
||||
opacity: 0;
|
||||
height: 0;
|
||||
margin-top: 2rem;
|
||||
transition: 0.3s all ease;
|
||||
}
|
||||
|
||||
.input-block-1 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
gap: 4rem;
|
||||
padding-bottom: 3rem;
|
||||
.service.active {
|
||||
pointer-events: all;
|
||||
opacity: 1;
|
||||
height: 100%;
|
||||
padding-top: 3rem;
|
||||
transition: 0.3s all ease;
|
||||
}
|
||||
|
||||
.part-1 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
gap: 4rem;
|
||||
padding-bottom: 3rem;
|
||||
.service-inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5rem;
|
||||
}
|
||||
.service-inner h2 {
|
||||
font-size: 1.8rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.input-block-2 {
|
||||
.description,
|
||||
.cards {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3.2rem;
|
||||
}
|
||||
|
||||
.description h3 {
|
||||
font-size: 1.8rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.red {
|
||||
font-size: inherit;
|
||||
color: red !important;
|
||||
}
|
||||
|
||||
.description p {
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
|
||||
.cards h3 {
|
||||
font-size: 1.8rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cards-wrapper {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 4rem;
|
||||
padding-bottom: 3rem;
|
||||
}
|
||||
|
||||
.part-2 {
|
||||
width: 100%;
|
||||
padding-bottom: 3rem;
|
||||
.card {
|
||||
border: 0.1rem solid rgba(206, 206, 206, 1);
|
||||
border-radius: 0.8rem;
|
||||
background: white;
|
||||
padding: 4rem 4.5rem;
|
||||
display: grid;
|
||||
align-items: center;
|
||||
grid-template-columns: 4.8rem auto;
|
||||
gap: 4rem;
|
||||
}
|
||||
|
||||
.part-3 {
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
.card span {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
padding-bottom: 10rem;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 4.8rem;
|
||||
height: 4.8rem;
|
||||
border-radius: 50%;
|
||||
background: #c3000e;
|
||||
font-size: 1.8rem;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.part-3 span {
|
||||
font-size: 1.2rem;
|
||||
grid-area: text;
|
||||
.card p {
|
||||
font-size: 1.8rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.input-textarea {
|
||||
.buttons button,
|
||||
.form-button {
|
||||
width: 100%;
|
||||
min-height: 15rem;
|
||||
resize: none;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.input-name {
|
||||
display: inline-block;
|
||||
font-size: 1.2rem;
|
||||
font-weight: normal;
|
||||
padding: 0rem 0 1rem 1rem;
|
||||
}
|
||||
|
||||
.input-input {
|
||||
width: 100%;
|
||||
height: 5rem;
|
||||
padding: 1rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.input-block-outer {
|
||||
width: 100%;
|
||||
min-height: 15rem;
|
||||
}
|
||||
|
||||
.submit-button {
|
||||
max-width: 24rem;
|
||||
width: 100%;
|
||||
height: 4.4rem;
|
||||
background: #c50003;
|
||||
border: none;
|
||||
max-width: 28rem;
|
||||
padding: 1.25rem 2rem;
|
||||
border-radius: 0.5rem;
|
||||
color: #fff;
|
||||
background: #c3000e;
|
||||
color: white;
|
||||
font-size: 1.4rem;
|
||||
font-weight: bold;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
grid-area: butt;
|
||||
}
|
||||
|
||||
.submit-button:hover {
|
||||
background: #a50008;
|
||||
.service-title {
|
||||
font-weight: bold;
|
||||
padding-bottom: 2.4rem;
|
||||
font-size: 3.2rem;
|
||||
border-bottom: 0.1rem solid #cecece;
|
||||
}
|
||||
|
||||
.part-hidden {
|
||||
overflow: hidden;
|
||||
max-height: 0rem;
|
||||
/* padding-bottom: 5rem;
|
||||
padding-top: 2rem; */
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
.part-hidden.active {
|
||||
max-height: 20rem;
|
||||
padding-bottom: 5rem;
|
||||
padding-top: 2rem;
|
||||
transition: all 0.3s ease-in;
|
||||
.service-types {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 2.4rem;
|
||||
grid-template-rows: repeat(9, 1fr);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 700px) {
|
||||
.input-block-1 {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
.service-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 1.6rem;
|
||||
}
|
||||
|
||||
.service-option input {
|
||||
width: 2.4rem;
|
||||
height: 2.4rem;
|
||||
}
|
||||
|
||||
.service-option span {
|
||||
font-size: 1.8rem;
|
||||
line-height: 2.5rem;
|
||||
}
|
||||
|
||||
.service-form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4.8rem;
|
||||
}
|
||||
|
||||
.profile {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2.4rem;
|
||||
}
|
||||
|
||||
.profile h3 {
|
||||
padding-bottom: 0.8rem;
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
|
||||
.profile-top {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 4rem;
|
||||
}
|
||||
|
||||
.profile-input {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.8rem;
|
||||
}
|
||||
|
||||
.profile-input label {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
.profile-input input,
|
||||
.profile-input textarea {
|
||||
padding: 1.6rem 2rem;
|
||||
border: 0.1rem solid #cecece;
|
||||
border-radius: 0.5rem;
|
||||
font-size: 1.4rem;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.service-popup {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: 0.3s all ease;
|
||||
z-index: 20;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.service-popup.active {
|
||||
opacity: 1;
|
||||
pointer-events: all;
|
||||
transition: 0.3s all ease;
|
||||
}
|
||||
|
||||
.popup-inner {
|
||||
box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.25);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 1.6rem;
|
||||
padding: 2.4rem 3.2rem;
|
||||
border-radius: 1rem;
|
||||
background: #ffffff;
|
||||
max-width: 35rem;
|
||||
max-height: 15rem;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.popup-inner p {
|
||||
padding: 0 2rem;
|
||||
font-size: 1.8rem;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1000px) {
|
||||
.cards-wrapper {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.part-1 {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
.card {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 660px) {
|
||||
.part-3 {
|
||||
display: -ms-grid;
|
||||
display: grid;
|
||||
grid-template-areas:
|
||||
'text text'
|
||||
'butt butt';
|
||||
}
|
||||
.submit-button {
|
||||
.buttons button,
|
||||
.form-button {
|
||||
max-width: unset;
|
||||
}
|
||||
|
||||
.part-3 span {
|
||||
margin-bottom: 3rem;
|
||||
align-self: center;
|
||||
text-align: center;
|
||||
.service-types {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 450px) {
|
||||
.input-block-1,
|
||||
.input-block-2 {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.part-1 {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.submit-button {
|
||||
max-width: unset;
|
||||
}
|
||||
.profile-top {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 2.4rem;
|
||||
}
|
||||
.service {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 450px) {
|
||||
.service-title {
|
||||
font-size: 2.4rem;
|
||||
}
|
||||
.description p {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
.service-inner {
|
||||
gap: 4rem;
|
||||
}
|
||||
.card {
|
||||
grid-template-columns: 4rem auto;
|
||||
padding: 1.6rem 2.5rem;
|
||||
}
|
||||
.card p,
|
||||
.card span,
|
||||
.profile-input label,
|
||||
.profile-input input,
|
||||
.profile-input textarea {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
.card span {
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
}
|
||||
.service-inner h2,
|
||||
.service-option span,
|
||||
.profile h3 {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -5,6 +5,8 @@ use Webkul\Shop\Http\Controllers\Controller;
|
|||
use Webkul\Velocity\Repositories\Product\ProductRepository as VelocityProductRepository;
|
||||
use Webkul\Product\Repositories\ProductRepository;
|
||||
|
||||
use Webkul\Product\Models\Product;
|
||||
use Webkul\Product\Models\ProductFlat;
|
||||
|
||||
class ShopController extends Controller
|
||||
{
|
||||
|
|
@ -23,13 +25,30 @@ class ShopController extends Controller
|
|||
|
||||
public function search()
|
||||
{
|
||||
// dd("hi");
|
||||
$results = $this->velocityProductRepository->searchProductsFromCategory(request()->all());
|
||||
//$results = $this->velocityProductRepository->searchProductsFromCategory(request()->all());
|
||||
// dd($results->links());
|
||||
if (!is_null(request()->query('term'))) {
|
||||
$searchTerm = request()->query('term');
|
||||
}else{
|
||||
$searchTerm = request()->query('query');
|
||||
}
|
||||
|
||||
if (is_null(request()->query('sort'))) {
|
||||
$sort = "created_at";
|
||||
}else{
|
||||
$sort = request()->query('sort');
|
||||
}
|
||||
|
||||
if (is_null(request()->query('order'))) {
|
||||
$order = "desc";
|
||||
}else{
|
||||
$order = request()->query('order');
|
||||
}
|
||||
|
||||
$results = Product::search($searchTerm)->orderBy($sort, $order)->paginate(15);
|
||||
// return view('shop::home.index', compact('sliderData'));
|
||||
return view('shop::search.search')->with('results', $results ? $results : null);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,11 +20,12 @@ use Webkul\Product\Contracts\Product as ProductContract;
|
|||
use Webkul\Product\Database\Eloquent\Builder;
|
||||
use Webkul\Product\Database\Factories\ProductFactory;
|
||||
use Webkul\Product\Type\AbstractType;
|
||||
use Laravel\Scout\Searchable;
|
||||
|
||||
class Product extends Model implements ProductContract
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
use Searchable;
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
|
|
@ -46,6 +47,11 @@ class Product extends Model implements ProductContract
|
|||
'additional' => 'array',
|
||||
];
|
||||
|
||||
|
||||
public function searchableAs()
|
||||
{
|
||||
return 'products';
|
||||
}
|
||||
/**
|
||||
* The type of product.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
05B19AA0431157386DB516319F7F539C0E041F045344F8385256456CC575A31E
|
||||
comodoca.com
|
||||
30eb3f1ddfdef7c
|
||||
|
|
@ -457,13 +457,12 @@ return [
|
|||
'filter-to' => 'к',
|
||||
'sort-by' => 'Сортировать по',
|
||||
'from-a-z' => '«От А до Я»',
|
||||
'from-z-a' => 'От З-А',
|
||||
'newest-first' => 'Новички вперед',
|
||||
'oldest-first' => 'Старейший первый',
|
||||
'cheapest-first' => '«Сначала самые дешевые»',
|
||||
'expensive-first' => '«Сначала дорого»',
|
||||
'from-z-a' => 'От Я до А',
|
||||
'newest-first' => 'Новинки выше',
|
||||
'cheapest-first' => '«Дешевые выше»',
|
||||
'expensive-first' => '«Дорогие выше»',
|
||||
'show' => 'Показывать',
|
||||
'pager-info' => 'Показ :показ :всего предметов',
|
||||
'pager-info' => 'Показ :view :total предметов',
|
||||
'description' => 'Описание',
|
||||
'specification' => 'Характеристики',
|
||||
'total-reviews' => ':total отзыва',
|
||||
|
|
|
|||
|
|
@ -568,13 +568,13 @@ return [
|
|||
'price-label' => 'ýaly pes',
|
||||
'remove-filter-link-title' => 'hemmesini aýyr',
|
||||
'filter-to' => '-a çenli',
|
||||
'sort-by' => 'Tertiplemek',
|
||||
'from-a-z' => ' A-Z çenli',
|
||||
'from-z-a' => ' Z-A çenli',
|
||||
'newest-first' => 'ilki täzeleri',
|
||||
'oldest-first' => 'ilki köneler',
|
||||
'cheapest-first' => 'ilki arzanlary',
|
||||
'expensive-first' => 'ilki gymmatlary',
|
||||
'sort-by' => 'Tertipleşdir',
|
||||
'from-a-z' => '«A-dan Z çenli»',
|
||||
'from-z-a' => 'Z-den A çenli',
|
||||
'newest-first' => 'Täzeler ilki',
|
||||
'cheapest-first' => '«Arzanlar ilki»',
|
||||
'expensive-first' => '«Gymmatlar ilki»',
|
||||
|
||||
'show' => 'görkez',
|
||||
'pager-info' => 'Görkezilýär :showing of :total Items',
|
||||
'description' => 'Haryt barada',
|
||||
|
|
|
|||
Loading…
Reference in New Issue