PHP code example of snowio / orderhive-data-model

1. Go to this page and download the library: Download snowio/orderhive-data-model 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/ */

    

snowio / orderhive-data-model example snippets



    use SnowIO\OrderHiveDataModel\Command\CreateOrderCommand;
    use SnowIO\OrderHiveDataModel\Order\OrderStatus;
    use SnowIO\OrderHiveDataModel\Order\Order;
    use SnowIO\OrderHiveDataModel\Order\ItemSet;
    use SnowIO\OrderHiveDataModel\Order\Item;
        
    $createOrderCommand = CreateOrderCommand::of(
        Order::of(0001)
            ->withOrderStatus(OrderStatus::CONFIRM)
            ->withStoreId('1')
            ->withCurrency("USD")
            ->withTaxType("EXCLUSIVE")
            ->withOrderItems(ItemSet::of([
                Item::of(111, 1)->withPrice(1.99)->withSku('a'),
                Item::of(222, 1)->withPrice(2.99)->withSku('b'),
            ]))
    );