Changeset 20984
- Timestamp:
- 2011/06/20 00:20:22 (12 years ago)
- Location:
- branches/version-2_11-dev/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_11-dev/data/Smarty/templates/default/shopping/multiple.tpl
r20975 r20984 88 88 <span class="attention"><!--{$arrErr[$key][$index]}--></span> 89 89 <!--{/if}--> 90 <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]}-->" class="box40" />90 <input type="text" name="<!--{$key}-->[<!--{$index}-->]" value="<!--{$arrForm[$key].value[$index]}-->" class="box40" style="<!--{$arrErr[$key][$index]|sfGetErrorColor}-->" /> 91 91 </td> 92 92 <td> -
branches/version-2_11-dev/data/class/pages/shopping/LC_Page_Shopping_Multiple.php
r20975 r20984 209 209 */ 210 210 function lfCheckError(&$objFormParam) { 211 $objCartSess = new SC_CartSession_Ex(); 212 211 213 $objFormParam->convParam(); 212 return $objFormParam->checkError(); 214 $arrErr = $objFormParam->checkError(); 215 // 入力エラーが無い場合、カゴの中身との数量の整合を確認 216 217 if (empty($arrErr)) { 218 $arrQuantity = array(); 219 // 入力内容を集計 220 $arrParams = $objFormParam->getHashArray(); 221 $arrParams = SC_Utils_Ex::sfSwapArray($arrParams); 222 foreach ($arrParams as $arrParam) { 223 $product_class_id = $arrParam['product_class_id']; 224 $arrQuantity[$product_class_id] += $arrParam['quantity']; 225 } 226 // カゴの中身と突き合わせ 227 $cartLists =& $objCartSess->getCartList($objCartSess->getKey()); 228 foreach ($cartLists as $arrCartRow) { 229 $product_class_id = $arrCartRow['id']; 230 // 差異がある場合、エラーを記録 231 if ($arrCartRow['quantity'] != $arrQuantity[$product_class_id]) { 232 foreach ($arrParams as $key => $arrParam) { 233 if ($arrParam['product_class_id'] == $product_class_id) { 234 $arrErr['quantity'][$key] = 'カゴの中(数量:' . $arrCartRow['quantity'] .')と合計が一致していません。<br />'; 235 } 236 } 237 } 238 } 239 } 240 return $arrErr; 213 241 } 214 242
Note: See TracChangeset
for help on using the changeset viewer.