Limit quantity per checkout (#1536)

* Add site settings and variant detail text fields related with limit per checkout

* Add message translations

* Fix review issues pt.1

* Update snapshots

* Apply fixes after review pt.2
This commit is contained in:
Paweł Kucharski 2021-12-07 10:43:24 +01:00 committed by GitHub
parent f111081331
commit 05cc720b6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 1354 additions and 74 deletions

View file

@ -416,9 +416,6 @@
{
"name": "ProductMedia"
},
{
"name": "ProductImage"
},
{
"name": "PageType"
}

View file

@ -6292,6 +6292,18 @@
"context": "product label",
"string": "Published"
},
"src_dot_products_dot_components_dot_ProductVariantCheckoutSettings_dot_checkoutLimits": {
"context": "title",
"string": "Checkout limits"
},
"src_dot_products_dot_components_dot_ProductVariantCheckoutSettings_dot_checkoutLimitsDescription": {
"context": "input helper text",
"string": "Your customer won't be allowed to buy bigger quantity per checkout than shown here."
},
"src_dot_products_dot_components_dot_ProductVariantCheckoutSettings_dot_checkoutLineLimit": {
"context": "input label",
"string": "Limit quantity per checkout (optional)"
},
"src_dot_products_dot_components_dot_ProductVariantCreateDialog_dot_description": {
"context": "create product variants",
"string": "How would you like to create variants:"
@ -7185,6 +7197,18 @@
"context": "site settings section name",
"string": "Site Settings"
},
"src_dot_siteSettings_dot_components_dot_SiteCheckoutSettingsCard_dot_checkoutLimits": {
"context": "title",
"string": "Checkout limits"
},
"src_dot_siteSettings_dot_components_dot_SiteCheckoutSettingsCard_dot_checkoutLimitsDescription": {
"context": "input helper text",
"string": "This number defines quantity of items in checkout line that can be bought. You can override this setting per variant. Leaving this setting empty mean that there is no limits."
},
"src_dot_siteSettings_dot_components_dot_SiteCheckoutSettingsCard_dot_checkoutLineLimit": {
"context": "input label",
"string": "Checkout line limit"
},
"src_dot_siteSettings_dot_components_dot_SiteCheckoutSettingsCard_dot_reservedStock": {
"context": "title",
"string": "Reserved stock"
@ -8054,6 +8078,10 @@
"context": "event",
"string": "Invoice deleted"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_1368438665": {
"context": "event",
"string": "Shipping methods for checkout listed"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_1436364351": {
"context": "section header",
"string": "Events"

View file

@ -2427,6 +2427,7 @@ enum GiftCardEventsEnum {
input GiftCardFilterInput {
isActive: Boolean
metadata: [MetadataFilter]
tag: String
tags: [String]
products: [ID]
@ -3916,7 +3917,7 @@ type Mutation {
checkoutLineDelete(checkoutId: ID, lineId: ID, token: UUID): CheckoutLineDelete
checkoutLinesAdd(checkoutId: ID, lines: [CheckoutLineInput]!, token: UUID): CheckoutLinesAdd
checkoutLinesUpdate(checkoutId: ID, lines: [CheckoutLineInput]!, token: UUID): CheckoutLinesUpdate
checkoutRemovePromoCode(checkoutId: ID, promoCode: String!, token: UUID): CheckoutRemovePromoCode
checkoutRemovePromoCode(checkoutId: ID, promoCode: String, promoCodeId: ID, token: UUID): CheckoutRemovePromoCode
checkoutPaymentCreate(checkoutId: ID, input: PaymentInput!, token: UUID): CheckoutPaymentCreate
checkoutShippingAddressUpdate(checkoutId: ID, shippingAddress: AddressInput!, token: UUID): CheckoutShippingAddressUpdate
checkoutShippingMethodUpdate(checkoutId: ID, shippingMethodId: ID!, token: UUID): CheckoutShippingMethodUpdate @deprecated(reason: "This field will be removed in Saleor 4.0. Use `checkoutDeliveryMethodUpdate` instead.")
@ -5548,7 +5549,7 @@ type ProductType implements Node & ObjectWithMetadata {
kind: ProductTypeKindEnum!
products(channel: String, before: String, after: String, first: Int, last: Int): ProductCountableConnection @deprecated(reason: "This field will be removed in Saleor 4.0. Use the top-level `products` query with the `productTypes` filter.")
taxType: TaxType
variantAttributes(variantSelection: VariantAttributeScope): [Attribute] @deprecated(reason: "This field will be removed in Saleor 4.0. use `assignedVariantAttributes` instead.")
variantAttributes(variantSelection: VariantAttributeScope): [Attribute] @deprecated(reason: "This field will be removed in Saleor 4.0. Use `assignedVariantAttributes` instead.")
assignedVariantAttributes(variantSelection: VariantAttributeScope): [AssignedVariantAttribute]
productAttributes: [Attribute]
availableAttributes(filter: AttributeFilterInput, before: String, after: String, first: Int, last: Int): AttributeCountableConnection
@ -5655,6 +5656,7 @@ type ProductVariant implements Node & ObjectWithMetadata {
sku: String
product: Product!
trackInventory: Boolean!
quantityLimitPerCustomer: Int
weight: Weight
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
@ -5670,7 +5672,7 @@ type ProductVariant implements Node & ObjectWithMetadata {
translation(languageCode: LanguageCodeEnum!): ProductVariantTranslation
digitalContent: DigitalContent
stocks(address: AddressInput, countryCode: CountryCode): [Stock]
quantityAvailable(address: AddressInput, countryCode: CountryCode): Int!
quantityAvailable(address: AddressInput, countryCode: CountryCode): Int
preorder: PreorderData
}
@ -5687,6 +5689,7 @@ input ProductVariantBulkCreateInput {
trackInventory: Boolean
weight: WeightScalar
preorder: PreorderSettingsInput
quantityLimitPerCustomer: Int
stocks: [StockInput!]
channelListings: [ProductVariantChannelListingAddInput!]
}
@ -5742,6 +5745,7 @@ input ProductVariantCreateInput {
trackInventory: Boolean
weight: WeightScalar
preorder: PreorderSettingsInput
quantityLimitPerCustomer: Int
product: ID!
stocks: [StockInput!]
}
@ -5765,6 +5769,7 @@ input ProductVariantInput {
trackInventory: Boolean
weight: WeightScalar
preorder: PreorderSettingsInput
quantityLimitPerCustomer: Int
}
type ProductVariantPreorderDeactivate {
@ -6139,14 +6144,10 @@ enum ShippingErrorCode {
type ShippingMethod implements Node & ObjectWithMetadata {
id: ID!
name: String!
description: JSONString
minimumOrderWeight: Weight
maximumOrderWeight: Weight
maximumDeliveryDays: Int
minimumDeliveryDays: Int
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
name: String!
description: JSONString
type: ShippingMethodTypeEnum
translation(languageCode: LanguageCodeEnum!): ShippingMethodTranslation
channelListings: [ShippingMethodChannelListing!]
@ -6155,6 +6156,10 @@ type ShippingMethod implements Node & ObjectWithMetadata {
minimumOrderPrice: Money
postalCodeRules: [ShippingMethodPostalCodeRule]
excludedProducts(before: String, after: String, first: Int, last: Int): ProductCountableConnection
minimumOrderWeight: Weight
maximumOrderWeight: Weight
maximumDeliveryDays: Int
minimumDeliveryDays: Int
}
type ShippingMethodChannelListing implements Node {
@ -6384,6 +6389,7 @@ type Shop {
automaticFulfillmentDigitalProducts: Boolean
reserveStockDurationAnonymousUser: Int
reserveStockDurationAuthenticatedUser: Int
limitQuantityPerCheckout: Int
defaultDigitalMaxDownloads: Int
defaultDigitalUrlValidDays: Int
companyAddress: Address
@ -6445,6 +6451,7 @@ input ShopSettingsInput {
customerSetPasswordUrl: String
reserveStockDurationAnonymousUser: Int
reserveStockDurationAuthenticatedUser: Int
limitQuantityPerCheckout: Int
}
type ShopSettingsTranslate {
@ -6577,6 +6584,7 @@ type Stock implements Node {
quantity: Int!
id: ID!
quantityAllocated: Int!
quantityReserved: Int!
}
enum StockAvailability {
@ -7285,6 +7293,7 @@ enum WebhookEventTypeEnum {
PAYMENT_PROCESS
PAYMENT_REFUND
PAYMENT_VOID
SHIPPING_LIST_METHODS_FOR_CHECKOUT
TRANSLATION_CREATED
TRANSLATION_UPDATED
}
@ -7330,6 +7339,7 @@ enum WebhookSampleEventTypeEnum {
PAYMENT_PROCESS
PAYMENT_REFUND
PAYMENT_VOID
SHIPPING_LIST_METHODS_FOR_CHECKOUT
TRANSLATION_CREATED
TRANSLATION_UPDATED
}
@ -7366,7 +7376,7 @@ enum WeightUnitsEnum {
scalar _Any
union _Entity = App | Address | User | Group | ProductVariant | Product | ProductType | Collection | Category | ProductMedia | ProductImage | PageType
union _Entity = App | Address | User | Group | ProductVariant | Product | ProductType | Collection | Category | ProductMedia | PageType
type _Service {
sdl: String

View file

@ -245,6 +245,7 @@ export const productFragmentDetails = gql`
channelListings {
...ChannelListingProductVariantFragment
}
quantityLimitPerCustomer
}
productType {
id
@ -380,6 +381,7 @@ export const fragmentVariant = gql`
weight {
...WeightFragment
}
quantityLimitPerCustomer
}
`;

View file

@ -43,5 +43,6 @@ export const shopFragment = gql`
name
reserveStockDurationAnonymousUser
reserveStockDurationAuthenticatedUser
limitQuantityPerCheckout
}
`;

View file

@ -17,7 +17,7 @@ export interface FulfillmentFragment_lines_orderLine_variant_preorder {
export interface FulfillmentFragment_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: FulfillmentFragment_lines_orderLine_variant_preorder | null;
}

View file

@ -214,7 +214,7 @@ export interface OrderDetailsFragment_fulfillments_lines_orderLine_variant_preor
export interface OrderDetailsFragment_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDetailsFragment_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -316,7 +316,7 @@ export interface OrderDetailsFragment_lines_variant_preorder {
export interface OrderDetailsFragment_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDetailsFragment_lines_variant_preorder | null;
}

View file

@ -17,7 +17,7 @@ export interface OrderLineFragment_variant_preorder {
export interface OrderLineFragment_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderLineFragment_variant_preorder | null;
}

View file

@ -311,6 +311,7 @@ export interface Product_variants {
trackInventory: boolean;
preorder: Product_variants_preorder | null;
channelListings: Product_variants_channelListings[] | null;
quantityLimitPerCustomer: number | null;
}
export interface Product_weight {

View file

@ -356,4 +356,5 @@ export interface ProductVariant {
trackInventory: boolean;
preorder: ProductVariant_preorder | null;
weight: ProductVariant_weight | null;
quantityLimitPerCustomer: number | null;
}

View file

@ -52,4 +52,5 @@ export interface ShopFragment {
name: string;
reserveStockDurationAnonymousUser: number | null;
reserveStockDurationAuthenticatedUser: number | null;
limitQuantityPerCheckout: number | null;
}

View file

@ -223,7 +223,7 @@ export interface FulfillOrder_orderFulfill_order_fulfillments_lines_orderLine_va
export interface FulfillOrder_orderFulfill_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: FulfillOrder_orderFulfill_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -325,7 +325,7 @@ export interface FulfillOrder_orderFulfill_order_lines_variant_preorder {
export interface FulfillOrder_orderFulfill_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: FulfillOrder_orderFulfill_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderCancel_orderCancel_order_fulfillments_lines_orderLine_vari
export interface OrderCancel_orderCancel_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderCancel_orderCancel_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderCancel_orderCancel_order_lines_variant_preorder {
export interface OrderCancel_orderCancel_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderCancel_orderCancel_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderCapture_orderCapture_order_fulfillments_lines_orderLine_va
export interface OrderCapture_orderCapture_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderCapture_orderCapture_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderCapture_orderCapture_order_lines_variant_preorder {
export interface OrderCapture_orderCapture_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderCapture_orderCapture_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderConfirm_orderConfirm_order_fulfillments_lines_orderLine_va
export interface OrderConfirm_orderConfirm_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderConfirm_orderConfirm_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderConfirm_orderConfirm_order_lines_variant_preorder {
export interface OrderConfirm_orderConfirm_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderConfirm_orderConfirm_order_lines_variant_preorder | null;
}

View file

@ -214,7 +214,7 @@ export interface OrderDetails_order_fulfillments_lines_orderLine_variant_preorde
export interface OrderDetails_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDetails_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -316,7 +316,7 @@ export interface OrderDetails_order_lines_variant_preorder {
export interface OrderDetails_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDetails_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderDiscountAdd_orderDiscountAdd_order_fulfillments_lines_orde
export interface OrderDiscountAdd_orderDiscountAdd_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDiscountAdd_orderDiscountAdd_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderDiscountAdd_orderDiscountAdd_order_lines_variant_preorder
export interface OrderDiscountAdd_orderDiscountAdd_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDiscountAdd_orderDiscountAdd_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderDiscountDelete_orderDiscountDelete_order_fulfillments_line
export interface OrderDiscountDelete_orderDiscountDelete_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDiscountDelete_orderDiscountDelete_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderDiscountDelete_orderDiscountDelete_order_lines_variant_pre
export interface OrderDiscountDelete_orderDiscountDelete_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDiscountDelete_orderDiscountDelete_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderDiscountUpdate_orderDiscountUpdate_order_fulfillments_line
export interface OrderDiscountUpdate_orderDiscountUpdate_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDiscountUpdate_orderDiscountUpdate_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderDiscountUpdate_orderDiscountUpdate_order_lines_variant_pre
export interface OrderDiscountUpdate_orderDiscountUpdate_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDiscountUpdate_orderDiscountUpdate_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderDraftCancel_draftOrderDelete_order_fulfillments_lines_orde
export interface OrderDraftCancel_draftOrderDelete_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDraftCancel_draftOrderDelete_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderDraftCancel_draftOrderDelete_order_lines_variant_preorder
export interface OrderDraftCancel_draftOrderDelete_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDraftCancel_draftOrderDelete_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderDraftFinalize_draftOrderComplete_order_fulfillments_lines_
export interface OrderDraftFinalize_draftOrderComplete_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDraftFinalize_draftOrderComplete_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderDraftFinalize_draftOrderComplete_order_lines_variant_preor
export interface OrderDraftFinalize_draftOrderComplete_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDraftFinalize_draftOrderComplete_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderDraftUpdate_draftOrderUpdate_order_fulfillments_lines_orde
export interface OrderDraftUpdate_draftOrderUpdate_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDraftUpdate_draftOrderUpdate_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderDraftUpdate_draftOrderUpdate_order_lines_variant_preorder
export interface OrderDraftUpdate_draftOrderUpdate_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderDraftUpdate_draftOrderUpdate_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderFulfillmentApprove_orderFulfillmentApprove_order_fulfillme
export interface OrderFulfillmentApprove_orderFulfillmentApprove_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderFulfillmentApprove_orderFulfillmentApprove_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderFulfillmentApprove_orderFulfillmentApprove_order_lines_var
export interface OrderFulfillmentApprove_orderFulfillmentApprove_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderFulfillmentApprove_orderFulfillmentApprove_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderFulfillmentCancel_orderFulfillmentCancel_order_fulfillment
export interface OrderFulfillmentCancel_orderFulfillmentCancel_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderFulfillmentCancel_orderFulfillmentCancel_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderFulfillmentCancel_orderFulfillmentCancel_order_lines_varia
export interface OrderFulfillmentCancel_orderFulfillmentCancel_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderFulfillmentCancel_orderFulfillmentCancel_order_lines_variant_preorder | null;
}

View file

@ -24,7 +24,7 @@ export interface OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_f
export interface OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_fulfillment_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_fulfillment_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_o
export interface OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -425,7 +425,7 @@ export interface OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_o
export interface OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_o
export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_o
export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderL
export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderLineDelete_orderLineDelete_order_lines_variant_preorder {
export interface OrderLineDelete_orderLineDelete_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderLineDelete_orderLineDelete_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderLineDiscountRemove_orderLineDiscountRemove_order_fulfillme
export interface OrderLineDiscountRemove_orderLineDiscountRemove_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderLineDiscountRemove_orderLineDiscountRemove_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderLineDiscountRemove_orderLineDiscountRemove_order_lines_var
export interface OrderLineDiscountRemove_orderLineDiscountRemove_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderLineDiscountRemove_orderLineDiscountRemove_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderLineDiscountUpdate_orderLineDiscountUpdate_order_fulfillme
export interface OrderLineDiscountUpdate_orderLineDiscountUpdate_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderLineDiscountUpdate_orderLineDiscountUpdate_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderLineDiscountUpdate_orderLineDiscountUpdate_order_lines_var
export interface OrderLineDiscountUpdate_orderLineDiscountUpdate_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderLineDiscountUpdate_orderLineDiscountUpdate_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderL
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderLineUpdate_orderLineUpdate_order_lines_variant_preorder {
export interface OrderLineUpdate_orderLineUpdate_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderLineUpdate_orderLineUpdate_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLi
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderLinesAdd_orderLinesCreate_order_lines_variant_preorder {
export interface OrderLinesAdd_orderLinesCreate_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderLinesAdd_orderLinesCreate_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderMarkAsPaid_orderMarkAsPaid_order_fulfillments_lines_orderL
export interface OrderMarkAsPaid_orderMarkAsPaid_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderMarkAsPaid_orderMarkAsPaid_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderMarkAsPaid_orderMarkAsPaid_order_lines_variant_preorder {
export interface OrderMarkAsPaid_orderMarkAsPaid_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderMarkAsPaid_orderMarkAsPaid_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderRefund_orderRefund_order_fulfillments_lines_orderLine_vari
export interface OrderRefund_orderRefund_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderRefund_orderRefund_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderRefund_orderRefund_order_lines_variant_preorder {
export interface OrderRefund_orderRefund_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderRefund_orderRefund_order_lines_variant_preorder | null;
}

View file

@ -283,7 +283,7 @@ export interface OrderShippingMethodUpdate_orderUpdateShipping_order_fulfillment
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderShippingMethodUpdate_orderUpdateShipping_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -385,7 +385,7 @@ export interface OrderShippingMethodUpdate_orderUpdateShipping_order_lines_varia
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderShippingMethodUpdate_orderUpdateShipping_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderUpdate_orderUpdate_order_fulfillments_lines_orderLine_vari
export interface OrderUpdate_orderUpdate_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderUpdate_orderUpdate_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderUpdate_orderUpdate_order_lines_variant_preorder {
export interface OrderUpdate_orderUpdate_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderUpdate_orderUpdate_order_lines_variant_preorder | null;
}

View file

@ -221,7 +221,7 @@ export interface OrderVoid_orderVoid_order_fulfillments_lines_orderLine_variant_
export interface OrderVoid_orderVoid_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderVoid_orderVoid_order_fulfillments_lines_orderLine_variant_preorder | null;
}
@ -323,7 +323,7 @@ export interface OrderVoid_orderVoid_order_lines_variant_preorder {
export interface OrderVoid_orderVoid_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
quantityAvailable: number | null;
preorder: OrderVoid_orderVoid_order_lines_variant_preorder | null;
}

View file

@ -0,0 +1,58 @@
import { Card, CardContent, TextField } from "@material-ui/core";
import CardTitle from "@saleor/components/CardTitle";
import { ProductErrorFragment } from "@saleor/fragments/types/ProductErrorFragment";
import { FormChange } from "@saleor/hooks/useForm";
import { getFormErrors } from "@saleor/utils/errors";
import React from "react";
import { useIntl } from "react-intl";
import { messages } from "./messages";
interface ProductVariantCheckoutSettingsProps {
data: {
quantityLimitPerCustomer: number | null;
};
disabled: boolean;
errors: ProductErrorFragment[];
onChange: FormChange;
}
const ProductVariantCheckoutSettings: React.FC<ProductVariantCheckoutSettingsProps> = props => {
const { data, disabled, errors, onChange } = props;
const intl = useIntl();
const formErrors = getFormErrors(["quantityLimitPerCustomer"], errors);
return (
<Card>
<CardTitle title={intl.formatMessage(messages.checkoutLimits)} />
<CardContent>
<TextField
disabled={disabled}
error={!!formErrors.quantityLimitPerCustomer}
type="number"
fullWidth
name="quantityLimitPerCustomer"
label={intl.formatMessage(messages.checkoutLineLimit)}
helperText={intl.formatMessage(messages.checkoutLimitsDescription)}
value={
!!data.quantityLimitPerCustomer
? String(data.quantityLimitPerCustomer)
: ""
}
onChange={onChange}
InputProps={{
inputProps: {
autoComplete: "none",
min: 1
}
}}
/>
</CardContent>
</Card>
);
};
ProductVariantCheckoutSettings.displayName = "ProductVariantCheckoutSettings";
export default ProductVariantCheckoutSettings;

View file

@ -0,0 +1,2 @@
export { default } from "./ProductVariantCheckoutSettings";
export * from "./ProductVariantCheckoutSettings";

View file

@ -0,0 +1,17 @@
import { defineMessages } from "react-intl";
export const messages = defineMessages({
checkoutLimits: {
defaultMessage: "Checkout limits",
description: "title"
},
checkoutLineLimit: {
defaultMessage: "Limit quantity per checkout (optional)",
description: "input label"
},
checkoutLimitsDescription: {
defaultMessage:
"Your customer won't be allowed to buy bigger quantity per checkout than shown here.",
description: "input helper text"
}
});

View file

@ -27,6 +27,7 @@ import { defineMessages, useIntl } from "react-intl";
import { ProductVariantCreateData_product } from "../../types/ProductVariantCreateData";
import ProductShipping from "../ProductShipping/ProductShipping";
import ProductStocks from "../ProductStocks";
import ProductVariantCheckoutSettings from "../ProductVariantCheckoutSettings/ProductVariantCheckoutSettings";
import ProductVariantNavigation from "../ProductVariantNavigation";
import ProductVariantPrice from "../ProductVariantPrice";
import ProductVariantCreateForm, {
@ -216,6 +217,13 @@ const ProductVariantCreatePage: React.FC<ProductVariantCreatePageProps> = ({
onAttributeSelectBlur={onAttributeSelectBlur}
/>
<CardSpacer />
<ProductVariantCheckoutSettings
data={data}
disabled={disabled}
errors={errors}
onChange={change}
/>
<CardSpacer />
<ProductShipping
data={data}
disabled={disabled}

View file

@ -37,6 +37,7 @@ export interface ProductVariantCreateFormData extends MetadataFormData {
globalThreshold: string;
globalSoldUnits: number;
hasPreorderEndDate: boolean;
quantityLimitPerCustomer: number | null;
preorderEndDateTime?: string;
}
export interface ProductVariantCreateData extends ProductVariantCreateFormData {
@ -99,7 +100,8 @@ const initial: ProductVariantCreateFormData = {
globalThreshold: null,
globalSoldUnits: 0,
hasPreorderEndDate: false,
preorderEndDateTime: ""
preorderEndDateTime: "",
quantityLimitPerCustomer: null
};
function useProductVariantCreateForm(

View file

@ -32,6 +32,7 @@ import { defineMessages, useIntl } from "react-intl";
import { maybe } from "../../../misc";
import ProductShipping from "../ProductShipping/ProductShipping";
import ProductStocks, { ProductStockInput } from "../ProductStocks";
import ProductVariantCheckoutSettings from "../ProductVariantCheckoutSettings/ProductVariantCheckoutSettings";
import ProductVariantEndPreorderDialog from "../ProductVariantEndPreorderDialog";
import ProductVariantMediaSelectDialog from "../ProductVariantImageSelectDialog";
import ProductVariantMedia from "../ProductVariantMedia";
@ -312,6 +313,14 @@ const ProductVariantPage: React.FC<ProductVariantPageProps> = ({
onChange={handlers.changeChannels}
/>
<CardSpacer />
<ProductVariantCheckoutSettings
data={data}
disabled={loading}
errors={errors}
onChange={change}
/>
<CardSpacer />
<ProductShipping
data={data}
disabled={loading}

View file

@ -58,6 +58,7 @@ export interface ProductVariantUpdateFormData extends MetadataFormData {
isPreorder: boolean;
globalThreshold: string;
globalSoldUnits: number;
quantityLimitPerCustomer: number | null;
hasPreorderEndDate: boolean;
preorderEndDateTime?: string;
}
@ -165,7 +166,8 @@ function useProductVariantUpdateForm(
globalSoldUnits: variant?.preorder?.globalSoldUnits || 0,
hasPreorderEndDate: !!variant?.preorder?.endDate,
preorderEndDateTime: variant?.preorder?.endDate,
weight: variant?.weight?.value.toString() || ""
weight: variant?.weight?.value.toString() || "",
quantityLimitPerCustomer: variant?.quantityLimitPerCustomer || null
};
const form = useForm(initial);

View file

@ -595,6 +595,7 @@ export const product: (
__typename: "ProductVariant",
channelListings: [],
id: "pv75934",
quantityLimitPerCustomer: 30,
margin: 2,
media: [
{
@ -640,6 +641,7 @@ export const product: (
},
{
__typename: "ProductVariant",
quantityLimitPerCustomer: null,
channelListings: [
{
__typename: "ProductVariantChannelListing",
@ -3005,6 +3007,7 @@ export const variant = (placeholderImage: string): ProductVariant => ({
}
],
id: "var1",
quantityLimitPerCustomer: 300,
media: [
{
__typename: "ProductMedia",

View file

@ -337,6 +337,7 @@ export const variantUpdateMutation = gql`
$id: ID!
$attributes: [AttributeValueInput!]
$sku: String
$quantityLimitPerCustomer: Int
$trackInventory: Boolean!
$stocks: [StockInput!]!
$preorder: PreorderSettingsInput
@ -354,6 +355,7 @@ export const variantUpdateMutation = gql`
trackInventory: $trackInventory
preorder: $preorder
weight: $weight
quantityLimitPerCustomer: $quantityLimitPerCustomer
}
) {
errors {

View file

@ -311,6 +311,7 @@ export interface ProductDetails_product_variants {
trackInventory: boolean;
preorder: ProductDetails_product_variants_preorder | null;
channelListings: ProductDetails_product_variants_channelListings[] | null;
quantityLimitPerCustomer: number | null;
}
export interface ProductDetails_product_weight {

View file

@ -318,6 +318,7 @@ export interface ProductUpdate_productUpdate_product_variants {
trackInventory: boolean;
preorder: ProductUpdate_productUpdate_product_variants_preorder | null;
channelListings: ProductUpdate_productUpdate_product_variants_channelListings[] | null;
quantityLimitPerCustomer: number | null;
}
export interface ProductUpdate_productUpdate_product_weight {

View file

@ -356,6 +356,7 @@ export interface ProductVariantDetails_productVariant {
trackInventory: boolean;
preorder: ProductVariantDetails_productVariant_preorder | null;
weight: ProductVariantDetails_productVariant_weight | null;
quantityLimitPerCustomer: number | null;
}
export interface ProductVariantDetails {

View file

@ -318,6 +318,7 @@ export interface SimpleProductUpdate_productUpdate_product_variants {
trackInventory: boolean;
preorder: SimpleProductUpdate_productUpdate_product_variants_preorder | null;
channelListings: SimpleProductUpdate_productUpdate_product_variants_channelListings[] | null;
quantityLimitPerCustomer: number | null;
}
export interface SimpleProductUpdate_productUpdate_product_weight {
@ -717,6 +718,7 @@ export interface SimpleProductUpdate_productVariantUpdate_productVariant {
trackInventory: boolean;
preorder: SimpleProductUpdate_productVariantUpdate_productVariant_preorder | null;
weight: SimpleProductUpdate_productVariantUpdate_productVariant_weight | null;
quantityLimitPerCustomer: number | null;
}
export interface SimpleProductUpdate_productVariantUpdate {
@ -1079,6 +1081,7 @@ export interface SimpleProductUpdate_productVariantStocksCreate_productVariant {
trackInventory: boolean;
preorder: SimpleProductUpdate_productVariantStocksCreate_productVariant_preorder | null;
weight: SimpleProductUpdate_productVariantStocksCreate_productVariant_weight | null;
quantityLimitPerCustomer: number | null;
}
export interface SimpleProductUpdate_productVariantStocksCreate {
@ -1440,6 +1443,7 @@ export interface SimpleProductUpdate_productVariantStocksDelete_productVariant {
trackInventory: boolean;
preorder: SimpleProductUpdate_productVariantStocksDelete_productVariant_preorder | null;
weight: SimpleProductUpdate_productVariantStocksDelete_productVariant_weight | null;
quantityLimitPerCustomer: number | null;
}
export interface SimpleProductUpdate_productVariantStocksDelete {
@ -1802,6 +1806,7 @@ export interface SimpleProductUpdate_productVariantStocksUpdate_productVariant {
trackInventory: boolean;
preorder: SimpleProductUpdate_productVariantStocksUpdate_productVariant_preorder | null;
weight: SimpleProductUpdate_productVariantStocksUpdate_productVariant_weight | null;
quantityLimitPerCustomer: number | null;
}
export interface SimpleProductUpdate_productVariantStocksUpdate {

View file

@ -363,6 +363,7 @@ export interface VariantCreate_productVariantCreate_productVariant {
trackInventory: boolean;
preorder: VariantCreate_productVariantCreate_productVariant_preorder | null;
weight: VariantCreate_productVariantCreate_productVariant_weight | null;
quantityLimitPerCustomer: number | null;
}
export interface VariantCreate_productVariantCreate {

View file

@ -363,6 +363,7 @@ export interface VariantUpdate_productVariantUpdate_productVariant {
trackInventory: boolean;
preorder: VariantUpdate_productVariantUpdate_productVariant_preorder | null;
weight: VariantUpdate_productVariantUpdate_productVariant_weight | null;
quantityLimitPerCustomer: number | null;
}
export interface VariantUpdate_productVariantUpdate {
@ -725,6 +726,7 @@ export interface VariantUpdate_productVariantStocksUpdate_productVariant {
trackInventory: boolean;
preorder: VariantUpdate_productVariantStocksUpdate_productVariant_preorder | null;
weight: VariantUpdate_productVariantStocksUpdate_productVariant_weight | null;
quantityLimitPerCustomer: number | null;
}
export interface VariantUpdate_productVariantStocksUpdate {
@ -811,6 +813,7 @@ export interface VariantUpdateVariables {
id: string;
attributes?: AttributeValueInput[] | null;
sku?: string | null;
quantityLimitPerCustomer?: number | null;
trackInventory: boolean;
stocks: StockInput[];
preorder?: PreorderSettingsInput | null;

View file

@ -278,6 +278,7 @@ export const ProductVariant: React.FC<ProductUpdateProps> = ({
id: variantId,
removeStocks: data.removeStocks,
sku: data.sku,
quantityLimitPerCustomer: data.quantityLimitPerCustomer || null,
stocks: data.updateStocks.map(mapFormsetStockToStockInput),
trackInventory: data.trackInventory,
preorder: data.isPreorder

View file

@ -27,7 +27,8 @@ const SiteCheckoutSettingsCard: React.FC<SiteCheckoutSettingsCardProps> = ({
const formErrors = getFormErrors(
[
"reserveStockDurationAuthenticatedUser",
"reserveStockDurationAnonymousUser"
"reserveStockDurationAnonymousUser",
"limitQuantityPerCheckout"
],
errors
);
@ -84,6 +85,30 @@ const SiteCheckoutSettingsCard: React.FC<SiteCheckoutSettingsCardProps> = ({
}}
/>
</CardContent>
<CardTitle title={intl.formatMessage(messages.checkoutLimits)} />
<CardContent>
<TextField
disabled={disabled}
error={!!formErrors.reserveStockDurationAuthenticatedUser}
type="number"
fullWidth
name="limitQuantityPerCheckout"
label={intl.formatMessage(messages.checkoutLineLimit)}
helperText={intl.formatMessage(messages.checkoutLimitsDescription)}
value={
!!data.limitQuantityPerCheckout
? String(data.limitQuantityPerCheckout)
: ""
}
onChange={onChange}
InputProps={{
inputProps: {
autoComplete: "none",
min: 0
}
}}
/>
</CardContent>
</Card>
);
};

View file

@ -5,6 +5,10 @@ export const messages = defineMessages({
defaultMessage: "Reserved stock",
description: "title"
},
checkoutLimits: {
defaultMessage: "Checkout limits",
description: "title"
},
reservedStockDescription: {
defaultMessage:
"Set up time amount that stock in checkout is reserved for the customer. You can set separate values for authenticated and anonymous customers.",
@ -18,9 +22,18 @@ export const messages = defineMessages({
defaultMessage: "Stock reservation for anonymous user (in minutes)",
description: "input label"
},
checkoutLineLimit: {
defaultMessage: "Checkout line limit",
description: "input label"
},
stockWillNotBeReserved: {
defaultMessage:
"Leaving this setting empty will mean that stock wont be reserved",
description: "input helper text"
},
checkoutLimitsDescription: {
defaultMessage:
"This number defines quantity of items in checkout line that can be bought. You can override this setting per variant. Leaving this setting empty mean that there is no limits.",
description: "input helper text"
}
});

View file

@ -42,6 +42,7 @@ export interface SiteSettingsPageFormData
name: string;
reserveStockDurationAnonymousUser: number;
reserveStockDurationAuthenticatedUser: number;
limitQuantityPerCheckout: number;
}
export interface SiteSettingsPageProps {
@ -118,7 +119,8 @@ const SiteSettingsPage: React.FC<SiteSettingsPageProps> = props => {
name: shop?.name || "",
reserveStockDurationAnonymousUser: shop?.reserveStockDurationAnonymousUser,
reserveStockDurationAuthenticatedUser:
shop?.reserveStockDurationAuthenticatedUser
shop?.reserveStockDurationAuthenticatedUser,
limitQuantityPerCheckout: shop?.limitQuantityPerCheckout
};
return (

View file

@ -38,5 +38,6 @@ export const shop: SiteSettings_shop = {
},
name: "Saleor e-commerce",
reserveStockDurationAnonymousUser: 10,
reserveStockDurationAuthenticatedUser: 10
reserveStockDurationAuthenticatedUser: 10,
limitQuantityPerCheckout: 50
};

View file

@ -60,6 +60,7 @@ export interface ShopSettingsUpdate_shopSettingsUpdate_shop {
name: string;
reserveStockDurationAnonymousUser: number | null;
reserveStockDurationAuthenticatedUser: number | null;
limitQuantityPerCheckout: number | null;
}
export interface ShopSettingsUpdate_shopSettingsUpdate {

View file

@ -52,6 +52,7 @@ export interface SiteSettings_shop {
name: string;
reserveStockDurationAnonymousUser: number | null;
reserveStockDurationAuthenticatedUser: number | null;
limitQuantityPerCheckout: number | null;
}
export interface SiteSettings {

View file

@ -84,7 +84,9 @@ export const SiteSettings: React.FC<SiteSettingsProps> = () => {
reserveStockDurationAnonymousUser:
data.reserveStockDurationAnonymousUser || null,
reserveStockDurationAuthenticatedUser:
data.reserveStockDurationAuthenticatedUser || null
data.reserveStockDurationAuthenticatedUser || null,
limitQuantityPerCheckout:
data.limitQuantityPerCheckout || null
},
isCloudInstance: IS_CLOUD_INSTANCE
}

File diff suppressed because it is too large Load diff

View file

@ -1859,6 +1859,7 @@ export enum WebhookEventTypeEnum {
SALE_CREATED = "SALE_CREATED",
SALE_DELETED = "SALE_DELETED",
SALE_UPDATED = "SALE_UPDATED",
SHIPPING_LIST_METHODS_FOR_CHECKOUT = "SHIPPING_LIST_METHODS_FOR_CHECKOUT",
TRANSLATION_CREATED = "TRANSLATION_CREATED",
TRANSLATION_UPDATED = "TRANSLATION_UPDATED",
}
@ -2212,6 +2213,7 @@ export interface GiftCardCreateInput {
export interface GiftCardFilterInput {
isActive?: boolean | null;
metadata?: (MetadataFilter | null)[] | null;
tag?: string | null;
tags?: (string | null)[] | null;
products?: (string | null)[] | null;
@ -2648,6 +2650,7 @@ export interface ProductVariantBulkCreateInput {
trackInventory?: boolean | null;
weight?: any | null;
preorder?: PreorderSettingsInput | null;
quantityLimitPerCustomer?: number | null;
stocks?: StockInput[] | null;
channelListings?: ProductVariantChannelListingAddInput[] | null;
}
@ -2665,6 +2668,7 @@ export interface ProductVariantCreateInput {
trackInventory?: boolean | null;
weight?: any | null;
preorder?: PreorderSettingsInput | null;
quantityLimitPerCustomer?: number | null;
product: string;
stocks?: StockInput[] | null;
}
@ -2675,6 +2679,7 @@ export interface ProductVariantInput {
trackInventory?: boolean | null;
weight?: any | null;
preorder?: PreorderSettingsInput | null;
quantityLimitPerCustomer?: number | null;
}
export interface PublishableChannelListingInput {
@ -2812,6 +2817,7 @@ export interface ShopSettingsInput {
customerSetPasswordUrl?: string | null;
reserveStockDurationAnonymousUser?: number | null;
reserveStockDurationAuthenticatedUser?: number | null;
limitQuantityPerCheckout?: number | null;
}
export interface SiteDomainInput {

View file

@ -182,6 +182,12 @@ const WebhookEvents: React.FC<WebhookEventsProps> = ({
defaultMessage: "Product variant out of stock",
description: "event"
}),
[WebhookEventTypeEnum.SHIPPING_LIST_METHODS_FOR_CHECKOUT]: intl.formatMessage(
{
defaultMessage: "Shipping methods for checkout listed",
description: "event"
}
),
[WebhookEventTypeEnum.FULFILLMENT_CANCELED]: intl.formatMessage({
defaultMessage: "Fulfillment canceled",
description: "event"