Afterpay code

Hello!

I am looking to put the afterpay installent price on my product page. I went to the after pay website, and they gave me code to put. I have absolutely no idea where I can put those codes?

Can someone help me?

Thanks!

1 Like

Hello @Lily_elvis

Step 1: Locate the Product Template1. Log in to your Shopify admin panel.

  1. Go to Online Store > Themes.
  2. Find the theme you’re using and click Actions > Edit code.

Step 2: Identify the Product Page File1. In the code editor, locate the file for the product template. This is typically:

  • product.liquid (if your theme uses a standalone product template).
  • product.json (if your theme uses a JSON-based product template, like in Online Store 2.0 themes).
  • Sometimes, the code might need to go in product-template.liquid or a snippet file like product-form.liquid.
  1. If you’re unsure which file controls the product page, search for the term {{ product }} within the code editor to identify relevant files.

Step 3: Add the Afterpay Code1. Paste the code provided by Afterpay into the product template file at the location where you want the installment price to appear.

  • Commonly, this is under the product price section. Look for something like:

    {{ product.price }}

    or

    {{ product.compare_at_price }}

  1. Insert the Afterpay code right below it.

Step 4: Save Your Changes1. After pasting the code, click Save in the top right corner of the editor.

Thank you so much, unfortunately, I still don’t understand, I am so scared on doing something wrong, and blocking my website!