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

Populate variables for header meta tags #63

Open
wants to merge 3 commits into
base: master
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
10 changes: 9 additions & 1 deletion screen/store/content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ along with this software (see the LICENSE.md file). If not, see
<default-response url="."/>
</transition>

<pre-actions>
<set field="pageTitle" from="sri.screenUrlInfo.extraPathNameList[sri.screenUrlInfo.extraPathNameList.size()-1]" />
<if condition="sri.screenUrlInfo.extraPathNameList[0] != null"><then>
<set field="pageDesc" from="pageTitle"/>
</then><else>
<set field="pageDesc" value=""/>
</else></if>
</pre-actions>
<actions>
<set field="extraPathNameList" from="sri.screenUrlInfo.extraPathNameList"/>
<service-call name="org.moqui.impl.WikiServices.get#PublishedWikiPageText" out-map="context"
Expand All @@ -95,7 +103,7 @@ along with this software (see the LICENSE.md file). If not, see
<section name="PageTextSection" condition="pageText">
<widgets>
<render-mode><text type="html" location="${template_server_content}"/></render-mode>
</widgets>
</widgets>
<fail-widgets>
<render-mode><text type="html" location="component://PopRestStore/template/store/error.html.ftl"/></render-mode>
</fail-widgets>
Expand Down
21 changes: 15 additions & 6 deletions screen/store/product.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ along with this software (see the LICENSE.md file). If not, see
<transition name="addToCart">
<actions>
<service-call name="popstore.CartServices.add#Product" out-map="addOut"
in-map="[productId:productId, quantity:quantity, currencyUomId:currencyUomId, productStoreId: productStoreId]"/>
in-map="[productId:productId, quantity:quantity, currencyUomId:currencyUomId, productStoreId: productStoreId]"/>
<set field="addedCorrect" from="false"/>
<if condition="addOut.orderHeader != null">
<set field="addedCorrect" from="true"/>
Expand Down Expand Up @@ -51,15 +51,15 @@ along with this software (see the LICENSE.md file). If not, see

<transition name="addReview">
<actions>
<service-call name="popstore.ProductServices.create#ProductReview"
<service-call name="popstore.ProductServices.create#ProductReview"
in-map="[productId:productId, productRating:productRating, productReview:productReview]"/>
</actions>
<default-response url="."/>
<error-response url="."/>
</transition>

<pre-actions>
<set field="star" from="5"/>
<set field="star" from="5"/>
<set field="imgContent" from="[]"/>
<set field="extraPathNameList" from="sri.screenUrlInfo.extraPathNameList"/>
<if condition="searchParameter"><set field="searchParameter" from="URLEncoder.encode(searchParameter, 'UTF-8')"/></if>
Expand Down Expand Up @@ -93,6 +93,16 @@ along with this software (see the LICENSE.md file). If not, see
<return error="true" message="Product not found with ID ${productId}"/>
</then>
</if>

<service-call name="popstore.ProductServices.get#ProductInfo" out-map="product" in-map="[productId:productId]"/>
<if condition="product.productName != null">
<set field="pageTitle" from="product.productName"/>
</if>
<if condition="product.description != null"><then>
<set field="pageDesc" from="product.description"/>
</then><else>
<set field="pageDesc" value=""/>
</else></if>
</pre-actions>
<actions>
<service-call name="popstore.ProductServices.get#ProductInfo" out-map="product" in-map="[productId:productId]"/>
Expand All @@ -104,14 +114,13 @@ along with this software (see the LICENSE.md file). If not, see

<set field="inStock" from="false"/>
<if condition="product.productTypeEnumId == 'PtVirtual'">
<service-call name="popstore.ProductServices.get#ProductVariantsDisplayInfo"
<service-call name="popstore.ProductServices.get#ProductVariantsDisplayInfo"
in-map="context" out-map="variantsList" />
<else>
<if condition="productAvailability.get(productId)">
<set field="inStock" from="true"/>
</if>
</else>
</if>
</else></if>

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