PluginProbe
Tiered Pricing Table for WooCommerce / trunk
Tiered Pricing Table for WooCommerce vtrunk
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 2.3.4 All 90 releases
tier-pricing-table / src / Frontend / Frontend.php

Frontend.php in Tiered Pricing Table for WooCommerce trunk, at src/Frontend/Frontend.php

49 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\Frontend;
2
3 use TierPricingTable\Core\ServiceContainerTrait;
4 use TierPricingTable\TierPricingTablePlugin;
5 use WP_Post;
6
7 /**
8 * Class Frontend
9 *
10 * @package TierPricingTable\Frontend
11 */
12 class Frontend {
13
14 use ServiceContainerTrait;
15
16 public function __construct() {
17
18 new PricingTableShortcode();
19
20 add_action( 'wp_enqueue_scripts', array( $this, 'enqueueAssets' ), 10, 1 );
21 }
22
23 public function enqueueAssets() {
24 wp_enqueue_script( 'tiered-pricing-table-front-js',
25 $this->getContainer()->getFileManager()->locateJSAsset( 'frontend/product-tiered-pricing-table' ),
26 array( 'jquery' ), TierPricingTablePlugin::VERSION );
27
28 wp_enqueue_style( 'tiered-pricing-table-front-css',
29 $this->getContainer()->getFileManager()->locateCSSAsset( 'frontend/main.css' ), null,
30 TierPricingTablePlugin::VERSION );
31
32 wp_localize_script( 'tiered-pricing-table-front-js', 'tieredPricingGlobalData', [
33 'version' => TierPricingTablePlugin::VERSION,
34 'loadVariationTieredPricingNonce' => wp_create_nonce( 'get_pricing_table' ),
35 'isPremium' => ! tpt_fs()->can_use_premium_code() ? 'no' : 'yes',
36 'currencyOptions' => [
37 'currency_symbol' => get_woocommerce_currency_symbol(),
38 'decimal_separator' => wc_get_price_decimal_separator(),
39 'thousand_separator' => wc_get_price_thousand_separator(),
40 'decimals' => wc_get_price_decimals(),
41 'price_format' => get_woocommerce_price_format(),
42 'trim_zeros' => apply_filters( 'woocommerce_price_trim_zeros', false ),
43 ],
44 'supportedVariableProductTypes' => TierPricingTablePlugin::getSupportedVariableProductTypes(),
45 'supportedSimpleProductTypes' => TierPricingTablePlugin::getSupportedSimpleProductTypes(),
46 ] );
47 }
48 }
49