Explanation:
If the Afterpay product display disappears when selecting a variant, it is likely caused by one or more of the following issues:
1. Variant Pricing Not Updating Correctly
- Afterpay messaging is linked to the product price. When a variant with a different price is selected, the messaging may fail to update and therefore disappear.
- Action: Ensure that the Payment Info Display for Product Variant setting is enabled in the Afterpay settings to allow Afterpay messaging to update dynamically based on the selected variant.
2. JavaScript Conflicts
- JavaScript conflicts can prevent the Afterpay messaging from displaying when switching variants. Other plugins or custom themes may be interfering with the code that renders the Afterpay messaging.
- Action: Check the browser’s developer console for any JavaScript errors (right-click > Inspect > Console). If errors are present, they may need to be resolved by a developer.
3. Incorrect Hook or Template Configuration
- The Afterpay messaging relies on the correct hooks within your theme. If the hook used for displaying the messaging is not compatible with variant selections, the messaging may disappear.
- Action: Ensure you are using the correct hook, such as woocommerce_before_add_to_cart_form, for the product page template. Review the Afterpay settings to ensure the appropriate hook is in place.
Important Notes:
If the Afterpay product display still disappears after following the above steps, we recommend consulting a developer to ensure compatibility between your theme and the Afterpay messaging functionality.