svnno****@sourc*****
svnno****@sourc*****
2007年 11月 21日 (水) 17:14:58 JST
Revision: 722 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=722 Author: shinsuke Date: 2007-11-21 17:14:58 +0900 (Wed, 21 Nov 2007) Log Message: ----------- supported order quantity. Modified Paths: -------------- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/product/ProductDetailsAction.java pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/product/ProductDetailsPage.java pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/product/productDetails.html -------------- next part -------------- Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/product/ProductDetailsAction.java =================================================================== --- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/product/ProductDetailsAction.java 2007-11-21 06:40:06 UTC (rev 721) +++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/product/ProductDetailsAction.java 2007-11-21 08:14:58 UTC (rev 722) @@ -147,6 +147,9 @@ .getProductImageUrl(PompeiConstants.DEFAULT_DETAILS_IMAGE_NAME)); } + // set order quantity + getProductDetailsPage().setOrderQuantity(BigDecimal.valueOf(1)); + // set title SystemUtil.setWindowTitle(getProductDetailsPage().getLabelHelper() .getLabelValue("windowTitle")); @@ -192,7 +195,8 @@ customersBasket = new CustomerBasket(); customersBasket.setCustomerId(customers.getCustomerId()); customersBasket.setProductId(products.getProductId()); - customersBasket.setQuantity(new BigDecimal(1)); + customersBasket.setQuantity(getProductDetailsPage() + .getOrderQuantity()); customersBasket.setDateAdded(new Timestamp(new Date().getTime())); customersBasket.setProduct(products); customersBasket.setFinalPrice(calculateFinalPrice(customersBasket)); @@ -201,7 +205,7 @@ } else { // add customersBasket.setQuantity(customersBasket.getQuantity().add( - new BigDecimal(1))); + getProductDetailsPage().getOrderQuantity())); customersBasket.setDateAdded(new Timestamp(new Date().getTime())); customersBasket.setFinalPrice(calculateFinalPrice(customersBasket)); cartService.updateCustomerBasket(customersBasket); Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/product/ProductDetailsPage.java =================================================================== --- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/product/ProductDetailsPage.java 2007-11-21 06:40:06 UTC (rev 721) +++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/product/ProductDetailsPage.java 2007-11-21 08:14:58 UTC (rev 722) @@ -35,6 +35,8 @@ private BigDecimal quantity; + private BigDecimal orderQuantity; + private BigDecimal weight; private String size; @@ -314,4 +316,18 @@ public String getLargeImageTitle() { return getName(); } + + /** + * @return the orderQuantity + */ + public BigDecimal getOrderQuantity() { + return orderQuantity; + } + + /** + * @param orderQuantity the orderQuantity to set + */ + public void setOrderQuantity(BigDecimal orderQuantity) { + this.orderQuantity = orderQuantity; + } } Modified: pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/product/productDetails.html =================================================================== --- pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/product/productDetails.html 2007-11-21 06:40:06 UTC (rev 721) +++ pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/product/productDetails.html 2007-11-21 08:14:58 UTC (rev 722) @@ -53,6 +53,10 @@ <div id="isLogin"> <div id="isUser"> <span id="isAvailable-cartbutton"> + <div> + <label>数量</label> + <input type="text" id="orderQuantity" size="2" /> + </div> <input type="submit" id="doAddCart" value="カートに追加" /> </span> </div>