예제 #1
0
파일: shopping_cart.php 프로젝트: gblok/rsc
                     //remove
                     $i = SearchConfigurationInSessionVariable($res["variants"], $res["productID"]);
                     $_SESSION["gids"][$i] = 0;
                 }
             }
         }
     }
     Redirect($cart_reguest . "&shopping_cart=yes");
 }
 if (isset($_GET["clear_cart"])) {
     //completely clear shopping cart
     cartClearCartContet();
     Redirect($cart_reguest . "&shopping_cart=yes");
 }
 $resCart = cartGetCartContent();
 $resDiscount = dscCalculateDiscount($resCart["total_price"], isset($_SESSION["log"]) ? $_SESSION["log"] : "");
 $discount_value = addUnitToPrice($resDiscount["discount_current_unit"]);
 $discount_percent = $resDiscount["discount_percent"];
 $smarty->assign("cart_content", $resCart["cart_content"]);
 $smarty->assign("cart_amount", $resCart["total_price"] - $resDiscount["discount_standart_unit"]);
 $smarty->assign('cart_min', show_price(CONF_MINIMAL_ORDER_AMOUNT));
 $smarty->assign("cart_total", show_price($resCart["total_price"] - $resDiscount["discount_standart_unit"]));
 // discount_prompt = 0 ( discount information is not shown )
 // discount_prompt = 1 ( discount information is showed simply without prompt )
 // discount_prompt = 2 ( discount information is showed with
 //                        STRING_UNREGISTERED_CUSTOMER_DISCOUNT_PROMPT )
 // discount_prompt = 3 ( discount information is showed with
 //                        STRING_UNREGISTERED_CUSTOMER_COMBINED_DISCOUNT_PROMPT )
 switch (CONF_DISCOUNT_TYPE) {
     // discount is switched off
     case 1:
예제 #2
0
function oaGetDiscountPercent($cartContent, $log)
{
    $price = oaGetClearPrice($cartContent);
    $res = dscCalculateDiscount($price, $log);
    return (double) $res["discount_percent"];
}