For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
Hi,
Is there any extension target in order total summary. I am not able to find any such target in documentation.
I am referring from this documentation https://shopify.dev/docs/api/checkout-ui-extensions/2023-10/targets
I need to add some detail just before total or after tax detail.
Hi Surabhigupta,
The closest target extension would be the purchase.checkout.reductions.render-after target that is rendered in the order summary, after the discount form and discount tag elements. There doesn't appear to be an target for the specific area you're looking for, but I've added this as a feature request for the product team.
Hope this helps,
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
Any update on this?
I have a quick question for you, well maybe its quick 🙂
I've been tasked to, as best I can, convert all manner of checkout customizations to checkout extensions. One particular checkout customization hides the line_item property of a particular product in the order summary area.
The text in the red box.
Is there any way to achieve this with checkout extensions? I think its a line_item property
Cheers,
Gary
Are you looking for something like this:
I used "purchase.checkout.block.render" to create our "kp-display-billing-currency-summary" and then dragged the application block to below the Order Summary Subtotal:
Hey Schmidt,
Nope.
Upon further investigation (I didnt write the intial code) the Montageservice (assembly service) has a base price of 1k, and depending on the product a discount is applied to the product to achieve the desired price of 300 for the bunkbed assembly. Apparently they don't want to confuse the customer by showing them the discount of 700 on the Montageservice line item. I was hoping to be able to block the display of that, but since its an applied discount to the line item I'm thinking its not going to work. I'm going to have to see if we can achieve the desired affect by having variants in the Montageservice with all possible prices, and then add the variant instead of applying discounts.
Cheers and thanks anyway for posting.
Gary
I wasn't replying to you. I was replying to the OP. You injected a completely separate topic into the original post.
Sorry, thats true 🙂
In your case, I would just write a line-item transform function and set the price to whatever you wish...
// @TS-check
/**
* @typedef {import("../generated/api").RunInput} RunInput
* @typedef {import("../generated/api").FunctionRunResult} FunctionRunResult
* @typedef {import("../generated/api").CartOperation} CartOperation
*/
/**
* @type {FunctionRunResult}
*/
const NO_CHANGES = {
operations: [],
};
/**
* @param {RunInput} input
* @returns {FunctionRunResult}
*/
export function run(input) {
const operations = input.cart.lines.reduce(
/** @param {CartOperation[]} acc */
(acc, cartLine) => {
const updateOperation = optionallyBuildUpdateOperation(
cartLine
);
if (updateOperation) {
return [...acc, {update: updateOperation}];
}
return acc;
},
[]
);
return operations.length > 0 ? {operations} : NO_CHANGES;
}
/**
* @param {RunInput['cart']['lines'][number]} cartLine
*/
function optionallyBuildUpdateOperation(
{id: cartLineId) {
if (merchandise.product.title !== `Montagservice`) {
return;
}
if (
merchandise.__typename === `ProductVariant`
) {
return {
cartLineId,
price: <WHATEVER PRICE YOU WANT>
},
};
}
return null;
}
Thanks for the example code,
I will have to set up a meeting with the client to discuss this since I never built the original implementation I am wondering if its calculable or fixed based and then how to get the info into the input.
Did you get this resolved?