Laravel 8 E-Commerce - Admin Apply Coupons
HTML-код
- Опубликовано: 28 сен 2024
- In this video I will talk about Apply Coupons.
TOPIC DISCUSSED:
Apply Coupons
Apply Fixed Discount Coupon
Apply Percentage Discount Coupon
Your Queries -
1.How to apply coupon in laravel 8 ecommerce?
2.How to apply fixed discount coupon in laravel 8 ecommerce?
3.How to apply percentage discount coupon in laravel 8 ecommerce?
4.What are the steps for applying the coupon in laravel 8 ecommerce?
Template Url:
github.com/sur...
FOLLOW SURFSIDE MEDIA:
/ surfsidem
/ mediasurfside
github.com/sur...
/ surfsidemedia
#laravel #laravel8 #laravel8x
Thank you for teaching, I´m learning a lot. I truly appreciate it. Blesssings!
Can you make the coupons expire by date (only good for 30-days, etc...), and only single use? Once code is used, it is no longer valid.
This is awesome! I have a question. After the coupon is applied, and then someone deletes something from the cart, the coupon is still applied if the cart value drops below the prescribed amount for the coupon. Is there a way to automatically remove coupon discount if the cart value drops below prescribed amount?
Never mind... I saw a mistake that I made in the code, which now makes it work properly... sigh.
when I submit the form it gives a null value @Rob White
@@reconbob how do you resolve it?
$coupon=Coupon::where('code',$this->couponCode)->where('cart_value','
because type of 'cart_value' and subtotal different
When i checked box checked coupon code form don't show
I am not seeing the cart.php file which should be in the config folder in my project.
To be Honestly, I have a lot of love for you. Thanks a lot.
great job , i don't have the cart.php in the config folder , u create it manually ?
Run the following command
php artisan vendor:publish --provider="Gloudemans\Shoppingcart\ShoppingcartServiceProvider" --tag="config"
@@SurfsideMedia This worked for me. Thank you.
@@SurfsideMedia Thanks a lot , i really appreciate it !
@@SurfsideMedia Tks sir
I tried to run the commend from here, but I can't create using that run command. please help me if you know how to create that cart.php file already..
Hi everyone, can someone help me?
When i add a product to the cart from the product.details page, i land on the cart page, the success message is shown but the product isnt added in the cart. pls help me
Sir when i delete an image that image still stays in the assets. Can you solve it please? It happens always while adding products or slides. Images still stays there after we delete them.
first you ensure your image here app/public/products than use public function deleteproduct($id){
$product = Product::find($id);
$productSelect = Product::where('id',$id)->first();
if(file_exists(storage_path('app/public/products/'.$productSelect->image))){
unlink(storage_path('app/public/products/'.$productSelect->image));
}
$product->delete();
session()->flash('success_message',$productSelect->name.' Product Deleted ');
}
please call this function from product list delete button wire.click.prevent=deleteproduct($product->id)
@@raudbook9683 high I tried this method but my path is app/public/images/products ...it didn't work. So my question is do I have to move the "products: folder a level up(to match with your example), for the code to work. Thanks in advance for your help.
How to create the cart.php file in config folder?, please
Run the following command
php artisan vendor:publish --provider="Gloudemans\Shoppingcart\ShoppingcartServiceProvider" --tag="config"
can i have souce code sir for learning?
$coupon = Coupon::where('code',$this->couponCode)->where('cart_value','
My solution using decimal an thousand_separator:
$subtotal = Cart::instance('cart')->subtotal();
$subtotal = substr(Cart::instance('cart')->subtotal(),0,strpos($subtotal, ','));
$subtotal = intval(preg_replace('/[^0-9]+/', '',$subtotal));
//
$coupon = Coupon::where('code',$this->couponCode)->where('cart_value','
Solution video: config/cart.php min. 29:37
'decimals' => 2,
'decimal_point' => '.',
'thousand_seperator' => ''
why am i always getting invalid coupon code?? Please help
because you should put a coupon code with cart value
@@Besk1326 I don't know what do you mean can U explain me plz
@@pyaesonephyo4599 the subtotal that you have in your cart should be more than the cart _value put it in your coupon
@@Besk1326 can you show me the code please
@@Besk1326 $coupon = Coupon::where('code', $this->couponCode)->where('cart_value','
I'm sorry sir,
I want to ask cart.php in the config folder where did it come from?
because in my config there is no cart.php
to get cart.php what should I install?
maybe there is a tutorial that i missed.
enlightenment please
Run the following command
php artisan vendor:publish --provider="Gloudemans\Shoppingcart\ShoppingcartServiceProvider" --tag="config"
@@SurfsideMedia ok. Thank you very much, sir
@@SurfsideMedia config('cart.tax') is not working
Please sir
Hi I dont find cart.php in config folder Help (Solved)
If you can please create a dashboard for sellers to view their brand detealis and make changes.
I am getting coupon invalid everytime i apply coupon please help me
Error
Class 'App\Http\Livewire\Coupon' not found, I had this error I added, use App\Models\Coupon; and to my also gives me that error, that only works with invalid coupons, but those that I create to press apply nothing happens.
how do you solve it?
did you solve it ?
The value you put in the cart_value should be lower than the total amount
sir please
I check code more than 5 times from beginning and I cannot fix it .it always show
Coupon code is invalid!
how I should do sir Plesae
My cart is getting clear after clicking on "Apply" button, and coming "COUPON CODE IS INVALID!", when I refresh the page, cart comes as before, can anyone help please?
when I submit the form it gives a null value
please
yeas my problem like you how can you fix it ?
Did you fix it? Me too
*Hi all If you get bug at function applyCouponCode() please edit file cart.php in config as:
'format' => [
* 'decimals' => 2,
'decimal_point' => '.',
'thousand_seperator' => ''
],
I have no cart.php file in config
thank bro . i knew it that comma make did not work the coupon after reached +1000 amount. but i have no idea how to remove that comma . thank a lot
Sir when i click the checkbox my footer appears on top....? What can i do
hello thank you , i need help please i dont cart.php in the config file
help please
config/cart.php is not available in my project what I can do?
Run the following command
php artisan vendor:publish --provider="Gloudemans\Shoppingcart\ShoppingcartServiceProvider" --tag="config"
Blessed u did it
->where('expiry_date', '>=', date('Y-m-d') plz add this condition in applyCouponCode function because expired coupon code condition not added
Sir, if I want to update a coupon details without changing the previous data by clicking the update button than, this "The code has already been taken" error message is always seen in the bellow of "Coupon Code" field. Please help me to solve this.
Hello, comment that I have the same problem, Property [code] does not exist on the Eloquent builder instance. What can I do?
Comment that I have been able to solve the problem, I had not realized that in the render method I had written wrong instance, I had written instace
Nice video! Thank you for teaching us in such a way like this. Please I have some issue, in mobile view user can not see the menu items like home, about us, shop, checkout, cart, and contact us links. How can we make it show in mobile view?
Thank you.
I am see this error when I apply with coupon code. What can I do?
Property [code] does not exist on the Eloquent builder instance.
Why I don't have cart file in config directory ??
when we logged with other browser all products in cart nothing
Sir can you make a tutorial on product subcategories and brands.
I will not skip any ads in your videos. I will watch all of them.
hello @Surfside Media after applying coupon code the discounts becomes null together with Subtotal with Discount and Total, kindly assist, thanks
Greate work sir.. Thanks a lot for doing the Laravel series... keep it up.
sir i have problem my coupon submit null please help me
config('cart.tax') is not working
Thanks a lot sir :) you amazing
You are really doing great job. ❤️
Sir, you are amazing teacher, thank you a lot for your a great effort.
Amazing stuff bro
thank you
Thank you!
A non well formed numeric value encountered
ANSWER TO THIS?
ooh i did.. for me it was in the cart.php file my decimal_point was set to comma and it had to be set to dots because the coupon is defined in dots
when I submit the form it gives a null value
sir, I cannot find the cart.php on the config directory like on your video timestamp 23:37 only this file is missing I am stuck now. Sir, can I ask for the link where I can download your source code? just the cart.php file only. your response will be appreciated. thank you in advance. I am happy and looking forward to finish this course
php artisan vendor:publish --provider="Gloudemans\Shoppingcart\ShoppingcartServiceProvider" --tag="config"
@@raudbook9683 this saved my life LOL
How did you solve this issue? I tried to run the commend but it says: No publishable resources for tag ['config']
help me to create cart.php file
@@raudbook9683 thank u so much sir