Plugin Directory

Changeset 3466938


Ignore:
Timestamp:
02/22/2026 03:32:28 PM (6 weeks ago)
Author:
rspective
Message:

Committing changes for v4.1.1

Location:
voucherify/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • voucherify/trunk/readme.txt

    r3241413 r3466938  
    77WC tested up to: 9.4.2
    88WC requires at least: 5.3.3
    9 Stable tag: 4.1.0
     9Stable tag: 4.1.1
    1010
    1111Integrates Voucherify API with woocommerce
     
    4949
    5050== Changelog ==
     51
     52= 4.1.1 - 2026-02-22 =
     53* Fix: fatal error when processing order with line item that has no linked product
    5154
    5255= 4.1.0 - 2025-02-12 =
  • voucherify/trunk/src/Voucherify/Wordpress/Common/Helpers/Commons.php

    r3241413 r3466938  
    295295            $product                 = $item->get_product();
    296296
    297             if (in_array($product->get_type(), ['variation', 'subscription_variation'])) {
     297            if (empty($product)) {
     298                $sourceId = "line-item-" . $item->get_id();
     299                $relatedObject = 'product';
     300            } elseif (in_array($product->get_type(), ['variation', 'subscription_variation'])) {
    298301                $sourceId = createVcrfVariantSourceId($item->get_product_id());
    299302                $relatedObject = 'sku';
     
    307310            $itemProperties['quantity']       = $quantity;
    308311            $itemProperties['price']          = $price;
     312
     313            if (empty($product)) {
     314                wc_get_logger()->info("Line item with empty product", ['source' => 'voucherify', "item" => $item->get_data(), "itemProperties" => $itemProperties]);
     315            }
    309316
    310317            $items[] = $itemProperties;
  • voucherify/trunk/src/Voucherify/Wordpress/Discounts/Discounts.php

    r3241413 r3466938  
    210210    private function is_taxable($item)
    211211    {
    212         $is_taxable_product         = $item->type == 'product' && $item->product->is_taxable();
    213         $is_taxable_shipping_or_fee = in_array($item->type, ['shipping', 'fee']) && $item->taxable;
    214 
    215         return $is_taxable_product || $is_taxable_shipping_or_fee;
     212        return in_array($item->type, ['shipping', 'fee', 'product']) && $item->taxable;
    216213    }
    217214
  • voucherify/trunk/src/Voucherify/Wordpress/Discounts/DiscountsOrder.php

    r3241413 r3466938  
    3636
    3737        foreach ($this->order->get_items() as $cart_item_key => $cartItem) {
     38            /** @var \WC_Order_Item_Product $cartItem */
    3839            $item                     = $this->get_default_item_props();
    3940            $item->key                = $cart_item_key;
    4041            $item->object             = $cartItem;
    41             $item->tax_class          = $cartItem->get_product()->get_tax_class();
    42             $item->taxable            = 'taxable' === $cartItem->get_product()->get_tax_status();
     42            $item->tax_class          = $cartItem->get_tax_class();
     43            $item->taxable            = 'taxable' === $cartItem->get_tax_status();
    4344            $item->price_includes_tax = true;
    4445            $item->quantity           = $cartItem->get_quantity();
    4546            $item->product            = $cartItem->get_product();
    46             $rates                    = WC_Tax::get_rates($cartItem->get_product()->get_tax_class());
     47            $rates                    = WC_Tax::get_rates($cartItem->get_tax_class());
    4748            $item->tax_rates          = $rates;
    4849            $item->price              = wc_add_number_precision_deep(
  • voucherify/trunk/vendor/autoload.php

    r3241413 r3466938  
    1515        }
    1616    }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     17    throw new RuntimeException($err);
    2118}
    2219
  • voucherify/trunk/vendor/composer/InstalledVersions.php

    r3241413 r3466938  
    2727class InstalledVersions
    2828{
     29    /**
     30     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
     31     * @internal
     32     */
     33    private static $selfDir = null;
     34
    2935    /**
    3036     * @var mixed[]|null
     
    324330
    325331    /**
     332     * @return string
     333     */
     334    private static function getSelfDir()
     335    {
     336        if (self::$selfDir === null) {
     337            self::$selfDir = strtr(__DIR__, '\\', '/');
     338        }
     339
     340        return self::$selfDir;
     341    }
     342
     343    /**
    326344     * @return array[]
    327345     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
     
    337355
    338356        if (self::$canGetVendors) {
    339             $selfDir = strtr(__DIR__, '\\', '/');
     357            $selfDir = self::getSelfDir();
    340358            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
    341359                $vendorDir = strtr($vendorDir, '\\', '/');
  • voucherify/trunk/vendor/composer/autoload_static.php

    r3241413 r3466938  
    88{
    99    public static $prefixLengthsPsr4 = array (
    10         'V' => 
     10        'V' =>
    1111        array (
    1212            'Voucherify\\Wordpress\\' => 21,
     
    1717
    1818    public static $prefixDirsPsr4 = array (
    19         'Voucherify\\Wordpress\\' => 
     19        'Voucherify\\Wordpress\\' =>
    2020        array (
    2121            0 => __DIR__ . '/../..' . '/src/Voucherify/Wordpress',
    2222        ),
    23         'Voucherify\\Test\\Helpers\\' => 
     23        'Voucherify\\Test\\Helpers\\' =>
    2424        array (
    2525            0 => __DIR__ . '/..' . '/rspective/voucherify/test/helpers',
    2626        ),
    27         'Voucherify\\' => 
     27        'Voucherify\\' =>
    2828        array (
    2929            0 => __DIR__ . '/../..' . '/src/Voucherify',
  • voucherify/trunk/vendor/composer/installed.php

    r3241413 r3466938  
    22    'root' => array(
    33        'name' => '__root__',
    4         'pretty_version' => '4.1.0.x-dev',
    5         'version' => '4.1.0.9999999-dev',
    6         'reference' => '241602cd0336883bba821232c510a0726117a364',
     4        'pretty_version' => '4.1.1.x-dev',
     5        'version' => '4.1.1.9999999-dev',
     6        'reference' => '320d67fc7d7c5c41ecf63869df188544adfe507e',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '__root__' => array(
    14             'pretty_version' => '4.1.0.x-dev',
    15             'version' => '4.1.0.9999999-dev',
    16             'reference' => '241602cd0336883bba821232c510a0726117a364',
     14            'pretty_version' => '4.1.1.x-dev',
     15            'version' => '4.1.1.9999999-dev',
     16            'reference' => '320d67fc7d7c5c41ecf63869df188544adfe507e',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
  • voucherify/trunk/voucherify.php

    r3241413 r3466938  
    88 * Plugin URI: https://wordpress.org/plugins/voucherify/
    99 * Description: Integrates Voucherify API with woocommerce replacing core coupons functionality
    10  * Version: 4.1.0
     10 * Version: 4.1.1
    1111 * Author: rspective
    1212 * Author URI: https://www.rspective.com/
Note: See TracChangeset for help on using the changeset viewer.