PHP code example of mothership-ec / cog-mothership-returns

1. Go to this page and download the library: Download mothership-ec/cog-mothership-returns 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/ */

    

mothership-ec / cog-mothership-returns example snippets


$assembler = $this->get('return.assembler');

$assembler->setReturn($return);

$return = $assembler->getReturn();

$assembler->setCurrency('EUR');

// Standard
$orderItem = $this->get('order.item.loader')->getByID(1);
$assembler->setReturnItem($orderItem);

// Standalone
$productUnit = $this->get('product.unit.loader')->getByID(1);
$assembler->setReturnItem($productUnit);