Skip to content

Payment plan table not showing after selecting installment option #380

@FlorianHegele

Description

@FlorianHegele

Environment
Plugin Version: 5.13.1
WooCommerce Version: 10.0.2

Problem Description
The payment plan table fails to display when selecting an installment payment option in the checkout process.

Steps to Reproduce

  1. Go to WooCommerce checkout page
  2. Select Alma payment method with installments
  3. Check an installment option
  4. Expected: Payment plan table should appear
    Actual: Nothing happens, table remains hidden
Image

Comparison with Working Version
Version 2.0.0 of the plugin doesn't have this issue and works correctly.

Here's the code comparison between the working version 2.0.0 (left, in red) and the current broken version 5.13.1 (right, in green):
Image

Root Cause Analysis
The key difference is the addition of .closest('li.wc_payment_method').find() in the current version. Since no <li> elements with class wc_payment_method exist in the DOM, this selector chain fails and the payment plan table never gets displayed.

The issue is located in this code line

onchange="if (this.checked) { jQuery( '<?php echo esc_js( $plan_class ); ?>' ).hide(); jQuery(this).closest('li.wc_payment_method').find( '<?php echo esc_js( $plan_id ); ?>' ).show() }"

The direct element selection used in version 2.0.0 worked perfectly and should be restored.
jQuery('#alma-payment-plan-table-general_X_0_0-installments').show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions