how to make shipment cost % of price

maracana11

Avatar: maracana11

2012-07-17 01:09

how to do in shipping price not fixed, but % of item cost. for example item is 1000 i need 27+2%(of 1000, NOT of 27)

» Quick.Cart v5.x

boboo

Avatar: boboo

2012-07-17 06:32

Do you ask for % price of shipping cost or payment cost?

qc-plugins.kimla.de

maracana11

Avatar: maracana11

2012-07-18 18:05

the price of shipping must include % of cost an item

maracana11

Avatar: maracana11

2012-08-03 16:28

?

eyesightfriend

No avatar

2012-08-08 21:58

shipping price must be shown separately and also must include % of cost an item

--------------------------------------------------

maracana11

Avatar: maracana11

2012-08-08 23:40

What is the formula?

wewior (OpenSolution)

Avatar: wewior

2012-08-09 08:09

That is not so simple to do but you can try:
1. Edit file database/_fields.php and change code:

$aOrdersExtFields = Array( 'iOrder''iShipping''iPayment''mShipping''fShippingPrice''mPayment''mPaymentPrice''sIp''sComment' );


to:

$aOrdersExtFields = Array( 'iOrder''iShipping''iPayment''mShipping''fShippingPrice''mPayment''mPaymentPrice''sIp''sComment''fOrderProductsSummary' );



2. Edit core/common.php and change function generatePrice to:

function generatePrice$mPrice1$mPrice2$fProductsSummary null ){
  if( 
strstr$mPrice2'%' ) ){
    
$mPrice2 str_replace'%'''$mPrice2 );
    if( 
$mPrice2 ){
      if( isset( 
$fProductsSummary ) )
        return 
normalizePrice$mPrice1 - ( $fProductsSummary * ( -$mPrice2 100 ) ) );
      else
        return 
normalizePrice$mPrice1 - ( $mPrice1 * ( -$mPrice2 100 ) ) );
    }
    else{
      if( isset( 
$fProductsSummary ) )
        return 
normalizePrice$mPrice1 + ( $fProductsSummary * ( $mPrice2 100 ) ) ); 
      else
        return 
normalizePrice$mPrice1 + ( $mPrice1 * ( $mPrice2 100 ) ) ); 
    }
  }
  else{
    return 
normalizePrice$mPrice1 $mPrice2 ); 
  }
// end function generatePrice



3. Edit file core/orders.php and change code:

$aData['fProductsSummary'] = normalizePrice$this->fProductsSummary );


to:

$aData['fProductsSummary'] = $_SESSION['fOrderProductsSummary'] = normalizePrice$this->fProductsSummary );



4. Edit file core/orders.php and change code:

$aForm array_merge$aForm, Array( 'iOrder' => ( $this->throwLastIdDB_ORDERS'iOrder' ) + ), 'iTime' => time( ), 'sIp' => $_SERVER['REMOTE_ADDR'], 'iStatus' => 1'sLanguage' => LANGUAGE'mShipping' => $aShipping['sName'], 'fShippingPrice' => $aShipping['fPrice'], 'iShipping' => $aShipping['iId'], 'mPayment' => $aPayment['sName'], 'iPayment' => $aPayment['iId'], 'mPaymentPrice' => $this->throwShippingPaymentPrice$aExp[0], $aExp[1] ) ) );


to:

$aForm array_merge$aForm, Array( 'iOrder' => ( $this->throwLastIdDB_ORDERS'iOrder' ) + ), 'iTime' => time( ), 'sIp' => $_SERVER['REMOTE_ADDR'], 'iStatus' => 1'sLanguage' => LANGUAGE'mShipping' => $aShipping['sName'], 'fShippingPrice' => $aShipping['fPrice'], 'iShipping' => $aShipping['iId'], 'mPayment' => $aPayment['sName'], 'iPayment' => $aPayment['iId'], 'mPaymentPrice' => $this->throwShippingPaymentPrice$aExp[0], $aExp[1] ), 'fOrderProductsSummary' => $_SESSION['fOrderProductsSummary'] ) );



5. Edit file core/orders.php and change code:

$aData['fPaymentShippingPrice'] = generatePrice$aData['fShippingPrice'], $aData['mPaymentPrice'] );


to:

$aData['fPaymentShippingPrice'] = generatePrice$aData['fShippingPrice'], $aData['mPaymentPrice'], $aData['fOrderProductsSummary'] );



6. Edit file core/orders.php and change code:

$fShippingPaymentPrice = !empty( $sPriceModify ) ? generatePrice$aData['fPrice'], $sPriceModify ) : $aData['fPrice'];


to:

$fShippingPaymentPrice = !empty( $sPriceModify ) ? generatePrice$aData['fPrice'], $sPriceModify$_SESSION['fOrderProductsSummary'] ) : $aData['fPrice'];

maracana11

Avatar: maracana11

2012-08-15 20:05

thank you. it is all right

antonionereu

Avatar: antonionereu

2013-04-30 14:43

Hi...

Could you make this change to quickcart 6.xx???

Best regards.

about us | contact