Add thank you page extension block in [ORDER_STATUS2] block position.

Turbofan1178
Shopify Partner
49 4 5

I am trying to understand how I can configure my targets in my .toml to make an extension block on the thank you page load up in `purchase.thank-you.block.render [ORDER_STATUS2]. What I have currently is throwing an error:

[[extensions.targeting]]
target = "purchase.thank-you.block.render"
module = "./src/Checkout.jsx"
export = "thankYouBlock"

[[extensions.targeting]]
target = "purchase.thank-you.block.render"
module = "./src/Checkout.jsx"
export = "orderDetailsBlock"

 

Error: Duplicate targets found: purchase.thank-you.block.render │ Extension point targets must be unique.

 

However in the image in the docs, it shows the position of [ORDER_STATUS2] as a possible target.

 

supported-locations-thank-you.png

Replies 7 (7)

Liam
Shopify Staff
2731 299 769

Hi Turbofan,

 

Just to confirm, you want the orderDetailsBlock to be appearing on the [ORDER_STATUS2] location, so you need to know what value to apply to it's target property?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Turbofan1178
Shopify Partner
49 4 5

Yes precisely.

Liam
Shopify Staff
2731 299 769

The purchase.thank-you.block.render definition should cover both targets, if you use separate module files for each then this should work as expected.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Turbofan1178
Shopify Partner
49 4 5

Do you mean something like this:

 

[[extensions.targeting]]
target = "purchase.thank-you.block.render"
module = "./src/Checkout.jsx"
export = "thankYouBlock"

[[extensions.targeting]]
target = "purchase.thank-you.block.render"
module = "./src/OrderDetails.jsx"
export = "orderDetailsBlock"

 

I tried that and still got the same error.

 

Liam
Shopify Staff
2731 299 769

It should be working with two separate files - I'll connect with the internal team again to see what might be causing this.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Turbofan1178
Shopify Partner
49 4 5

Okay thank you.

 

For now, I’ve resorted to creating multiple extensions though.

Zain1997
Shopify Partner
4 1 0

Hi, Getting the same error trying with different files. Did you got a chance to get with team?