PluginProbe
Tiered Pricing Table for WooCommerce / 7.1.1
Tiered Pricing Table for WooCommerce v7.1.1
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 / WooPaymentsMulticurrency.php

WooPaymentsMulticurrency.php in Tiered Pricing Table for WooCommerce 7.1.1, at src/Integrations/Plugins/WooPaymentsMulticurrency.php

54 lines 1.4 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 WooPaymentsMulticurrency extends PluginIntegrationAbstract {
6
7 public function run() {
8 add_filter( 'tiered_pricing_table/price/pricing_rule', function ( PricingRule $pricingRule ) {
9
10 // Break if WooPayments MultiCurrency is not installed
11 if ( ! class_exists( '\WCPay\MultiCurrency\MultiCurrency' ) ) {
12 return $pricingRule;
13 }
14
15 if ( $pricingRule->isFixed() ) {
16 $rules = [];
17
18 foreach ( $pricingRule->getRules() as $quantity => $price ) {
19 $rules[ $quantity ] = \WCPay\MultiCurrency\MultiCurrency::instance()->get_price( $price, 'product' );
20 }
21
22 $pricingRule->setRules( $rules );
23 }
24
25 return $pricingRule;
26
27 }, 9999, 1 );
28 }
29
30 public function getTitle(): string {
31 return 'WooPayments Multicurrency';
32 }
33
34 public function getAuthorURL(): string {
35 return 'https://woocommerce.com/products/woocommerce-payments/';
36 }
37
38 public function getIconURL(): string {
39 return $this->getContainer()->getFileManager()->locateAsset( 'admin/integrations/woocommerce-develop.jpeg' );
40 }
41
42 public function getDescription(): string {
43 return __( 'Convert and display tiered pricing correctly when using WooPayments Multicurrency.', 'tier-pricing-table' );
44 }
45
46 public function getSlug(): string {
47 return 'woopayments-multicurrency';
48 }
49
50 public function getIntegrationCategory(): string {
51 return 'multicurrency';
52 }
53 }
54