Leafiny Documentation

Commerce

Configure the website by adding a specific configuration file in a custom module (e.g. Company_Commerce).

<?php
/* modules/Company_Commerce/etc/config.php */

$config = [
    'helper' => [
        'tax' => [
            'default_country_code' => '*', // The default country code for product tax calculation
            'default_state_code' => '*', // The default state for product tax calculation
            'default_postcode' => '*', // The default postcode for product tax calculation
        ],
        'cart' => [
            'currency' => 'USD', // The store currency (ISO 4217)
            'agreements_url' => 'agreements.html', // The agreements page path
        ],
        'shipping' => [
            'allowed_countries' => [
                'US', // Countries allowed for shipping
            ],
            'default_country_code' => 'US', // The default shipping address country code
            'default_state_code'   => '', // The default shipping address state code
            'default_postcode'     => '', // The default shipping address postcode
            'default_price_type'   => 'excl_tax',  // The default shipping price type when adding a new shipping method (excl_tax, incl_tax)
            'default_tax_rule_id'  => 1, // The default tax rule ID
            'package_weight'       => 0, // The box weight
        ],
        'order' => [
            'sale_increment_id'    => 'OR1000001', // First order increment ID number
            'invoice_increment_id' => 'IN1000001', // First invoice increment ID number
        ],
        'commerce_product' => [
            'default_price_type'  => 'excl_tax', // The default product price type when adding a new product (excl_tax, incl_tax)
            'default_tax_rule_id' => 1, // The default tax rule ID
        ],
        'invoice' => [
            'fonts'  => 'Leafiny_Commerce::pdf/fonts', // PDF font directory
            'logo'   => 'Leafiny_Commerce::pdf/logo.png', // PDF logo path
            'seller' => [ // The seller address on the invoice
                'company'  => 'Company',
                'street'   => '1210 Rosewood Ave',
                'postcode' => '78702',
                'city'     => 'Austin',
                'state'    => 'Texas',
                'email'    => 'invoice@example.com',
            ],
            'legal' => [], // Invoice additional legal notes
            'info' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', // Invoice custom phrase
            'date' => '%d %B %Y' // Invoice date format
        ]
    ],
];