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
tier-pricing-table / src / Addons / RequestAQuote / Frontend / Adapters / PlainTextAdapter.php

PlainTextAdapter.php in Tiered Pricing Table for WooCommerce 8.0.2, at src/Addons/RequestAQuote/Frontend/Adapters/PlainTextAdapter.php

31 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\Addons\RequestAQuote\Frontend\Adapters;
2
3 use TierPricingTable\Core\ServiceContainer;
4 use TierPricingTable\PricingRule;
5
6 class PlainTextAdapter extends AbstractLayoutAdapter {
7
8 public function registerHooks() {
9 add_action( 'tiered_pricing_table/plain-text/after_lines', array( $this, 'renderFormPrompt' ), 10, 2 );
10 add_action( 'tiered_pricing_table/plain-text/line', array( $this, 'render' ), 10, 2 );
11 }
12
13 public function render( PricingRule $pricingRule, $settings = array() ) {
14 $form = $this->getValidFormForIntegratedPosition( $pricingRule );
15
16 if ( ! $form ) {
17 return;
18 }
19 ServiceContainer::getInstance()->getFileManager()->includeTemplate(
20 'frontend/integrated/plain-text.php',
21 array(
22 'form' => $form,
23 'productId' => $pricingRule->getProductId(),
24 'plainTextStyle' => $settings['plain_text_style'] ?? 'default',
25 'buttonHtml' => $this->getQuoteButtonHtml( $form, $pricingRule->getProductId(), '', '' )
26 ),
27 plugin_dir_path( dirname( __DIR__ ) ) . 'views/'
28 );
29 }
30 }
31