Coding for Joomla/HikaShop Coupons
$2-30 USD / hour
Website with Joomla platform/HikaShop Cart that needs functionality added:
Please look at this file:
/www/administrator/components/com_hikashop/classes/[url removed, login to view]
on lines 1238 - 1262, function it's called addCoupon - that function makes the discounts to all the price
The task is to write there a bit code to get db products and compare what product may have the coupon:
## Deliverables
function addCoupon(&$prices,&$discount){
$config =& hikashop::config();
$discount_before_tax = $config->get('discount_before_tax');
$dcount=0;
foreach($prices->prices as $k => $price){
$dcount=$dcount+1;
//echo "Luis price".$dcount;
//var_dump($prices);
$prices->prices[$k]->price_value_without_discount_with_tax = $price->price_value_with_tax;
if(bccomp($discount->discount_flat_amount,0,5)!==0){
//echo "bccomp";
$prices->prices[$k]->price_value_with_tax=$price->price_value_with_tax-floatval($discount->discount_flat_amount);
}else{
$round = $this->getRounding(@$prices->prices[$k]->price_currency_id);
$prices->prices[$k]->price_value_with_tax=round(($price->price_value_with_tax *(100.0-floatval($discount->discount_percent_amount)))/100.0,$round);
if(isset($price->price_orig_value_with_tax)){
$prices->prices[$k]->price_orig_value_without_discount_with_tax=$price->price_orig_value_with_tax;
$prices->prices[$k]->price_orig_value_with_tax=round(($price->price_orig_value_with_tax *(100.0-floatval($discount->discount_percent_amount)))/100.0,$round);
}
}
$discount->discount_value = $prices->prices[$k]->price_value_without_discount_with_tax-$prices->prices[$k]->price_value_with_tax;
$prices->prices[$k]->price_value_without_discount=$price->price_value;
$prices->prices[$k]->price_value=$price->price_value-$discount->discount_value;
* * *This broadcast message was sent to all bidders on Wed. Jun 15, 2011 10:31:31 AM:
Launch Group changed the ExpertRating requirements on this project from:
SQL Test
MySQL 5.0 Test
Advanced PHP Test
PHP Programming Skills Test
To:
Advanced PHP Test
Project ID: #3379712