Merge remote-tracking branch 'origin/elektronika' into elektronika

This commit is contained in:
merdan 2024-01-30 15:21:08 +05:00
commit a8040c25e5
11 changed files with 76 additions and 6 deletions

View File

@ -7,10 +7,10 @@ API_KEY="YoUrV3ry-S3cur3-aP1k3Y"
MEILISEARCH_URL="http://127.0.0.1:7700"
# Set the index name
INDEX_NAME="products"
INDEX_NAME="products_index"
# Set the attribute you want to make sortable
SORTABLE_ATTRIBUTE='"id","created_at","name","price","min_price"'
SORTABLE_ATTRIBUTE='"created_at","min_price","name"'
# Create JSON payload for settings update
SETTINGS_JSON='{

View File

@ -7,7 +7,7 @@ API_KEY="YoUrV3ry-S3cur3-aP1k3Y"
MEILISEARCH_URL="http://127.0.0.1:7700"
# Set the index name
INDEX_NAME="products"
INDEX_NAME="products_index"
# Get index settings using cURL
curl "$MEILISEARCH_URL/indexes/$INDEX_NAME/settings" \

View File

@ -5,6 +5,7 @@ namespace TPS\API\Http\Controllers;
use Illuminate\Http\Request;
use TPS\API\Http\Resources\Core\Slider;
use TPS\Shop\Repositories\SliderRepository;
use TPS\API\Http\Resources\Catalog\Product as ProductResource;
use Webkul\RestApi\Http\Controllers\V1\Shop\ShopController;
use Carbon\Carbon;
class Sliders extends ShopController
@ -48,4 +49,11 @@ class Sliders extends ShopController
return $this->getResourceCollection($results);
}
public function weeklyOffers()
{
$products = $this->getRepositoryInstance()->getWeeklyOffers();
$productsArray = ProductResource::collection($products);
return response()->json(['data' => $productsArray]);
}
}

View File

@ -24,6 +24,7 @@ Route::group(['prefix' => 'api','middleware' => ['locale', 'currency']], functio
Route::get('channels',[Channels::class, 'index']);
Route::get('contacts',[CMS::class,'contacts']);
Route::get('sliders',[Sliders::class, 'allResources']);
Route::get('weeklyOffers',[Sliders::class, 'weeklyOffers']);
/**
* category routes
*/

View File

@ -61,9 +61,16 @@ class Registration extends Controller
public function create(CustomerSignupRequest $request){
$request->validated();
if(is_null($request->email))
{
$request->email = '';
}
$verify = core()->getConfigData('customer.settings.email.verification') ;
$data = array_merge(request()->only('first_name', 'phone'), [
'email' => $request->email,
'password' => bcrypt(request()->input('password')),
'api_token' => Str::random(80),
'is_verified' => ! $verify ,

View File

@ -20,4 +20,27 @@ class SliderRepository extends SliderRepo
->orderBy('sort_order', 'ASC')
->get();
}
public function getWeeklyOffers()
{
$results = app(ProductFlatRepository::class)->scopeQuery(function ($query) {
$locale = core()->getRequestedLocaleCode();
$qb = $query->distinct()
->where('channel', core()->getCurrentChannelCode())
->where('product_flat.locale', $locale)
->whereNotNull('special_price')
->whereNotNull('special_price_to')
->whereNotNull('special_price_from')
->whereDate('special_price_from','<=',Carbon::today())
->whereDate('special_price_to','>=',Carbon::today())
->limit(8);
return $qb->inRandomOrder();
})->get();
return $results;
}
}

View File

@ -48,6 +48,7 @@ return [
'service' => 'Сервисный центр',
'refund' => 'Обмен и возврат товара',
'help' => 'Помощь по сайту',
'ordering' => 'Как оформить заказ',
],
@ -275,6 +276,7 @@ return [
'city' => 'Город',
'postcode' => 'Почтовый индекс',
'phone' => 'Телефон',
'agree' => 'Согласны ли Вы на рассылку уведомлений?',
'submit' => '«Сохранить адрес»',
'success' => 'Адрес был успешно добавлен.',
'error' => 'Невозможно добавить адрес.',

View File

@ -195,6 +195,7 @@ return [
'service' => 'Hyzmat',
'refund' => 'Çalyşmak we gaýtarmak',
'help' => 'Kömek',
'ordering' => 'Nädip sargyt etmeli',
],
@ -418,6 +419,7 @@ return [
'city' => 'Şäher',
'postcode' => 'zip belgisi',
'phone' => 'Telefon',
'agree' => 'Bildirişleri almaga razymy ?',
'submit' => 'Adresi ýada sal',
'success' => 'Adres ýada goşuldy.',
'error' => 'Adres goşulyp bilmedi'

View File

@ -27,6 +27,14 @@
<span class="control-error" v-if="errors.has('register.phone')">@{{ errors.first('register.phone') }}</span>
</div>
</div>
<div class="sign-up-input">
<span>{{ ucfirst(__('shop::app.customer.signup-form.email') )}}</span>
<div class="dif-input">
<input type="email" name="email" v-model="email">
</div>
</div>
<div class="sign-up-input">
<span>{{ ucfirst(__('shop::app.customer.signup-form.password')) }}</span>
@ -37,6 +45,20 @@
</div>
</div>
<div class="agree">
<div class="agree-input">
<input id="agree" type="checkbox" name="agree" v-model="agree" v-validate="'required'"
data-vv-as="&quot;{{ ucfirst(__('shop::app.customer.signup-form.agree')) }}&quot;">
<label for="agree" style="margin: 0 0 0 15px">{{ ucfirst(__('shop::app.customer.account.address.create.agree')) }}</label>
</div>
<div class="agree-error" style="display: flex;justify-content: center;">
<span class="control-error" v-if="errors.has('register.agree')" style="">@{{ errors.first('register.agree') }}</span>
</div>
</div>
<button type="submit" class="log-in" :disabled="disable_button" >{{ ucfirst(__('shop::app.customer.signup-form.button_title')) }}</button>
<div class="sign-up-footer">
<span>{{ ucfirst(__('shop::app.customer.signup-text.account_exists')) }} </span>
@ -80,6 +102,10 @@
first_name: '',
email: '',
agree: '',
message: null,
disable_button: false,
@ -101,6 +127,7 @@
if (result) {
axios.post('{{ route('customer.register.create') }}', {
phone: self.phone,
email: self.email,
password:self.password,
first_name:self.first_name
})

View File

@ -39,7 +39,7 @@
</div>
<div class="contacts-block-number">
<span class="contacts-block-dim-text">{{__('shop::app.checkout.onepage.email')}} : </span>
<a href="javascript:void(0)" class="contacts-block-bright-text" data-address="{{str_replace("@","#",core()->getConfigData('emails.configure.email_settings.shop_email_from'))}}">Send here</a>
<a href="mailto: contact1@tehnikadunyasi.com" class="contacts-block-bright-text" data-address="{{str_replace("@","#",core()->getConfigData('emails.configure.email_settings.shop_email_from'))}}">contact1@tehnikadunyasi.com</a>
</div>
</div>
</div>

View File

@ -38,8 +38,8 @@
</a>
</li>
<li class="service-li skewed">
<a href="{{route('shop.cms.page',['slug' => 'komek'])}}">
<span class="link-text displaced-text">{{__('shop::app.header.help')}}</span>
<a href="{{route('shop.cms.page',['slug' => 'ordering'])}}">
<span class="link-text displaced-text">{{__('shop::app.header.ordering')}}</span>
</a>
</li>
<li>