mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Remove the mapping and just add a check
This commit is contained in:
parent
957c8273f8
commit
6cee316be4
1 changed files with 4 additions and 3 deletions
|
@ -119,7 +119,6 @@ class StylingSettingsMapHelper {
|
|||
'checkout' => 'classic_checkout',
|
||||
'mini-cart' => 'mini_cart',
|
||||
'checkout-block-express' => 'express_checkout',
|
||||
'block-editor' => 'block-editor',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -225,9 +224,10 @@ class StylingSettingsMapHelper {
|
|||
protected function mapped_disabled_funding_value( array $styling_models ): ?array {
|
||||
$disabled_funding = array();
|
||||
$locations_to_context_map = $this->current_context_to_new_button_location_map();
|
||||
$current_context = $locations_to_context_map[ $this->context() ] ?? '';
|
||||
|
||||
foreach ( $styling_models as $model ) {
|
||||
if ( $model->location !== $locations_to_context_map[ $this->context() ] || in_array( 'venmo', $model->methods, true ) ) {
|
||||
if ( $model->location !== $current_context || in_array( 'venmo', $model->methods, true ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -253,10 +253,11 @@ class StylingSettingsMapHelper {
|
|||
}
|
||||
|
||||
$locations_to_context_map = $this->current_context_to_new_button_location_map();
|
||||
$current_context = $locations_to_context_map[ $this->context() ] ?? '';
|
||||
|
||||
foreach ( $styling_models as $model ) {
|
||||
if ( ! $model->enabled
|
||||
|| $model->location !== $locations_to_context_map[ $this->context() ]
|
||||
|| $model->location !== $current_context
|
||||
|| ! in_array( $button_name, $model->methods, true )
|
||||
) {
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue