Plugin Directory

Changeset 3178077


Ignore:
Timestamp:
10/29/2024 01:58:08 PM (17 months ago)
Author:
productfeeder
Message:

Updated to version 3.0.0

Location:
product-feeder
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • product-feeder/tags/3.0.0/includes/product-feeder.php

    r3178071 r3178077  
    326326                                        if (($product->get_type() == 'simple' && $Item['VariationID'] == $Item['ProductID']) || in_array($Item['VariationID'], $product->get_children())) {
    327327                                            $variation = wc_get_product($Item['VariationID']);
    328                                             $VATPercentage = ($product->get_price_including_tax() - $product->get_price_excluding_tax()) / $product->get_price_excluding_tax();
     328                                            $VATPercentage = ($product->is_taxable()) ? ($product->get_price_including_tax() - $product->get_price_excluding_tax()) / $product->get_price_excluding_tax() : 0;
    329329                                            if ($variation instanceof WC_Product) $ItemsToAddToOrder[] = array('Variation' => $variation, 'Quantity' => $Item['Quantity'], 'Price' => $Item['Price'], 'PriceExclVAT' => number_format($Item['Price'] / (1 + $VATPercentage), 2, ".", ""));
    330330                                            else $Errors[] = array('Type' => 'VARIATION NOT FOUND', 'Variables' => array('Name' => $Item['Name'], 'Variant' => $Item['Variant'], 'ProductID' => $Item['ProductID'], 'VariationID' => $Item['VariationID']));
  • product-feeder/trunk/includes/product-feeder.php

    r3178070 r3178077  
    326326                                        if (($product->get_type() == 'simple' && $Item['VariationID'] == $Item['ProductID']) || in_array($Item['VariationID'], $product->get_children())) {
    327327                                            $variation = wc_get_product($Item['VariationID']);
    328                                             $VATPercentage = ($product->get_price_including_tax() - $product->get_price_excluding_tax()) / $product->get_price_excluding_tax();
     328                                            $VATPercentage = ($product->is_taxable()) ? ($product->get_price_including_tax() - $product->get_price_excluding_tax()) / $product->get_price_excluding_tax() : 0;
    329329                                            if ($variation instanceof WC_Product) $ItemsToAddToOrder[] = array('Variation' => $variation, 'Quantity' => $Item['Quantity'], 'Price' => $Item['Price'], 'PriceExclVAT' => number_format($Item['Price'] / (1 + $VATPercentage), 2, ".", ""));
    330330                                            else $Errors[] = array('Type' => 'VARIATION NOT FOUND', 'Variables' => array('Name' => $Item['Name'], 'Variant' => $Item['Variant'], 'ProductID' => $Item['ProductID'], 'VariationID' => $Item['VariationID']));
Note: See TracChangeset for help on using the changeset viewer.