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

RequestAQuoteAddon.php in Tiered Pricing Table for WooCommerce 8.0.2, at src/Addons/RequestAQuote/RequestAQuoteAddon.php

41 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TierPricingTable\Addons\RequestAQuote;
4
5 use TierPricingTable\Addons\AbstractAddon;
6 class RequestAQuoteAddon extends AbstractAddon {
7 public function getName() : string {
8 return __( 'Request a Quote', 'tier-pricing-table' );
9 }
10
11 public function getDescription() : string {
12 return __( 'Allow customers to request a custom quote.', 'tier-pricing-table' );
13 }
14
15 public function getIcon() : string {
16 return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>';
17 }
18
19 public function getSlug() : string {
20 return 'request-a-quote';
21 }
22
23 public function run() {
24 // Always init settings and forms REST API so users can create forms
25 new Settings\Settings();
26 add_action( 'rest_api_init', function () {
27 ( new API\FormsEndpoint() )->register_routes();
28 ( new API\SettingsEndpoint() )->register_routes();
29 } );
30 // Conditionally init the rest if forms exist
31 $forms = Models\RequestQuoteForm::getAll();
32 if ( empty( $forms ) ) {
33 return;
34 }
35 new Frontend\QuoteFormDisplay();
36 new Frontend\API\SubmitQuoteEndpoint();
37 new Integration\PricingRulesIntegration();
38 }
39
40 }
41