Getting previous order history in a Commerce 2 adjuster
The method to check the previous orders would look something like this:

public function checkIfDonated($order)
{

    $email = $order-&gt;getEmail();

    if (!$email) {
        return false;
    }

    $orders = Plugin::getInstance()-&gt;getOrders()-&gt;getOrdersByEmail($email);

    $didDonate = false;
    foreach ($orders as $previousOrder) {
        foreach ($previousOrder-&gt;getLineItems() as $lineItem) {
            $purchable = $lineItem-&gt;getPurchasable();
            if ($purchable &amp;&amp; $purchable instanceof \craft\commerce\elements\Variant &amp;&amp; $purchasable-&gt;getProduct()-&gt;getType()-&gt;handle == 'typeA') {
                $didDonate = true;
            }
        }
    }

    return $didDonate;
}


That above assumes you want to look at all orders made by anyone with that email address. You could add additional guards after the email check to see if they are logged in as a user etc. Hope that helps.

Also, don't forget to pass the order to the method: if ($this-&gt;checkIfDonated($order) == true)

And to add the Plugin import: use craft\commerce\Plugin; to the top of the adjuster class.