• 10-03-2018, 18:29:21
    #1
    aşağıdaki xml de fiyata %8 eklemek yardımcı olurmusunuz
    teşekkürrler

    if(mysql_num_rows(mysql_query($categorySql)) > 0){
    $categoryPrint = mysql_fetch_object(mysql_query($categorySql));
    $categoryID = $categoryPrint->category_id;
    echo 'kategori var -- ';
    }else{
    $query = mysql_query("INSERT INTO `oc_category`
    (`column`,`status`,`date_added`,`date_modified`) VALUES
    ('1','1','$date_added','$date_added')");
    $categoryID = mysql_insert_id();
    $query = mysql_query("INSERT INTO oc_category_description (`category_id`,`language_id`,`name`,`meta_title`) VALUES ('$categoryID','3','$kategoriAdi','$kategoriAdi')" );
    $query = mysql_query("INSERT INTO oc_category_path (`category_id`,`path_id`) VALUES ('$categoryID','$categoryID')");
    $query = mysql_query("INSERT INTO oc_category_to_layout (`category_id`) VALUES ('$categoryID')");
    $query = mysql_query("INSERT INTO oc_category_to_store (`category_id`,`store_id`) VALUES ('$categoryID','0')");
    if(!$query){
    echo mysql_error();
    }
    }

    if($UrunStokDurum == "Stokta Değil"){
    $stok = 0;
    }else{
    $stok = 20;
    }
    $productSql = "SELECT model,product_id FROM oc_product WHERE model = '$UrunKodu' ";
    if(mysql_num_rows(mysql_query($productSql)) > 0){ // update
    $productPrint = mysql_Fetch_object(mysql_query($productSql));
    $query = mysql_query("UPDATE oc_product SET quantity = '$stok',price='$PerakendeSatisFiyat' WHERE product_id = '{$productPrint->product_id}'");
    $query = mysql_query("UPDATE oc_product_description SET name='$UrunAdi',description='$UrunAciklama',meta_t itle='$UrunAdi' WHERE product_id = '{$productPrint->product_id}' ");
    if($query){
    echo 'Bu Ürün zaten var GÜNCELLENDİ! <br>';
    }else{
    echo '<font style="color:red;">Bu Ürün zaten var GÜNCELLENEMEDİ !</font> <br>';
    }
    }else{ // insert
    $rand = rand(999,99999999999999).'-'.time().'.jpg';
    $dizin = 'catalog/bt_product/'.$rand;
    $copy = copy($UrunBuyukResim,'../image/'.$dizin);
    $date_available = date("Y-m-d");
    $query = mysql_query("INSERT INTO oc_product
    (image,model,quantity,stock_status_id,shipping,pri ce,date_available,weight_class_id,length_class_id, subtract,minimum,sort_order,status,date_added) VALUES
    ('$dizin','$UrunKodu','$stok','6','1','$PerakendeS atisFiyat','$date_available','1','1','1','1','1',' 1','$date_added')");
    $urunID = mysql_insert_id();
    $query = mysql_query("INSERT INTO oc_product_description
    (product_id,language_id,name,description,meta_titl e) VALUES
    ('$urunID','3','$UrunAdi','$UrunAciklama','$UrunAd i') ");
    $query = mysql_query("INSERT INTO oc_product_to_layout (product_id) VALUES ('$urunID') ");
    $query = mysql_query("INSERT INTO oc_product_to_category (product_id,category_id) VALUES ('$urunID','$categoryID')");
    $query = mysql_query("INSERT INTO oc_product_to_store (product_id,store_id) VALUES ('$urunID','0')");
    if($query){
    echo 'Ürün Eklendi !<br>';
    }else{
    echo 'Bir hata meydana geldi! <br>';
    }
    }
    // if($x == 8){ break; }
    }
    ?>
  • 10-03-2018, 18:48:51
    #2
    kod içersinde

    $PerakendeS atisFiyat değişkenini bul

    onu baska bir değişkene ata orneyin:
    $a = number_format(($PerakendeS atisFiyat*(1.08)), 2,'.','');
    sonra $PerakendeS atisFiyat yazan yere $a yaz

    iyi çalışmalar