Explanation:
The Afterpay Messaging code snippet allows you to manually add Afterpay Messaging to the Product and Cart Pages. You can do this by copy-pasting the Afterpay Messaging code snippet into your Shopify liquid template file. From there, you can modify certain lines of the code snippet to properly render Afterpay Messaging with product variants.
Action:
Please follow the below steps:
- If you have not implemented the Afterpay Messaging code snippet yet, first follow these steps here.
- If you have already implemented the Afterpay Message code snippet, you will need to edit the code snippet within Themes.
- To do this, go to Sales channels > Online Store > Themes.
- Navigate to the current theme, then go to Actions > edit code.
- Under the Layout folder, click theme.liquid.
- Scroll down to the bottom until you locate the Afterpay code snippet and the following lines of code:
// var afterpay_product_integration_enabled = true;
// var afterpay_product_selector = '#product-price-selector';
// var afterpay_variable_price_fallback_selector = '';
// var afterpay_variable_price_fallback_method = 'interval'; // Can be 'mutation' or 'interval'.
- The recommendation is to “uncomment” (remove the “//”) these lines and update the value for both var afterpay_product_selector and var afterpay_variable_price_fallback_selector. Some experimentation or testing may be required to ensure the correct selector and variable is specified for the Product Pages in question.
- If the above steps are unfamiliar to you, it is best to involve a developer resource to help identify and test the correct values for var afterpay_product_selector and var afterpay_variable_price_fallback_selector.
Important Notes:
The code examples mentioned in the step by step links are in Liquid which is Shopify's own coding language.
Related Links: