Skip to content

Commit

Permalink
Added a filter to allow marking some products as photovoltaic accesso…
Browse files Browse the repository at this point in the history
…ries in case a vat exemption exists.
  • Loading branch information
dennisnissle committed Oct 30, 2024
1 parent 77da694 commit 1e62719
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/class-wc-gzd-checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public function maybe_adjust_photovoltaic_cart_data( $cart ) {
foreach ( $cart->get_cart() as $cart_item_key => $values ) {
$_product = apply_filters( 'woocommerce_cart_item_product', $values['data'], $values, $cart_item_key );

if ( wc_gzd_get_product( $_product )->is_photovoltaic_system() ) {
if ( wc_gzd_get_product( $_product )->is_photovoltaic_system() || apply_filters( 'woocommerce_gzd_photovoltaic_cart_product_is_photovoltaic_accessory', false, $_product ) ) {
if ( wc_prices_include_tax() && 'yes' === get_option( 'woocommerce_gzd_photovoltaic_systems_net_price' ) ) {
$price = $_product->get_price();
$excluding_tax = wc_get_price_excluding_tax(
Expand All @@ -358,7 +358,7 @@ public function maybe_adjust_photovoltaic_cart_data( $cart ) {
foreach ( $cart->get_cart() as $cart_item_key => $values ) {
$_product = apply_filters( 'woocommerce_cart_item_product', $values['data'], $values, $cart_item_key );

if ( wc_gzd_get_product( $_product )->is_photovoltaic_system() ) {
if ( wc_gzd_get_product( $_product )->is_photovoltaic_system() || apply_filters( 'woocommerce_gzd_photovoltaic_cart_product_is_photovoltaic_accessory', false, $_product ) ) {
$zero_tax_class = get_option( 'woocommerce_gzd_photovoltaic_systems_zero_tax_class', 'zero-rate' );

/**
Expand Down

0 comments on commit 1e62719

Please sign in to comment.