PHP code example of yaroslawww / laravel-quick-checkout

1. Go to this page and download the library: Download yaroslawww/laravel-quick-checkout library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yaroslawww / laravel-quick-checkout example snippets

bash
php artisan vendor:publish --provider="QuickCheckout\ServiceProvider" --tag="config"
injectablephp
public function addToCart(Course $course) {
        /** @var \QuickCheckout\Cart $cart */
        $cart = \QuickCheckout\Checkout::cart()->purge()
                                       ->withLineItem($course->toCheckoutProduct(), 2)
                                       ->withLineItem(new Product('My other product', 123), 4)
                                       ->putToSession();
                                       
        // ... response or redirect
}

public function showCheckout(Course $course) {
        /** @var \QuickCheckout\Cart $cart */
        $cart = \QuickCheckout\Checkout::cart()->fromSession();
        // ... response or redirect
}