Skip to content

Commit

Permalink
single product display
Browse files Browse the repository at this point in the history
  • Loading branch information
iworks committed Dec 13, 2024
1 parent dc2b23c commit 22d18f6
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 427 deletions.
25 changes: 0 additions & 25 deletions includes/iworks/omnibus/class-iworks-omnibus-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,31 +383,6 @@ protected function add_message( $price, $price_lowest, $format_price_callback =
if ( isset( $price_lowest['price_sale'] ) ) {
$price_to_show = $price_lowest['price_sale'];
}
/**
* WooCommerce: include tax
*/
if ( 'no' === get_option( 'woocommerce_prices_include_tax' ) ) {
if ( 'yes' === get_option( $this->get_name( 'include_tax' ), 'yes' ) ) {
if (
isset( $price_lowest['price_including_tax'] )
&& $price_lowest['price_including_tax'] > $price_to_show
) {
$price_to_show = $price_lowest['price_including_tax'];
} else {
global $product;
if ( is_object( $product ) ) {
$tax = new WC_Tax();
if ( ! empty( $tax ) ) {
$taxes = $tax->get_rates( $product->get_tax_class() );
if ( ! empty( $taxes ) ) {
$t = array_shift( $taxes );
$price_to_show = ( 100 + $t['rate'] ) * $price_to_show / 100;
}
}
}
}
}
}
if ( is_callable( $format_price_callback ) ) {
$price_to_show = $format_price_callback( $price_to_show );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,30 +112,6 @@ protected function get_settings_for_default_section() {
'id' => $this->get_name( 'sectionend' ),
),
);
/**
* WooCommerce Tax
*/
if (
'yes' === get_option( 'woocommerce_calc_taxes', 'no' )
&& 'no' === get_option( 'woocommerce_prices_include_tax', 'no' )
) {
$settings[] = array(
'title' => __( 'Tax', 'omnibus' ),
'type' => 'title',
'id' => $this->get_name( 'tax' ),
);
$settings[] = array(
'title' => __( 'Include tax', 'omnibus' ),
'id' => $this->get_name( 'include_tax' ),
'default' => 'yes',
'type' => 'checkbox',
'desc' => __( 'Display price with tax', 'omnibus' ),
);
$settings[] = array(
'type' => 'sectionend',
'id' => $this->get_name( 'tax-sectionend' ),
);
}
/**
* Products
*/
Expand Down
Loading

0 comments on commit 22d18f6

Please sign in to comment.