| 1 |
<?php |
| 2 |
/** |
| 3 |
* Request a Quote Table Integrated Template. |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/tiered-pricing-table/integrated/table.php. |
| 6 |
* |
| 7 |
* @var \TierPricingTable\Addons\RequestAQuote\Models\RequestQuoteForm $form |
| 8 |
* @var int $productId |
| 9 |
* @var bool $isDivTable |
| 10 |
* @var bool $hasQty |
| 11 |
* @var bool $hasPrice |
| 12 |
* @var bool $hasDiscount |
| 13 |
* @var int $columns every column of the table, custom columns included |
| 14 |
* @var int $span columns the button cell covers (everything after the quantity cell) |
| 15 |
* @var string $buttonHtml |
| 16 |
*/ |
| 17 |
if ( ! defined( 'ABSPATH' ) ) { |
| 18 |
exit; |
| 19 |
} |
| 20 |
|
| 21 |
// templates copied before the custom-columns fix pass no span; behave as they did |
| 22 |
$span = isset( $span ) ? (int) $span : ( ! empty( $hasDiscount ) ? 2 : 1 ); |
| 23 |
|
| 24 |
if ( $isDivTable ) : ?> |
| 25 |
<div class="tiered-pricing-table-row tpt-request-quote-integrated-row" |
| 26 |
style="cursor: pointer; grid-template-columns: <?php echo esc_attr( $hasQty ? '1fr ' . $span . 'fr' : '1fr' ); ?>;" |
| 27 |
onclick="document.getElementById('tpt-raq-table-<?php echo esc_attr( $productId ); ?>').click();"> |
| 28 |
<?php if ( $hasQty ) : ?> |
| 29 |
<div class="tiered-pricing-table__quantity"> |
| 30 |
<span class="tiered-pricing-table-row-qty"> |
| 31 |
<?php echo esc_html( $form->getIntegratedLabelText() ); ?> |
| 32 |
</span> |
| 33 |
</div> |
| 34 |
<?php endif; ?> |
| 35 |
|
| 36 |
<?php if ( $hasPrice ) : ?> |
| 37 |
<div class="tiered-pricing-table__price" style="margin-left:auto"> |
| 38 |
<span> |
| 39 |
<?php echo wp_kses_post($buttonHtml); ?> |
| 40 |
</span> |
| 41 |
</div> |
| 42 |
<?php endif; ?> |
| 43 |
</div> |
| 44 |
<?php else : ?> |
| 45 |
<tr class="tiered-pricing-table-row tpt-request-quote-integrated-row" style="cursor: pointer;" |
| 46 |
onclick="document.getElementById('tpt-raq-table-<?php echo esc_attr( $productId ); ?>').click();"> |
| 47 |
<?php if ( $hasQty ) : ?> |
| 48 |
<td class="tiered-pricing-table__quantity" style="vertical-align: middle"> |
| 49 |
<span> |
| 50 |
<?php echo esc_html( $form->getIntegratedLabelText() ); ?> |
| 51 |
</span> |
| 52 |
</td> |
| 53 |
<?php endif; ?> |
| 54 |
<?php if ( $hasPrice ) : ?> |
| 55 |
<td class="tiered-pricing-table__price" <?php echo $span > 1 ? 'colspan="' . (int) $span . '"' : ''; ?> style="text-align: right"> |
| 56 |
<span> |
| 57 |
<?php echo wp_kses_post($buttonHtml); ?> |
| 58 |
</span> |
| 59 |
</td> |
| 60 |
<?php endif; ?> |
| 61 |
</tr> |
| 62 |
<?php endif; ?> |
| 63 |
|