PHP code example of justinholtweb / craft-freshh

1. Go to this page and download the library: Download justinholtweb/craft-freshh 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/ */

    

justinholtweb / craft-freshh example snippets


use justinholtweb\freshh\events\BuildInvoiceEvent;
use justinholtweb\freshh\services\Mapper;
use yii\base\Event;

Event::on(Mapper::class, Mapper::EVENT_AFTER_BUILD_INVOICE, function(BuildInvoiceEvent $event) {
    $event->mapped->payload['po_number'] = $event->order->getFieldValue('purchaseOrder');
});