How to get all licenses for WooCommerce order

To get all the licenses that are assigned to specific WooCommerce order, use the following code and adjust it to fit your needs.

$licenses = \IdeoLogix\DigitalLicenseManager\Database\Repositories\Licenses::instance()->get(['order_id' => 358]);
foreach($licenses as $license) {
	echo $license->getId() . "\n";
	echo $license->getDecryptedLicenseKey() . "\n";
        echo $license->isExpired() . "\n";

Leave a Reply

Your email address will not be published. Required fields are marked *