PHP code example of pictastudio / venditio-core

1. Go to this page and download the library: Download pictastudio/venditio-core 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/ */

    

pictastudio / venditio-core example snippets


return [

    /*
    |--------------------------------------------------------------------------
    | Auth
    |--------------------------------------------------------------------------
    |
    | Specify the auth manager
    |
    */
    'auth' => [
        'manager' => AuthManager::class,
    ],

    /*
    |--------------------------------------------------------------------------
    | Models
    |--------------------------------------------------------------------------
    |
    | Specify the models to use
    |
    */
    'models' => [
        'address' => PictaStudio\VenditioCore\Models\Address::class,
        'brand' => PictaStudio\VenditioCore\Models\Brand::class,
        'cart' => PictaStudio\VenditioCore\Models\Cart::class,
        'cart_line' => PictaStudio\VenditioCore\Models\CartLine::class,
        'country' => PictaStudio\VenditioCore\Models\Country::class,
        'country_tax_class' => PictaStudio\VenditioCore\Models\CountryTaxClass::class,
        'currency' => PictaStudio\VenditioCore\Models\Currency::class,
        'discount' => PictaStudio\VenditioCore\Models\Discount::class,
        'inventory' => PictaStudio\VenditioCore\Models\Inventory::class,
        'order' => PictaStudio\VenditioCore\Models\Order::class,
        'order_line' => PictaStudio\VenditioCore\Models\OrderLine::class,
        'product' => PictaStudio\VenditioCore\Models\Product::class,
        'product_category' => PictaStudio\VenditioCore\Models\ProductCategory::class,
        'product_custom_field' => PictaStudio\VenditioCore\Models\ProductCustomField::class,
        'product_type' => PictaStudio\VenditioCore\Models\ProductType::class,
        'product_item' => PictaStudio\VenditioCore\Models\ProductItem::class,
        'product_variant' => PictaStudio\VenditioCore\Models\ProductVariant::class,
        'product_variant_option' => PictaStudio\VenditioCore\Models\ProductVariantOption::class,
        'shipping_status' => PictaStudio\VenditioCore\Models\ShippingStatus::class,
        'tax_class' => PictaStudio\VenditioCore\Models\TaxClass::class,
        'user' => PictaStudio\VenditioCore\Models\User::class,
    ],

    /*
    |--------------------------------------------------------------------------
    | Pricing
    |--------------------------------------------------------------------------
    |
    | Specify the pricing formatter
    |
    */
    'pricing' => [
        'formatter' => DefaultPriceFormatter::class,
    ],

    /*
    |--------------------------------------------------------------------------
    | Decimal
    |--------------------------------------------------------------------------
    |
    | Specify the decimal formatter
    |
    */
    'decimal' => [
        'formatter' => DefaultDecimalFormatter::class,
    ],

    /*
    |--------------------------------------------------------------------------
    | Scopes
    |--------------------------------------------------------------------------
    |
    | Scopes configuration
    |
    */
    'scopes' => [
        'in_date_range' => [
            'allow_null' => true, // allow null values to pass when checking date range
            '

$this->app->bind(CartIdentifierGeneratorInterface::class, CartIdentifierGenerator::class);

$this->app->bind(OrderIdentifierGeneratorInterface::class, OrderIdentifierGenerator::class);

namespace App\Generators;

use PictaStudio\VenditioCore\Models\Order;
use PictaStudio\VenditioCore\Orders\Contracts\OrderIdentifierGeneratorInterface;

class MyCustomGenerator implements OrderIdentifierGeneratorInterface
{
    /**
     * {@inheritDoc}
     */
    public function generate(Order $order): string
    {
        // ...
        return 'my-custom-reference';
    }
}
bash
php artisan venditio-core:install