# tier-pricing-table/2.3.2/views/frontend/price-table-fixed.php

Tiered Pricing Table for WooCommerce, version 2.3.2. 194 lines.

- Page: https://pluginprobe.com/plugins/tier-pricing-table/2.3.2/code/views/frontend/price-table-fixed.php
- Raw: https://pluginprobe.com/plugins/tier-pricing-table/2.3.2/raw/views/frontend/price-table-fixed.php
- Modified: 2019-06-04T08:16:52+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tier-pricing-table/2.3.2/code/views/frontend/price-table-fixed.php#L10-L20`.

```php
<?php

if ( !defined( 'WPINC' ) ) {
    die;
}
/**
 * @var array $price_rules
 * @var string $real_price
 * @var int $product_id ;
 */
?>

<?php 

if ( !empty($price_rules) ) {
    ?>

    <div class="price-rules-table-wrapper">
		<?php 
    
    if ( !empty($settings['table_title']) ) {
        ?>
            <h3 style="clear:both;"><?php 
        echo  $settings['table_title'] ;
        ?></h3>
		<?php 
    }
    
    ?>

		<?php 
    do_action( 'before_fixed_tier_pricing_table' );
    ?>

        <table class="shop_table price-rules-table <?php 
    echo  $settings['table_css_class'] ;
    ?>" data-price-rules-table
               data-product-id="<?php 
    echo  $product_id ;
    ?>"
               data-price-rules="<?php 
    echo  htmlspecialchars( json_encode( $price_rules ) ) ;
    ?>">

			<?php 
    
    if ( $settings['head_quantity_text'] != '' && $settings['head_price_text'] != '' ) {
        ?>
                <thead>
                <tr>
                    <th><span class="nobr"><?php 
        echo  sanitize_text_field( $settings['head_quantity_text'] ) ;
        ?></span>
                    </th>
                    <th><span class="nobr"><?php 
        echo  sanitize_text_field( $settings['head_price_text'] ) ;
        ?></span>
                    </th>
					<?php 
        do_action(
            'tier_pricing_table_fixed_header_columns',
            $price_rules,
            $real_price,
            $product_id
        );
        ?>
                </tr>
                </thead>
			<?php 
    }
    
    ?>

            <tbody>
            <tr data-price-rules-amount="1"
                data-price-rules-price="<?php 
    echo  wc_get_price_to_display( wc_get_product( $product_id ), [
        'price' => $real_price,
    ] ) ;
    ?>" data-price-rules-row>
                <td>
					<?php 
    
    if ( 1 === array_keys( $price_rules )[0] - 1 ) {
        ?>
                        <span>1</span>
					<?php 
    } else {
        ?>
                        <span>1 - <?php 
        echo  array_keys( $price_rules )[0] - 1 ;
        ?></span>
					<?php 
    }
    
    ?>
                </td>
                <td>
                    <span data-price-rules-formated-price><?php 
    echo  wc_price( wc_get_price_to_display( wc_get_product( $product_id ), [
        'price' => $real_price,
    ] ) ) ;
    ?></span>
                </td>
            </tr>

			<?php 
    $iterator = new ArrayIterator( $price_rules );
    ?>

			<?php 
    while ( $iterator->valid() ) {
        ?>
				<?php 
        $current_price = $iterator->current();
        $current_quantity = $iterator->key();
        $iterator->next();
        
        if ( $iterator->valid() ) {
            $quantity = $current_quantity;
            if ( intval( $iterator->key() - 1 != $current_quantity ) ) {
                $quantity = $quantity . ' - ' . intval( $iterator->key() - 1 );
            }
        } else {
            $quantity = $current_quantity . '+';
        }
        
        ?>
                <tr data-price-rules-amount="<?php 
        echo  $current_quantity ;
        ?>"
                    data-price-rules-price="<?php 
        echo  wc_get_price_to_display( wc_get_product( $product_id ), [
            'price' => $current_price,
        ] ) ;
        ?>" data-price-rules-row>
                    <td>
                        <span><?php 
        echo  $quantity ;
        ?></span>
                    </td>
                    <td>
                        <span data-price-rules-formated-price><?php 
        echo  wc_price( wc_get_price_to_display( wc_get_product( $product_id ), [
            'price' => $current_price,
        ] ) ) ;
        ?></span>
                    </td>
                </tr>

				<?php 
        do_action(
            'tier_pricing_table_fixed_body_columns',
            $iterator,
            $price_rules,
            $real_price,
            $product_id
        );
        ?>

			<?php 
    }
    ?>

            </tbody>
        </table>

		<?php 
    do_action( 'after_fixed_tier_pricing_table' );
    ?>

    </div>

    <style>
        <?php 
    if ( $settings['clickable_table_rows'] === "yes" ) {
    }
    ?>

        .price-rule-active td {
            background-color: <?php 
    echo  $settings['selected_quantity_color'] ;
    ?> !important;
        }

        .price-rules-table-wrapper {
        <?php 
    echo  ( $settings['display_type'] === 'tooltip' ? 'display: none; ' : '' ) ;
    ?>
        }
    </style>
<?php 
}

```
