Skip to content

Commit

Permalink
fix: fixed issue where plugin wasn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
Bird87ZA committed Jan 16, 2025
1 parent 3024e17 commit 3bb344d
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ interface ErrorResponse {
errors: Array<ShopwareHttpError>;
}

interface StoreExtension {
name: string;
}

export default Shopware.Component.wrapComponentConfig({
template,

Expand All @@ -24,11 +28,17 @@ export default Shopware.Component.wrapComponentConfig({
inAppPurchaseCart: null as IAP.InAppPurchaseCart | null,
extension: null as IAP.Extension | null,
tosAccepted: false,
errorSnippet: null as string | null
errorSnippet: null as string | null,
storeExtension: '' as string
};
},

created() {
// @deprecated tag:v4.0.0 - Will be removed as this.store.extension will be only a string in shopware 6.7
const extension = this.store.extension as StoreExtension | string;
this.storeExtension = typeof extension === 'object'
? extension.name
: extension;
this.createdComponent();
},

Expand Down Expand Up @@ -73,10 +83,10 @@ export default Shopware.Component.wrapComponentConfig({

await Promise.all([
this.cart = this.inAppPurchasesService.createCart(
this.store.extension,
this.storeExtension,
this.store.entry.identifier
),
this.inAppPurchasesService.getExtension(this.store.extension)
this.inAppPurchasesService.getExtension(this.storeExtension)
]).then(([inAppPurchaseCart, extension]) => {
this.inAppPurchaseCart = inAppPurchaseCart;
this.extension = extension;
Expand Down

0 comments on commit 3bb344d

Please sign in to comment.