Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add purchase options card extensions #2387

Open
wants to merge 5 commits into
base: unstable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,18 @@ You register targets in your \`shopify.extension.toml\` and inside the Javascrip
'This page shows information about a single product variant. The `admin.product-variant-details.action.render` target is available on this page.',
image: 'admin.product-variant-details.action.render.png',
},
{
title: 'Product detail purchase options card',
description:
'This page shows information about a single product, including a card showing purchase options. The `admin.product-purchase-option.action.render` target is available on this page when selling plans exists.',
image: 'admin.product-purchase-option.action.render.png',
},
{
title: 'Product variant detail purchase options card',
description:
'This page shows information about a single product variant, including a card showing purchase options. The `admin.product-variant-purchase-option.action.render` target is available on this page when selling plans exists.',
image: 'admin.product-variant-purchase-option.action.render.png',
},
],
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {ActionExtensionApi} from '../action/action';
import type {ExtensionTarget as AnyExtensionTarget} from '../../extension-targets';

export interface PurchaseOptionsCardConfigurationApi<
ExtensionTarget extends AnyExtensionTarget,
> extends ActionExtensionApi<ExtensionTarget> {
data: {
selected: {id: string; sellingPlanId?: string}[];
};
}
21 changes: 21 additions & 0 deletions packages/ui-extensions/src/surfaces/admin/extension-targets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type {
ValidationSettingsApi,
} from './api';
import {AnyComponentBuilder} from '../../shared';
import {PurchaseOptionsCardConfigurationApi} from './api/purchase-options-card-action/purchase-options-card-action';

type CustomerSegmentTemplateComponent = AnyComponentBuilder<
Pick<
Expand Down Expand Up @@ -422,6 +423,26 @@ export interface ExtensionTargets {
AllComponents
>;

/**
* Renders an admin action extension in the product details page when a selling plan group is present. Open this extension from the "Purchase Options card".
*
* See the [list of available components](/docs/api/admin-extensions/components).
*/
'admin.product-purchase-option.action.render': RenderExtension<
PurchaseOptionsCardConfigurationApi<'admin.product-purchase-option.action.render'>,
AllComponents
>;

/**
* Renders an admin action extension in the product variant details page when a selling plan group is present. Open this extension from the "Purchase Options card".
*
* See the [list of available components](/docs/api/admin-extensions/components).
*/
'admin.product-variant-purchase-option.action.render': RenderExtension<
PurchaseOptionsCardConfigurationApi<'admin.product-variant-purchase-option.action.render'>,
AllComponents
>;

// Print actions and bulk print actions

/**
Expand Down
Loading