adobe / asset-share-commons

A modern, open-source asset share reference implementation built on Adobe Experience Manager (AEM)
https://opensource.adobe.com/asset-share-commons/
Apache License 2.0
88 stars 107 forks source link

Issue with contexthub.assetsharecommonscart and cart.store is not a function #703

Closed venkat603 closed 2 years ago

venkat603 commented 2 years ago

Hi Team,

I am trying to use cart store on AEM 6.5.10 which is from asset-share-commons. We recently upgraded to 6.5.10 from 6.3.

In 6.3 we used 1.6.10 asset share commons after upgrading to 6.5.10 we used 2.0.6 asset-share-commons.

We have changed all the paths related to contexthub and cleintlibs to Conf folder.

We are using AssestShare Cart for one of the components while loading the store which used in 1.6.10 "contexthub.assetsharecommonscart" in clientlib-contexthub\cart\store.assetsharecommonscart.js , we are facing below issue as attached. I see there is no where they are calling "contexthub.assetsharecommonscart in 2.0.6. Can you look into this.

image

davidjgonzalez commented 2 years ago

Hi @venkat603 - ContextHub was removed for managing the Cart in the ASC 2.0.0 - the reason for this is ContextHub is rather heavy (i believe ~300KB of JS) and this same functionality can be achieved in a few lines of vanilla JS.

You should be able to use AssetShare.Cart's methods shown here:

https://github.com/adobe/asset-share-commons/blob/develop/ui.apps/src/main/content/jcr_root/apps/asset-share-commons/clientlibs/clientlib-site/js/cart.js#L92-L99

Feel free to re-open/comment on this issue if you have more Q's - but ill close it for now.