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

Комментарии • 93

  • @dadomultimediamusic
    @dadomultimediamusic 3 года назад

    Thank you for teaching, I´m learning a lot. I truly appreciate it. Blesssings!

  • @reconbob
    @reconbob 3 года назад +3

    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.

  • @reconbob
    @reconbob 3 года назад +3

    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?

    • @reconbob
      @reconbob 3 года назад

      Never mind... I saw a mistake that I made in the code, which now makes it work properly... sigh.

    • @eitsolution
      @eitsolution 3 года назад

      when I submit the form it gives a null value @Rob White

    • @hackoomb
      @hackoomb 2 года назад

      @@reconbob how do you resolve it?

  • @knowledgetutor9915
    @knowledgetutor9915 3 года назад +1

    $coupon=Coupon::where('code',$this->couponCode)->where('cart_value','

    • @nguyenvd2169
      @nguyenvd2169 2 года назад

      because type of 'cart_value' and subtotal different

  • @mdnaimul8316
    @mdnaimul8316 11 месяцев назад

    When i checked box checked coupon code form don't show

  • @jahmielwright976
    @jahmielwright976 2 года назад

    I am not seeing the cart.php file which should be in the config folder in my project.

  • @rubelmiah6829
    @rubelmiah6829 3 года назад

    To be Honestly, I have a lot of love for you. Thanks a lot.

  • @akramgharbi7825
    @akramgharbi7825 3 года назад +3

    great job , i don't have the cart.php in the config folder , u create it manually ?

    • @SurfsideMedia
      @SurfsideMedia  3 года назад +11

      Run the following command
      php artisan vendor:publish --provider="Gloudemans\Shoppingcart\ShoppingcartServiceProvider" --tag="config"

    • @reconbob
      @reconbob 3 года назад +1

      @@SurfsideMedia This worked for me. Thank you.

    • @akramgharbi7825
      @akramgharbi7825 3 года назад

      @@SurfsideMedia Thanks a lot , i really appreciate it !

    • @yeageranonymous3584
      @yeageranonymous3584 3 года назад

      @@SurfsideMedia Tks sir

    • @mdtoufikahamed6612
      @mdtoufikahamed6612 2 года назад

      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..

  • @cristianopalmarini8354
    @cristianopalmarini8354 2 года назад

    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

  • @rehmanemenov2951
    @rehmanemenov2951 3 года назад +1

    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.

    • @raudbook9683
      @raudbook9683 3 года назад +1

      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)

    • @davebudah
      @davebudah 3 года назад

      @@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.

  • @salvadorradavaca7271
    @salvadorradavaca7271 3 года назад +1

    How to create the cart.php file in config folder?, please

    • @AhmedIbrahim-qd9xc
      @AhmedIbrahim-qd9xc 3 года назад

      Run the following command
      php artisan vendor:publish --provider="Gloudemans\Shoppingcart\ShoppingcartServiceProvider" --tag="config"

  • @muhammadsofyansyah9571
    @muhammadsofyansyah9571 2 года назад

    can i have souce code sir for learning?

  • @eitsolution
    @eitsolution 3 года назад

    $coupon = Coupon::where('code',$this->couponCode)->where('cart_value','

    • @JCPatagonia
      @JCPatagonia 2 года назад

      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','

    • @JCPatagonia
      @JCPatagonia 2 года назад +1

      Solution video: config/cart.php min. 29:37
      'decimals' => 2,
      'decimal_point' => '.',
      'thousand_seperator' => ''

  • @noebejaraletsoala8504
    @noebejaraletsoala8504 2 года назад

    why am i always getting invalid coupon code?? Please help

    • @Besk1326
      @Besk1326 2 года назад

      because you should put a coupon code with cart value

    • @pyaesonephyo4599
      @pyaesonephyo4599 2 года назад

      @@Besk1326 I don't know what do you mean can U explain me plz

    • @Besk1326
      @Besk1326 2 года назад

      @@pyaesonephyo4599 the subtotal that you have in your cart should be more than the cart _value put it in your coupon

    • @pyaesonephyo4599
      @pyaesonephyo4599 2 года назад

      @@Besk1326 can you show me the code please

    • @pyaesonephyo4599
      @pyaesonephyo4599 2 года назад

      @@Besk1326 $coupon = Coupon::where('code', $this->couponCode)->where('cart_value','

  • @endriaja3049
    @endriaja3049 3 года назад

    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

    • @SurfsideMedia
      @SurfsideMedia  3 года назад +1

      Run the following command
      php artisan vendor:publish --provider="Gloudemans\Shoppingcart\ShoppingcartServiceProvider" --tag="config"

    • @endriaja3049
      @endriaja3049 3 года назад

      @@SurfsideMedia ok. Thank you very much, sir

    • @raudbook9683
      @raudbook9683 3 года назад

      @@SurfsideMedia config('cart.tax') is not working

  • @pyaesonephyo4599
    @pyaesonephyo4599 2 года назад

    Please sir

  • @muhammaddanial5075
    @muhammaddanial5075 2 года назад +1

    Hi I dont find cart.php in config folder Help (Solved)

  • @Xlrb102
    @Xlrb102 3 года назад +2

    If you can please create a dashboard for sellers to view their brand detealis and make changes.

  • @indiatravelwithharsh4763
    @indiatravelwithharsh4763 2 года назад +2

    I am getting coupon invalid everytime i apply coupon please help me

    • @hackoomb
      @hackoomb 2 года назад

      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.

    • @hackoomb
      @hackoomb 2 года назад

      how do you solve it?

    • @mohamedharoun3301
      @mohamedharoun3301 2 года назад

      did you solve it ?

    • @joshuabognet7745
      @joshuabognet7745 2 года назад

      The value you put in the cart_value should be lower than the total amount

  • @pyaesonephyo4599
    @pyaesonephyo4599 2 года назад +1

    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

  • @vijaygupta3875
    @vijaygupta3875 2 года назад

    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?

  • @ahmadkhanahmadzai7941
    @ahmadkhanahmadzai7941 3 года назад +2

    when I submit the form it gives a null value
    please

  • @nguyenvd2169
    @nguyenvd2169 2 года назад +1

    *Hi all If you get bug at function applyCouponCode() please edit file cart.php in config as:
    'format' => [
    * 'decimals' => 2,
    'decimal_point' => '.',
    'thousand_seperator' => ''
    ],

    • @VishwajeetSingh-wy9oi
      @VishwajeetSingh-wy9oi Год назад

      I have no cart.php file in config

    • @yannaing6295
      @yannaing6295 Год назад

      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

  • @sajawalkhan3464
    @sajawalkhan3464 2 года назад

    Sir when i click the checkbox my footer appears on top....? What can i do

  • @abdoulayediallo4065
    @abdoulayediallo4065 2 года назад

    hello thank you , i need help please i dont cart.php in the config file
    help please

  • @codewithus567
    @codewithus567 3 года назад +1

    config/cart.php is not available in my project what I can do?

    • @SurfsideMedia
      @SurfsideMedia  3 года назад +2

      Run the following command
      php artisan vendor:publish --provider="Gloudemans\Shoppingcart\ShoppingcartServiceProvider" --tag="config"

  • @jallygreener9218
    @jallygreener9218 3 года назад +1

    Blessed u did it

  • @prashantkapse3047
    @prashantkapse3047 2 года назад

    ->where('expiry_date', '>=', date('Y-m-d') plz add this condition in applyCouponCode function because expired coupon code condition not added

  • @mdmahmudulislam1849
    @mdmahmudulislam1849 2 года назад

    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.

  • @anmasa
    @anmasa 3 года назад

    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

  • @mysuccessword
    @mysuccessword 2 года назад

    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.

  • @farabisajib9769
    @farabisajib9769 3 года назад

    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.

  • @ayahosny6995
    @ayahosny6995 2 года назад

    Why I don't have cart file in config directory ??

  • @phanethpho4477
    @phanethpho4477 3 года назад

    when we logged with other browser all products in cart nothing

  • @mohammadshahabuddin6944
    @mohammadshahabuddin6944 3 года назад

    Sir can you make a tutorial on product subcategories and brands.

  • @blessed-favored
    @blessed-favored 3 года назад

    I will not skip any ads in your videos. I will watch all of them.

  • @SkillGuild-co8tw
    @SkillGuild-co8tw Год назад

    hello @Surfside Media after applying coupon code the discounts becomes null together with Subtotal with Discount and Total, kindly assist, thanks

  • @Xlrb102
    @Xlrb102 3 года назад

    Greate work sir.. Thanks a lot for doing the Laravel series... keep it up.

  • @ahmadkhanahmadzai7941
    @ahmadkhanahmadzai7941 3 года назад

    sir i have problem my coupon submit null please help me

  • @raudbook9683
    @raudbook9683 3 года назад

    config('cart.tax') is not working

  • @ممدو-ص1ث
    @ممدو-ص1ث 3 года назад

    Thanks a lot sir :) you amazing

  • @IoTWebPlanet
    @IoTWebPlanet 3 года назад

    You are really doing great job. ❤️

  • @aamerdirar7367
    @aamerdirar7367 3 года назад

    Sir, you are amazing teacher, thank you a lot for your a great effort.

  • @blessed-favored
    @blessed-favored 3 года назад

    Amazing stuff bro

  • @alihussam1272
    @alihussam1272 2 года назад

    thank you

  • @gadgetkh9408
    @gadgetkh9408 3 года назад

    Thank you!

  • @thuongngothithu2160
    @thuongngothithu2160 3 года назад

    A non well formed numeric value encountered

    • @johnnathanstephens341
      @johnnathanstephens341 3 года назад

      ANSWER TO THIS?

    • @johnnathanstephens341
      @johnnathanstephens341 3 года назад

      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

    • @eitsolution
      @eitsolution 3 года назад

      when I submit the form it gives a null value

  • @brianorbino6910
    @brianorbino6910 3 года назад +1

    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

    • @raudbook9683
      @raudbook9683 3 года назад +7

      php artisan vendor:publish --provider="Gloudemans\Shoppingcart\ShoppingcartServiceProvider" --tag="config"

    • @johnnathanstephens341
      @johnnathanstephens341 3 года назад +2

      @@raudbook9683 this saved my life LOL

    • @mdtoufikahamed6612
      @mdtoufikahamed6612 2 года назад

      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

    • @kouzokiodin3623
      @kouzokiodin3623 2 года назад

      @@raudbook9683 thank u so much sir