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

Zizi store master #62

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d62dbff
Returned idCode of features, correct product availability and product…
danieltaylor-nz May 23, 2020
0c87392
Added service to return content
danieltaylor-nz May 23, 2020
bb8282a
Added a service to get associated products
danieltaylor-nz May 29, 2020
81e9227
Removed service that is handled in other PR
danieltaylor-nz May 29, 2020
81e0c6e
Made categories accessible using their pseudoId
danieltaylor-nz May 23, 2020
e25dfe7
Made the lookup for Product Category based on 'categoryId' which is u…
danieltaylor-nz May 29, 2020
cffd24a
Removed redundant calls to get CartInfo
danieltaylor-nz May 25, 2020
9e75911
Removed redundant service calls
danieltaylor-nz May 29, 2020
1a6b1b4
Returned the product image as part of the cart info, avoid querying i…
danieltaylor-nz May 25, 2020
60d53f1
Removed redundant 'product' component from checkout
danieltaylor-nz May 29, 2020
6265303
Renamed 'orderItemContent' to 'cartItemsImage' as it only contains im…
danieltaylor-nz May 29, 2020
2083044
Made the checkout root customizable, added default template
danieltaylor-nz May 25, 2020
9d3219d
Made the checkout root customizable, can add server-side logic
danieltaylor-nz May 25, 2020
0846601
Fixed bug that was blocking content from showing
danieltaylor-nz May 26, 2020
a16030c
Added error page from config
danieltaylor-nz May 29, 2020
5ec531a
Made productStoreId a parameter instead of pulling from the session, …
danieltaylor-nz Jun 6, 2020
b7e1e34
Merge branch 'fix-bug-in-pricing' into zizi-store-master
danieltaylor-nz Jun 8, 2020
9805a7e
Merge branch 'fixed-bug-in-content' into zizi-store-master
danieltaylor-nz Jun 8, 2020
faab5e5
Merge branch 'get-category-by-pseudo-id' into zizi-store-master
danieltaylor-nz Jun 8, 2020
ce4857f
Merge branch 'get-location-text-service' into zizi-store-master
danieltaylor-nz Jun 8, 2020
44c70a0
Merge branch 'get-product-assoc-and-details' into zizi-store-master
danieltaylor-nz Jun 8, 2020
24e13bd
Merge branch 'made-checkout-root-customizable' into zizi-store-master
danieltaylor-nz Jun 8, 2020
2ed9fc4
Merge branch 'removed-redundant-code' into zizi-store-master
danieltaylor-nz Jun 8, 2020
f64328a
Merge branch 'return-id-code-features' into zizi-store-master
danieltaylor-nz Jun 8, 2020
b845d06
Merge branch 'returned-product-content-in-cart' into zizi-store-master
danieltaylor-nz Jun 8, 2020
3403f35
Resovled conflicts between fix-bug-in-pricing and get-category-by-pse…
danieltaylor-nz Jun 8, 2020
0433861
Simplified the retrieval of category images to use the same logic as …
danieltaylor-nz Jun 7, 2020
dc04378
Merge branch 'returned-product-content-in-cart' into zizi-store-master
danieltaylor-nz Jun 8, 2020
b1f86b5
Made page size dynamic and Fixed pagination on category page
danieltaylor-nz Jun 6, 2020
ea74a6c
Merge branch 'get-category-by-pseudo-id' into zizi-store-master
danieltaylor-nz Jun 8, 2020
a0062ad
Resovled conflicts between fix-bug-in-pricing and get-category-by-pse…
danieltaylor-nz Jun 8, 2020
741c221
Renamed 'checkout' to 'spa' because it handles all the account and lo…
danieltaylor-nz Jun 7, 2020
40f829d
Renamed 'productsInCart' to 'cart'
danieltaylor-nz Jun 8, 2020
8873d08
Restored 'productCategoryId' parameter for legacy reasons
danieltaylor-nz Jun 11, 2020
11bfdc4
Merge remote-tracking branch 'tailorsoft/get-category-by-pseudo-id' i…
danieltaylor-nz Jun 11, 2020
937599f
Added PcntListingImage content for showing on the product listing pages
danieltaylor-nz Jun 11, 2020
27d4487
Merge branch 'EC-100458-credit-card-issue-on-checkout-page' into zizi…
lAndresul Jun 16, 2020
7db0d83
Merge branch 'master' into zizi-store-master
danieltaylor-nz Jun 18, 2020
e6fc47f
zizi-changes incomplete
danieltaylor-nz Aug 19, 2020
eddecbc
EC-100245 fix add shipping address token error
marror7 Feb 9, 2021
9503f21
removed data index thats not necessary
danieltaylor-nz Apr 5, 2021
ea8086f
Merge branch 'master' into zizi-store-master
danieltaylor-nz Apr 5, 2021
c639c7d
Fixing boolean parameter
marror7 Apr 15, 2021
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
def compsPath = "screen/store/components"
// source JS files in load order
def compsJsFiles = [compsPath + "/utilities.js", compsPath + "/ApiServices.js", compsPath + "/ComponentsNav.js",
compsPath + "/ComponentsProduct.js", compsPath + "/ComponentsAccount.js", compsPath + "/ComponentsCheckout.js", compsPath + "/main.js"]
compsPath + "/ComponentsAccount.js", compsPath + "/ComponentsCheckout.js", compsPath + "/main.js"]

task combineBaseJs(type: com.eriwen.gradle.js.tasks.CombineJsTask) {
encoding = "UTF-8"
Expand Down
9 changes: 9 additions & 0 deletions data/PopRestStoreAaaSetupData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ along with this software (see the LICENSE.md file). If not, see
<moqui.basic.Enumeration enumCode="store_path" description="Base path for store's product list" enumId="PsstStorePath" enumTypeId="ProductStoreSettingType"/>

<!-- client template setting types -->
<moqui.basic.Enumeration enumCode="template_client_header" description="Template Client Header for Accounts" enumId="PsstTemplateClientHeader" enumTypeId="ProductStoreSettingType"/>
<moqui.basic.Enumeration enumCode="template_client_footer" description="Template Client Footer for Accounts" enumId="PsstTemplateClientFooter" enumTypeId="ProductStoreSettingType"/>

<moqui.basic.Enumeration enumCode="template_client_account" description="Template Client Account Page" enumId="PsstTemplateClientAccount" enumTypeId="ProductStoreSettingType"/>
<moqui.basic.Enumeration enumCode="template_client_addAddress" description="Template Client Add Address" enumId="PsstTemplateClientAddAddress" enumTypeId="ProductStoreSettingType"/>
<moqui.basic.Enumeration enumCode="template_client_checkoutHeader" description="Template Client Checkout Header" enumId="PsstTemplateClientCheckoutHeader" enumTypeId="ProductStoreSettingType"/>
Expand All @@ -50,7 +53,13 @@ along with this software (see the LICENSE.md file). If not, see
<moqui.basic.Enumeration enumCode="template_server_product" description="Template Server Product" enumId="PsstTemplateServerProduct" enumTypeId="ProductStoreSettingType"/>
<moqui.basic.Enumeration enumCode="template_server_search" description="Template Server Search" enumId="PsstTemplateServerSearch" enumTypeId="ProductStoreSettingType"/>
<moqui.basic.Enumeration enumCode="template_server_category" description="Template Server Category" enumId="PsstTemplateServerCategory" enumTypeId="ProductStoreSettingType"/>
<moqui.basic.Enumeration enumCode="template_server_spa" description="Template Server SPA" enumId="PsstTemplateServerSpa" enumTypeId="ProductStoreSettingType"/>

<moqui.basic.Enumeration enumCode="category_page_size" description="Category Products Page Size" enumId="PsstCategoryPageSize" enumTypeId="ProductStoreSettingType"/>

<!-- store setting used for dynamically setting the productStoreId depending on the hostname -->
<moqui.basic.Enumeration enumCode="product_store_id_from_hostname" description="Product Store ID From Hostname" enumId="PsstHostname" enumTypeId="ProductStoreSettingType"/>

<moqui.basic.Enumeration description="Product Listing Image" enumId="PcntListingImage" enumTypeId="ProductContentType"/>
<moqui.basic.Enumeration description="Category Image" enumId="PcctImage" enumTypeId="ProductCategoryContentType"/>
</entity-facade-xml>
8 changes: 4 additions & 4 deletions data/PopRestStoreProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ along with this software (see the LICENSE.md file). If not, see

<!-- TODO: get original text instead of binary export, fine for demo images but for text makes it impossible to maintain -->

<mantle.product.category.ProductCategory productCategoryId="DEMO_CLOTHING" productCategoryTypeEnumId="PctCatalog" categoryName="Clothing" description=""/>
<mantle.product.category.ProductCategory productCategoryId="DEMO_CLOTHING" pseudoId="clothing" productCategoryTypeEnumId="PctCatalog" categoryName="Clothing" description=""/>
<mantle.product.category.ProductCategoryRollup productCategoryId="DEMO_CLOTHING" parentProductCategoryId="PopcBrowseRoot" fromDate="1265184000000" sequenceNum="1"/>
<mantle.product.category.ProductCategory productCategoryId="DEMO_OFFICE" productCategoryTypeEnumId="PctCatalog" categoryName="Office" description=""/>
<mantle.product.category.ProductCategory productCategoryId="DEMO_OFFICE" pseudoId="office-supplies" productCategoryTypeEnumId="PctCatalog" categoryName="Office" description=""/>
<mantle.product.category.ProductCategoryRollup productCategoryId="DEMO_OFFICE" parentProductCategoryId="PopcBrowseRoot" fromDate="1265184000000" sequenceNum="2"/>

<!-- Men's T-Shirt with size only variants -->
Expand Down Expand Up @@ -71,7 +71,7 @@ along with this software (see the LICENSE.md file). If not, see
assetTypeEnumId="AstTpInventory" assetClassEnumId="AsClsInventoryFin" copyCategoryMembers="false"/>

<!-- Women's T-Shirt with size and color variants -->
<mantle.product.Product productId="DEMO_TS_W" productTypeEnumId="PtVirtual" assetTypeEnumId="" assetClassEnumId=""
<mantle.product.Product productId="DEMO_TS_W" pseudoId="womens-tshirt" productTypeEnumId="PtVirtual" assetTypeEnumId="" assetClassEnumId=""
chargeShipping="Y" returnable="Y" productName="Women&apos;s T-Shirt" description="">
<prices productPriceId="DEMO_TS_W_L" pricePurposeEnumId="PppPurchase" priceTypeEnumId="PptList" fromDate="1265184000000"
minQuantity="1" price="19.99" priceUomId="USD"/>
Expand Down Expand Up @@ -393,5 +393,5 @@ along with this software (see the LICENSE.md file). If not, see

<!-- run index for search -->
<org.moqui.search.SearchServices.indexDataFeedDocuments dataFeedId="MantleSearch"/>
<org.moqui.search.SearchServices.indexDataFeedDocuments dataFeedId="PopCommerceSearch"/>
<!-- org.moqui.search.SearchServices.indexDataFeedDocuments dataFeedId="PopCommerceSearch"/ -->
</entity-facade-xml>
19 changes: 7 additions & 12 deletions screen/store.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ along with this software (see the LICENSE.md file). If not, see
<field-map field-name="partyId" from="ec.user.userId"/>
</entity-find-one>
</if>

<service-call name="popstore.CartServices.get#CartInfo" in-map="context" out-map="cart" />
</always-actions>

<transition name="config.js" read-only="true">
Expand Down Expand Up @@ -71,27 +73,20 @@ var storeInfo = ${storeInfoJson};
<!-- get browseRootCategoryInfo for subCategoryList used in header, etc -->
<if condition="browseRootCategoryId">
<service-call name="popstore.ProductServices.get#CategoryInfo" out-map="browseRootCategoryInfo"
in-map="[productCategoryId:browseRootCategoryId]"/>
</if>
<!-- get allProductsInfo for subCategoryList used in header, etc -->
<set field="allProducts" from="storeInfo.categoryByType.PsctSearch"/>
<set field="allProductsId" from="storeInfo.categoryByType.PsctSearch?.productCategoryId"/>
<if condition="allProductsId">
<service-call name="popstore.ProductServices.get#CategoryInfo" out-map="allProductsInfo"
in-map="[productCategoryId:allProductsId]"/>
in-map="[categoryId:browseRootCategoryId]"/>
</if>
<!-- cartInfo for cart count in header/navbar -->
<service-call name="popstore.CartServices.get#CartInfo" out-map="cartInfo" in-map="context"/>


<!-- get settings used in subscreens -->
<set field="template_server_root" from="storeInfo.settings.template_server_root" default-value="component://PopRestStore/template/store/root.html.ftl"/>
<set field="template_server_header" from="storeInfo.settings.template_server_header" default-value="component://PopRestStore/template/store/navbar.html.ftl"/>
<set field="template_server_footer" from="storeInfo.settings.template_server_footer" default-value="component://PopRestStore/template/store/footer.html.ftl"/>
<set field="template_server_home" from="storeInfo.settings.template_server_home" default-value="component://PopRestStore/template/store/home.html.ftl"/>
<set field="template_server_category" from="storeInfo.settings.template_server_category" default-value="component://PopRestStore/template/store/category.html.ftl"/>
<set field="template_server_product" from="storeInfo.settings.template_server_product" default-value="component://PopRestStore/template/store/product.html.ftl"/>
<set field="template_server_content" from="storeInfo.settings.template_server_content" default-value="component://PopRestStore/template/store/help.html.ftl"/>
<set field="template_server_content" from="storeInfo.settings.template_server_content" default-value="component://PopRestStore/template/store/content.html.ftl"/>
<set field="template_server_search" from="storeInfo.settings.template_server_search" default-value="component://PopRestStore/template/store/search.html.ftl"/>
<set field="template_server_spa" from="storeInfo.settings.template_server_spa" default-value="component://PopRestStore/template/store/spa.html.ftl"/>
<set field="template_server_error" from="storeInfo.settings.template_server_error" default-value="component://PopRestStore/template/store/error.html.ftl"/>
</pre-actions>

<widgets>
Expand Down
Binary file added screen/store/assets/bolster/landing/banner1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screen/store/assets/bolster/landing/banner2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screen/store/assets/bolster/landing/banner3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screen/store/assets/bolster/landing/banner4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screen/store/assets/bolster/landing/banner5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 31 additions & 58 deletions screen/store/category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ along with this software (see the LICENSE.md file). If not, see
-->
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-2.1.xsd"
require-authentication="anonymous-view" allow-extra-path="true">
<parameter name="categoryId"/>
<parameter name="orderBy"/>
<parameter name="productName"/>
<parameter name="pageIndex"/>
<parameter name="addedCorrect"/>
<parameter name="page"/>

<transition name="addToCart">
<actions>
<log message="addToCart!!" />
<service-call name="popstore.CartServices.add#Product" out-map="addOut"
in-map="[productId:productId, quantity:quantity, currencyUomId:currencyUomId, productStoreId: productStoreId]"/>
<set field="addedCorrect" from="false"/>
Expand All @@ -41,67 +39,42 @@ along with this software (see the LICENSE.md file). If not, see
</transition>

<pre-actions>
<set field="extraPathNameList" from="sri.screenUrlInfo.extraPathNameList"/>
<if condition="extraPathNameList &amp;&amp; !categoryId"><set field="categoryId" from="extraPathNameList[0]"/></if>
<if condition="extraPathNameList &amp;&amp; !pageIndex">
<set field="pageIndex" from="extraPathNameList[1]"/>
<if condition="pageIndex == null">
<set field="pageIndex" from="0"/>
</if>
</if>
<if condition="extraPathNameList &amp;&amp; !orderBy">
<set field="orderBy" from="extraPathNameList[2]"/>
<if condition="orderBy == null">
<set field="orderBy" from="'default'"/>
</if>
</if>
<set field="pathParts" from="sri.screenUrlInfo.extraPathNameList"/>
<set field="categoryId" from="pathParts[0]"/>
<set field="productId" from="pathParts[1]"/>
</pre-actions>
<actions>
<service-call name="popstore.ProductServices.get#CategoryProducts" out-map="products"
in-map="[productCategoryId:categoryId, orderBy: orderBy, pageIndex:pageIndex ? pageIndex : '0', pageSize:6]"/>

<service-call name="popstore.ProductServices.get#CategoryInfo" out-map="category" in-map="[productCategoryId:categoryId]"/>

<service-call name="popstore.ProductServices.find#ProductAvailability" in-map="context" out-map="context" />

<set field="inStock" from="false"/>

<service-call name="popstore.CartServices.get#CartInfo" in-map="context" out-map="productsInCart" />
<service-call name="popstore.ProductServices.get#SortedProductList" in-map="context + [productCategoryId:categoryId]" out-map="context"/>
<!-- if no category is passed in the url, we default to the browse root -->
<if condition="!categoryId">
<set field="categoryId" from="storeInfo.categoryByType.PsctBrowseRoot.productCategoryId"/>
</if>

<service-call name="popstore.ProductServices.get#CategoryInfo" out-map="category" in-map="[categoryId:categoryId]"/>

<service-call name="popstore.ProductServices.get#ViewAllowProducts" in-map="context" out-map="context"/>
<!-- no point in query products if we will display the product -->
<if condition="!productId">
<set field="pageSize" from="storeInfo.settings.category_page_size ?: 6" />
<service-call name="popstore.ProductServices.get#CategoryProducts" out-map="context"
in-map="[productStoreId:productStoreId, productCategoryId:category.productCategoryId, orderBy: orderBy, pageIndex:page ? page-1 : '0', pageSize:pageSize]"/>

<set field="pageSize" from="pageSize ?: 100"/>
<service-call name="popstore.ProductServices.get#ViewAllowProducts" in-map="context" out-map="context"/>

<set field="virtualProductsIds" from="[:]"/>
<iterate list="productList" entry="product">
<if condition="product.productTypeEnumId == 'PtVirtual'">
<then>
<script>
virtualProductsIds.put(product.productId, product.productId)
</script>
</then>
<else>
<entity-find-one entity-name="mantle.product.ProductAssocAndFrom" value-field="productAssoc">
<field-map field-name="toProductId" from="product.productId"/>
<field-map field-name="productTypeEnumId" value="PtVirtual"/>
</entity-find-one>
<script>
if(productAssoc){
virtualProductsIds.put(product.productId, productAssoc.productId)
}else{
virtualProductsIds.put(product.productId, product.productId)
}
</script>
</else>
</if>
</iterate>
<script>paginateList("productList", null, context)</script>
<set field="productListPageCount" from="Math.ceil(productListCount/productListPageSize)"/>
</if>
</actions>

<widgets>
<render-mode><text type="html" location="${template_server_header}"/></render-mode>
<render-mode><text type="html" location="${template_server_category}"/></render-mode>
<render-mode><text type="html" location="${template_server_footer}"/></render-mode>
<section name="Product">
<condition><expression>productId != null</expression></condition>
<widgets><include-screen location="component://PopRestStore/screen/store/product.xml"/></widgets>
</section>
<section name="Category">
<condition><expression>productId == null</expression></condition>
<widgets>
<render-mode><text type="html" location="${template_server_header}"/></render-mode>
<render-mode><text type="html" location="${template_server_category}"/></render-mode>
<render-mode><text type="html" location="${template_server_footer}"/></render-mode>
</widgets>
</section>
</widgets>
</screen>
9 changes: 8 additions & 1 deletion screen/store/components/ComponentsCheckout.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ storeComps.CheckOutPage = {
name: "checkout-page",
extends: storeComps.CheckoutNavbar,
data: function() { return {
cvv: "", showCvvError: false, homePath: "", storePath: "", customerInfo: {}, productsInCart: {}, shippingAddress: {}, shippingAddressSelect: {}, paymentMethod: {}, shippingMethod: {},
cvv: "", showCvvError: false, homePath: "", storePath: "", customerInfo: {}, cartItemsImage:{}, productsInCart: {}, shippingAddress: {}, shippingAddressSelect: {}, paymentMethod: {}, shippingMethod: {},
showCheckoutMessages:false, billingAddress: {}, billingAddressOption: "", listShippingAddress: [], listPaymentMethods: [], promoCode: "", promoError: "", postalAddressStateGeoSelected: null,
countriesList: [], regionsList: [], shippingOption: "", addressOption: "", paymentOption: "", isSameAddress: "0", shippingItemPrice: 0,
isUpdate: false, isSpinner: false, responseMessage: "", toNameErrorMessage: "", countryErrorMessage: "", addressErrorMessage: "",
Expand Down Expand Up @@ -108,6 +108,12 @@ storeComps.CheckOutPage = {
return a + value;
}, 0);
},
getProductImage: function(productId) {
if (productId in this.cartItemsImage)
return storeConfig.productImageLocation + this.cartItemsImage[productId].productContentId;
else
return "/store/assets/default.png";
},
getCartCountByItemEnum: function(itemEnum){
return this.productsInCart.orderItemList.reduce(function (acc, item) {
return item.itemTypeEnumId == itemEnum ? acc + item.quantity : acc + 0;
Expand Down Expand Up @@ -199,6 +205,7 @@ storeComps.CheckOutPage = {
this.addressOption = data.postalAddress.contactMechId + ':' + data.postalAddress.telecomContactMechId;
this.shippingAddressSelect = data.postalAddress;
this.shippingAddressSelect.contactNumber = data.telecomNumber.contactNumber;
this.cartItemsImage = data.cartItemsImage;
} else if (this.listShippingAddress.length) {
// Preselect first address
this.addressOption = this.listShippingAddress[0].postalContactMechId + ':' + this.listShippingAddress[0].telecomContactMechId;
Expand Down
4 changes: 3 additions & 1 deletion screen/store/components/ComponentsNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ storeComps.ModalAddress = {
}

this.disabled = true;
CustomerService.addShippingAddress(this.shippingAddress, this.axiosConfig).then(function (data) {
const axiosConfig = { headers: { "Content-Type": "application/json;charset=UTF-8", "Access-Control-Allow-Origin": "*",
"api_key":this.$root.apiKey, "moquiSessionToken":this.$root.moquiSessionToken } }
CustomerService.addShippingAddress(this.shippingAddress, axiosConfig).then(function (data) {
this.responseMessage = "";
this.completeCallback(data);
}.bind(this));
Expand Down
29 changes: 0 additions & 29 deletions screen/store/components/ComponentsProduct.js

This file was deleted.

Loading