Koszyk - powielanie zamowienia

runner

No avatar

2005-11-22 09:14

Witam serdecznie :)
Jestem poczatkujacym uzytkownikiem QC. Wlasnie testuje ten program i zauwazylem, ze po dokonaniu zakupu i przejsciu do strony Koszyk po wcisnieciu "Odswiez" nastepuje ponowne dodanie wczesniej zamowionego towaru. Czy to jest "normalne"? Czy moge to wyeliminowac?

treewood (OpenSolution)

Avatar: treewood

2005-11-22 12:12

w wersji qc 1.0 zostalo to poprawione

Konrad

Avatar: Konrad

2005-11-25 19:47

Miałem ten problem. Należy zmienić część kodu w pliku: orders.php z katalogu actions_client . Wiem z doświadczenia, że lepiej znać cały kod od razu, bo mozna się pogubić z podmianą fragmentów, dlatego podaję cały poprawny kod pliku orders.php.

<?php
require_once DIR_CORE.'couriers-'.$config['db_type'].'.php';
require_once DIR_CORE.'couriers.php';

require_once DIR_CORE.'orders-'.$config['db_type'].'.php';
require_once DIR_CORE.'orders.php';

require_once DIR_CORE.'products-'.$config['db_type'].'.php';
require_once DIR_CORE.'products.php';

if( $a == 'Basket' ){

if( isset( $sOption ) ){
if( $sOption == 'add' ){
if( isset( $iProduct ) && is_numeric( $iProduct ) && isset( $iQuantity ) && is_numeric( $iQuantity ) && $iQuantity > 0 ){
addBasketProduct( $iProduct, $iQuantity );
}
}
elseif( $sOption == 'del' ){
$iOrder = throwOrdersIdTemp( $_SESSION['iCustomer'], null );
if( isset( $iElement ) && is_numeric( $iElement ) )
delBasketElement( $iOrder, $iElement );
}
elseif( $sOption == 'save' ){
extract( $_POST );
if( isset( $aQuantity ) && is_array( $aQuantity ) ){
$iCount = count( $aQuantity );
for( $i = 0; $i < $iCount; $i++ )
if( $aQuantity[$i] != $aQuantityBefore[$i] && is_numeric( $aQuantity[$i] ) && $aQuantity[$i] > 0 )
addBasketProduct( $aProduct[$i], $aQuantity[$i] - $aQuantityBefore[$i] );
}

if( isset( $save ) ){
header( 'Location: '.$_SERVER['PHP_SELF'].'?p=ordersDelivery' );
exit;
}
}
header( 'Location: '.$_SERVER['PHP_SELF'].'?p=ordersBasket' );
exit;
}
$iOrder = throwOrdersIdTemp( $_SESSION['iCustomer'], null );

if( isset( $iOrder ) && is_numeric( $iOrder ) )
$content .= listBasket( $iOrder );
else
$content .= $tpl->tbHtml( 'orders_basket.tpl', 'NOT_FOUND' );
}
elseif( $a == 'Delivery' ){
$iOrder = throwOrdersIdTemp( $_SESSION['iCustomer'], null );
if( isset( $iOrder ) && is_numeric( $iOrder ) ){

if( isset( $_POST['option'] ) && $_POST['option'] == 'send' ){
if( checkOrderFields( $_POST ) === true ){
saveOrder( $iOrder, $_POST );
$content .= $tpl->tHtml( 'orders_saved.tpl' );
}
else
$content .= $tpl->tbHtml( 'operations.tpl', 'FORM_ERROR' );
}
else{
if( checkBasketProducts( $iOrder ) === true ){
$sSelectCourier = listCouriers( 'couriers_select.tpl' );
$content .= $tpl->tbHtml( 'orders_delivery.tpl', 'FORM' );
$content .= listBasket( $iOrder, 'orders_delivery.tpl' );
$content .= $tpl->tbHtml( 'orders_delivery.tpl', 'COURIER' );
}
else
$content .= $tpl->tbHtml( 'operations.tpl', 'NOT_EXISTS' );
}
}
else{
$content .= $tpl->tbHtml( 'orders_basket.tpl', 'NOT_FOUND' );
}
}
elseif( $a == 'WindowPrint' && isset( $iOrder ) && is_numeric( $iOrder ) ){
$aOrder = throwOrder( $iOrder );
if( isset( $aOrder ) && is_array( $aOrder ) && $aOrder['iKlient'] == $_SESSION['iCustomer'] && $aOrder['iStatus'] > 0 ){
$content .= $tpl->tbHtml( 'orders_print.tpl', 'SHOW' );
if( checkBasketProducts( $iOrder ) === true ){
$content .= listBasket( $iOrder, 'orders_print.tpl' );
$aCourier = throwCourier( $aOrder['iCourier'] );
$fSummary = sprintf( '%01.2f', $aCourier['price'] + $aBasket['fSummary'] );
$content .= $tpl->tbHtml( 'orders_print.tpl', 'COURIER' );
}
}
else{
$content .= $tpl->tbHtml( 'operations.tpl', 'ERROR' );
}
}
?>

I sprawa rozwiązana, przynajmniej w wersji 0.3.1. bo co do starszych to nie wiem.

Konrad

Do góry
o nas | kontakt