mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Refresh dcc/pui status caches on plugin update
Since #1273 we started clearing these caches on plugin updates. But we are updating these caches only on some admin pages (583dea8d99/modules/ppcp-wc-gateway/src/WCGatewayModule.php (L421-L428)
) to avoid the API calls on every request in some cases, so DCC may become hidden if not visited these pages after update. Maybe we can do it more frequently now after92ae16f99
. But for now simply refreshing the caches during plugin update.
This commit is contained in:
parent
583dea8d99
commit
f4c3caedcf
1 changed files with 9 additions and 0 deletions
|
@ -278,6 +278,15 @@ class WCGatewayModule implements ModuleInterface {
|
|||
$settings->set( 'products_dcc_enabled', false );
|
||||
$settings->set( 'products_pui_enabled', false );
|
||||
$settings->persist();
|
||||
|
||||
// Update caches.
|
||||
$dcc_status = $c->get( 'wcgateway.helper.dcc-product-status' );
|
||||
assert( $dcc_status instanceof DCCProductStatus );
|
||||
$dcc_status->dcc_is_active();
|
||||
|
||||
$pui_status = $c->get( 'wcgateway.pay-upon-invoice-product-status' );
|
||||
assert( $pui_status instanceof PayUponInvoiceProductStatus );
|
||||
$pui_status->pui_is_active();
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue