PluginProbe
Tiered Pricing Table for WooCommerce / 6.1.0
Tiered Pricing Table for WooCommerce v6.1.0
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 / Integrations / Plugins / AeliaMulticurrency.php

AeliaMulticurrency.php in Tiered Pricing Table for WooCommerce 6.1.0, at src/Integrations/Plugins/AeliaMulticurrency.php

57 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\Integrations\Plugins;
2
3 use TierPricingTable\PricingRule;
4
5 class AeliaMulticurrency extends PluginIntegrationAbstract {
6
7 public function run() {
8 add_filter( 'tiered_pricing_table/price/pricing_rule', function ( PricingRule $pricingRule ) {
9
10 // Break if Aelia multicurrency is not installed
11 if ( ! has_action( 'wc_aelia_cs_convert' ) ) {
12 return $pricingRule;
13 }
14
15 $from_currency = get_option( 'woocommerce_currency' );
16 $to_currency = get_woocommerce_currency();
17
18 if ( $pricingRule->isFixed() ) {
19 $_rules = [];
20
21 foreach ( $pricingRule->getRules() as $quantity => $price ) {
22 $_rules[ $quantity ] = apply_filters( 'wc_aelia_cs_convert', $price, $from_currency, $to_currency );
23 }
24
25 $pricingRule->setRules( $_rules );
26 }
27
28 return $pricingRule;
29
30 }, 9999, 2 );
31 }
32
33 public function getTitle(): string {
34 return __( 'Aelia Multicurrency', 'tier-pricing-table' );
35 }
36
37 public function getAuthorURL(): string {
38 return 'https://aelia.co/shop/currency-switcher-woocommerce/';
39 }
40
41 public function getIconURL(): string {
42 return $this->getContainer()->getFileManager()->locateAsset( 'admin/integrations/aelia-icon.svg' );
43 }
44
45 public function getDescription(): string {
46 return __( 'Make the tiered pricing properly work with multiple currencies.', 'tier-pricing-table' );
47 }
48
49 public function getSlug(): string {
50 return 'aelia-multicurrency';
51 }
52
53 public function getIntegrationCategory(): string {
54 return 'multicurrency';
55 }
56 }
57