Laravel 8 E-Commerce - Admin Making On Sale Timer Working
HTML-код
- Опубликовано: 28 сен 2024
- In this video I will talk about Admin Making On Sale Timer Working.
TOPIC DISCUSSED:
Making On Sale Timer Working
Create Sale Timer Setting Page
Add DateTime Picker
Your Queries -
1.How to make on sale timer working on homepage in laravel 8 ecommerce?
2.How to add datetime picker in laravel 8 ecommerce?
3.How to use sale timer for the on sale products in laravel 8 ecommerce?
4.What are the steps for making on sale timer working on homepage in laravel 8 ecommerce?
Template Url:
github.com/sur...
FOLLOW SURFSIDE MEDIA:
/ surfsidem
/ mediasurfside
github.com/sur...
/ surfsidemedia
#laravel #laravel8 #laravel8x
Guys, if yours datetimepicker is not working, thats becouse you ignore cdn versions on the dropdown list or you choose another version. Check the cdn version in this video and choose that to copy...
awesome explanation,make checkout and payment system
when add to shopping cart that time added regular_price but its should be sale_price
@@raudbook9683 I think you can make some changes as below:
In CartComponent.php
public function render()
{
$sale = Sale::find(1);
return view('livewire.cart-component', [
'sale' => $sale
])->layout('layouts.base');
}
In cart-component.blade.php
@if ($row->model->sale_price > 0 && $sale->status == 1 && $sale->sale_date > Carbon\Carbon::now())
${{ $row->model->sale_price }}
@else
${{ $row->model->regular_price }}
@endif
tired everyting ..added bootstrap 3 cdn ..but still date time picker not working ....how to fix ??
I'm Using a different layout for admin dashboard but datetimepicker doesn't work :"(
any one can help?
i'm using adminLTE dashboard
Thank you for your video! By the way, which extension do you use for the color bars matching each syntax?
indent-rainbow
@@SurfsideMedia when add to shopping cart that time added regular_price but its should be sale_price
@@SurfsideMedia when add to shopping cart that time added regular_price but its should be sale_price
Sir time picker not found. Same thing happened on categories earlier. I didn't understand what the problem is. I have done everything like you did.
@push('scripts')
$(function()
{
$('#sale-date').datetimepicker({
format: 'Y-MM-DD h:m:s',
})
.on('dp.change',function(ev){
var data =$('$sale-date').val();
@this.set('sale_date',data);
});
});
@endpush
here is how to solve datetime not showing=> in your base.blade.php file, make sure bootstrap 3 cdn is directly above the datetimepicker cdn in styles; now in the js script part, bootstrap first, moment.js second followed by datetimepicker cdn.
Plz do price rangr slider filter on nxt video
sir my datetimepicker is working properly but it didnt shows the arrows for chaning month year and days properly
now its start working with bootstrap 3 cdn. will it work with latest bootstrap version if i change the version of datetimepicker cdn?
This Template is based on bootstrap 3 so you can only use bootstrap 3 cdn
@@SurfsideMedia does it mean we have to import also a version 3 of the cdn? Because I tried several versions and none of them works correctly (it doen's show the arrows or the mini clock in the bottom)
@@hildepalmans748 did you manage to correct?
I've the same error, did you manage to correct?
I would like to share this adjustment for the cart-component.blade.php:
@if($item->model->sale_price > 0 && $sale->status == 1 && $sale->sale_date > Carbon\Carbon::now())
${{ $item->model->regular_price }}
@else
${{ $item->model->regular_price }}
@endif
Nice bro!
some thing wrong, bro. i will correct below
@if($item->model->sale_price > 0 && $sale->status == 1 && $sale->sale_date > Carbon\Carbon::now())
${{ $item->model->sale_price }}
@else
${{ $item->model->regular_price }}
@endif
And also adding $sale = Sale::find(1); in render() function of CartComponent
everything is working except count down. The Count system is not working everything is showing 0-0-0 please help me please
On sale date is not working
Thanks for video but datetimepicker icons are not visible and AM/PM control does not work I've put necessary links in base.blade please any suggestions
My timer is not showing data-expire time even before applying carbon... :( please help
Thank you, every day I'm learning from your code. Best teacher.
There is one problem! Then i delete "sale price" on edit product page comes error - SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect decimal value: '' for column `tattoomarket`.`products`.`sale_price` at row 1 (SQL: update `products` set `sale_price` = , `products`.`updated_at` = 2021-10-19 16:41:15 where `id` = 7)
The best teacher ever!!!👏
Hey,my datetime picker is not working, it's blank ,how can i fix this without using bootstrap 3 cuz it will affect on my theme ?
Did i need livewire?
it works with me only when i change type of input from text to datetime-local and update doesn't work at all
Hello sir this is not working for 24 hours format ? because when we give time 4.00 or 16.00 ...Both are consider as 4.00 AM ... So How to give time for evening 4.00 ...please help sir...
when add to shopping cart that time added regular_price but its should be sale_price
MySQL datetime format
2021-05-22 15:15:00
Countdown Plugin datetime format
2021/05/22 15:15:00
In admin-sale-component.blade.php
$(function () {
$('#sale-date').datetimepicker({
format: 'YYYY-MM-DD HH:mm',
icons: {
time: "fa fa-clock-o",
date: "fa fa-calendar",
up: "fa fa-arrow-up",
down: "fa fa-arrow-down",
previous: "fa fa-chevron-left",
next: "fa fa-chevron-right",
today: "fa fa-clock-o",
clear: "fa fa-trash-o"
},
})
.on('dp.hide', function (ev) {
var data = $('#sale-date').val();
@this.set('sale_date', data);
});
});
In home-component.blade.php
@php
$expireDate = Carbon\Carbon::parse($sale->sale_date)->format('Y/m/d H:i:s');
@endphp
Noted that for the varying timezone, we might specify the timezone to make the homepage countdown and product details page work as expected.
For example, in home-component.blade.php
update the IF condition of the on-sale component:
@if ($sproducts->count() > 0 && $sale->status == 1 && $sale->sale_date > Carbon\Carbon::now('Asia/Hong_Kong'))
@endif
Timezone Ref:
www.php.net/manual/en/timezones.php
@@kitky thanks brother im missing those navigation icon, you helped me alots!
when add to shopping cart that time added regular_price but its should be sale_price
stuck in 17:52 ...this push script is not working in my code ..how to fix ?
My icons are not showing on datetimepicker :(
How to update cart count automatically when we click add to cart button
Best tutorial
why did you comment the line for the bootstrap.min.css ? did I forget something ?
I added the bootstrap 3 cdn, because of the glyphicon was not working.
@@SurfsideMedia yes but I did not saw it in your previous video
when add to shopping cart that time added regular_price but its should be sale_price
Even if connecting with internet,icons(arrows, time)icons not viewed properly in datetimepicker..can you say any suggestion to solve that
Please add the bootstrap cdn (css and js) in base layout file
@@SurfsideMedia i am add this but its still not working
@@rifathosen8387 did you fix the error yet?
lovely explanation, keep up the good work.
when add to shopping cart that time added regular_price but its should be sale_price
when I click on the sale date to pick a date, it appears 2 seconds and then disappears.... please help me :) is there any known bug on Chrome ?
Can you solve this issue ? I also have same issue ...
@@sagarwakchaure3092 I still don't know how to resolve this bug sorry !
@@devlaravel8871 ok... Thanks for reply...
@Krishnadev P Melevila I don't have any problem if I change the date and time when I have it set to "inactive", if I change it to active if the calendar closes .... it's weird.
@@devlaravel8871 In admin-sale-component.blade.php
Replace
.on('dp.change', function (ev) {
var data = $('#sale-date').val();
@this.set('sale_date', data);
});
To
.on('dp.hide', function (ev) {
var data = $('#sale-date').val();
@this.set('sale_date', data);
});