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 / OptionsAdapter.php

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

34 lines 1.1 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 OptionsAdapter extends AbstractLayoutAdapter {
7
8 public function registerHooks() {
9 add_action( 'tiered_pricing_table/options/after_options', array( $this, 'renderFormPrompt' ), 10, 1 );
10 add_action( 'tiered_pricing_table/options/options', array( $this, 'render' ), 10, 2 );
11 }
12
13 public function render( PricingRule $pricingRule, $settings = array() ) {
14 $form = $this->getValidFormForIntegratedPosition( $pricingRule );
15 if ( ! $form ) {
16 return;
17 }
18
19 $optionsStyle = $settings['options_style'] ?? 'default';
20
21 $productId = $pricingRule->getProductId();
22 ServiceContainer::getInstance()->getFileManager()->includeTemplate(
23 'frontend/integrated/options.php',
24 array(
25 'form' => $form,
26 'productId' => $productId,
27 'optionsStyle' => $optionsStyle,
28 'buttonHtml' => $this->getQuoteButtonHtml( $form, $productId, 'button alt wp-element-button', 'padding: 5px 10px;' )
29 ),
30 plugin_dir_path( dirname( __DIR__ ) ) . 'views/'
31 );
32 }
33 }
34