also add alternative packaging on non variant products and include demo data for that

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1052458 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hans Bakker
2010-12-24 06:53:27 +00:00
parent 29b43be89e
commit 02ab5da288
2 changed files with 41 additions and 2 deletions
+6
View File
@@ -999,4 +999,10 @@ under the License.
<ProductPrice productId="WG-9943-S4-BX2" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2000-01-01 00:00:00.0" price="800.0" createdDate="2000-01-01 00:00:00.0"/>
<ProductPrice productId="WG-9943-S4-BX5" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2000-01-01 00:00:00.0" price="2000.0" createdDate="2000-01-01 00:00:00.0"/>
<Product productId="WG-1111-BX2" productTypeId="FINISHED_GOOD" primaryProductCategoryId="20111" productName="Micro Chrome Widget" internalName="Micro Chrome Widget" description="Micro Widget - Chrome Colored" longDescription="This micro chrome widget makes a perfect gift. This one is so small that it floats in air." isVirtual="Y" isVariant="Y" quantityIncluded="50.0" weight="2.0" piecesIncluded="2" quantityUomId="OTH_box"/>
<Product productId="WG-1111-BX4" productTypeId="FINISHED_GOOD" primaryProductCategoryId="20111" productName="Micro Chrome Widget" internalName="Micro Chrome Widget" description="Micro Widget - Chrome Colored" longDescription="This micro chrome widget makes a perfect gift. This one is so small that it floats in air." isVirtual="Y" isVariant="Y" quantityIncluded="50.0" weight="2.0" piecesIncluded="4" quantityUomId="OTH_box"/>
<ProductAssoc productId="WG-1111-BX2" productIdTo="WG-1111" productAssocTypeId="ALTERNATIVE_PACKAGE" fromDate="2000-01-01 00:00:00.0"/>
<ProductAssoc productId="WG-1111-BX4" productIdTo="WG-1111" productAssocTypeId="ALTERNATIVE_PACKAGE" fromDate="2000-01-01 00:00:00.0"/>
<ProductPrice productId="WG-1111-BX2" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="110.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
<ProductPrice productId="WG-1111-BX4" productPricePurposeId="PURCHASE" productPriceTypeId="DEFAULT_PRICE" currencyUomId="USD" productStoreGroupId="_NA_" fromDate="2001-05-13 12:00:00.0" price="200.0" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
</entity-engine-xml>
@@ -22,6 +22,7 @@ under the License.
<#-- virtual product javascript -->
${virtualJavaScript?if_exists}
${virtualVariantJavaScript?if_exists}
<script type="text/javascript">
//<![CDATA[
var detailImageUrl = null;
@@ -269,7 +270,13 @@ ${virtualJavaScript?if_exists}
</#if>
function displayProductVirtualVariantId(variantId) {
document.addform.product_id.value = variantId;
if(variantId){
document.addform.product_id.value = variantId;
}else{
document.addform.product_id.value = '';
variantId = '';
}
var elem = document.getElementById('product_id_display');
var txt = document.createTextNode(variantId);
if(elem.hasChildNodes()) {
@@ -277,7 +284,20 @@ ${virtualJavaScript?if_exists}
} else {
elem.appendChild(txt);
}
setVariantPrice(variantId);
var priceElem = document.getElementById('variant_price_display');
var price = getVariantPrice(variantId);
var priceTxt = null;
if(price){
priceTxt = document.createTextNode(price);
}else{
priceTxt = document.createTextNode('');
}
if(priceElem.hasChildNodes()) {
priceElem.replaceChild(priceTxt, priceElem.firstChild);
} else {
priceElem.appendChild(priceTxt);
}
}
//]]>
</script>
@@ -584,6 +604,19 @@ ${virtualJavaScript?if_exists}
</#if>
<#else>
<input type="hidden" name="add_product_id" value="${product.productId}" />
<#if mainProducts?has_content>
<input type="hidden" name="product_id" value=""/>
<select name="productVariantId" onchange="javascript:displayProductVirtualVariantId(this.value);">
<option value="">Select Unit Of Measure</option>
<#list mainProducts as mainProduct>
<option value="${mainProduct.productId}">${mainProduct.uomDesc} : ${mainProduct.piecesIncluded}</option>
</#list>
</select><br/>
<div>
<strong><span id="product_id_display"> </span></strong>
<strong><div id="variant_price_display"> </div></strong>
</div>
</#if>
<#if (availableInventory?exists) && (availableInventory <= 0)>
<#assign inStock = false />
</#if>