PluginProbe
Tiered Pricing Table for WooCommerce / 8.0.2
Tiered Pricing Table for WooCommerce v8.0.2
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
← All changes | src/Addons/RequestAQuote/Frontend/Adapters/TableAdapter.php +10 -1 7.1.1 → 8.0.2 View file →
@@ -20,11 +20,18 @@
20 20
21 21 $isDivTable = strpos( $templateName, 'style-' ) !== false;
22 22
23 23 $hasQty = ! empty( $settings['quantity_column_title'] ) || ! isset( $settings['quantity_column_title'] );
24 - $hasDiscount = ! empty( $settings['discount_column_title'] ) || ! empty( $settings['show_discount_column'] );
24 + $hasDiscount = ! empty( $settings['discount_column_title'] ); // the table draws the discount column from its header only
25 25 $hasPrice = ! empty( $settings['price_column_title'] ) || ! isset( $settings['price_column_title'] );
26 26
27 + // the row spans the whole table: the base columns plus whatever the header hook adds (custom columns)
28 + ob_start();
29 + do_action( 'tiered_pricing_table/tiered_pricing/header_columns', $pricingRule );
30 + $extraColumns = (int) preg_match_all( '/<th\b/i', (string) ob_get_clean() );
31 + $columns = (int) $hasQty + (int) $hasDiscount + (int) $hasPrice + $extraColumns;
32 + $span = max( 1, $columns - (int) $hasQty );
33 +
27 34 ServiceContainer::getInstance()->getFileManager()->includeTemplate( 'frontend/integrated/table.php', array(
28 35 'form' => $form,
29 36 'productId' => $pricingRule->getProductId(),
30 37 'isDivTable' => $isDivTable,
@@ -30,8 +37,10 @@
30 37 'isDivTable' => $isDivTable,
31 38 'hasQty' => $hasQty,
32 39 'hasPrice' => $hasPrice,
33 40 'hasDiscount' => $hasDiscount,
41 + 'columns' => $columns,
42 + 'span' => $span,
34 43 'buttonHtml' => $this->getQuoteButtonHtml( $form, $pricingRule->getProductId(),
35 44 $isDivTable ? 'button wp-element-button' : 'button wp-element-button alt',
36 45 'padding: 5px 10px;margin:0; float:right', 'tpt-raq-table' ),
37 46 ), plugin_dir_path( dirname( __DIR__ ) ) . 'views/' );