Ejemplo n.º 1
0
function it_builder_add_exchange_body_class($classes)
{
    if (!function_exists('it_exchange_is_page')) {
        return $classes;
    }
    if (it_exchange_is_page('store')) {
        $classes[] = 'exchange-store';
    } elseif (it_exchange_is_page('cart')) {
        $classes[] = 'exchange-cart';
    }
    return $classes;
}
Ejemplo n.º 2
0
/**
 * On the downloads page, exclude transactions that are renewing a key.
 *
 * @since 1.0
 *
 * @param \IT_Exchange_Transaction[] $transactions
 * @param \IT_Exchange_Customer      $customer
 *
 * @return \IT_Exchange_Transaction[]
 */
function exclude_renewals_from_downloads_page($transactions, $customer)
{
    if (it_exchange_is_page('downloads')) {
        $transactions = array_filter($transactions, function (\IT_Exchange_Transaction $transaction) {
            foreach ($transaction->get_products() as $product) {
                if (!empty($product['renewed_key'])) {
                    return false;
                }
            }
            return true;
        });
    }
    return $transactions;
}