folder Tahribat.com Forumları
linefolder Html - CSS - XML - JavaScript - Ajax
linefolder Javascript Ürün Arttırma-Fiyat Katlama Sorunu



Javascript Ürün Arttırma-Fiyat Katlama Sorunu

  1. KısayolKısayol reportŞikayet pmÖzel Mesaj
    Mutubilir
    Mutubilir's avatar
    Kayıt Tarihi: 14/Kasım/2014
    Erkek

    Hocalar iyi akşamlar. Elimde bir iş var. Bir mobilya mağazası web sitesi yapıyorum ancak bir konuda ufak bir sorunum var. 

    Ürünler paket halinde satılıyor ( 3lü koltuk+televizyon sehpası+dolap gibi)

    Her ürünün asıl fiyatı ve indirimli halleri var girilmiş durumda. 

    3lü koltuk 3000

    Televizyon sehpası 2000

    dolap 1000 iken 

    üçünü paket halinde alırsanız 5500 tl yapıyor mesela. Her ürüne belli bir % ile indirim uygulanıyor. 

    Siteye kullanan kişi 2 adet sehpa almak istiyorum diye +'ya tıkladığı zaman aşağıdaki toplam fiyat etiketi cortluyor. Script kısmını buraya ekledim. Görsel isteyen olursa site arayüzü için onu da paylaşabilirim. Sorunu nasıl aratacağımı bilemediğim için çözümü de bulamadım. Kodların çoğunu benzer bir siteden çektim yerel bir firma olduğu için işini yaptığım firma. Çok anlamıyorum yani :)

     

    <script>
    (function(n,t,i,r,u){n[r]=n[r]||[];n[r].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var e=t.getElementsByTagName(i)[0],f=t.createElement(i),o=r!="dataLayer"?"&l="+r:"";f.async=!0;f.src="https://www.googletagmanager.com/gtm.js?id="+u+o;e.parentNode.insertBefore(f,e)})(window,document,"script","dataLayer","GTM-NVL6GHP")
    </script>
    
    <script type="text/javascript">
    var ts = 1;
    
    function incBinary(){
    quantity = document.getElementById("tripleQuantity");
    quantity.value = ts;
    ts++;
    
    price = document.getElementById("triplePrice");
    
    totalPrice = document.getElementById("totalDiscountPrice");
    totalPrice.value = totalPrice.value + (quantity.value * price.value);
    }
    
    function decBinary(){
    quantity = document.getElementById("tripleQuantity");
    quantity.value = ts;
    ts--;
    
    price = document.getElementById("triplePrice");
    
    totalPrice = document.getElementById("totalDiscountPrice");
    totalPrice.value = totalPrice.value - (quantity.value * price.value);
    }
    </script>
    
    <script type="text/javascript">
    var bs = 1;
    
    function incBinary(){
    quantity = document.getElementById("binaryQauntity");
    quantity.value = bs;
    bs++;
    
    price = document.getElementById("binaryPrice");
    
    totalPrice = document.getElementById("totalDiscountPrice");
    totalPrice.value = totalPrice.value + (quantity.value * price.value);
    }
    
    function decBinary(){
    quantity = document.getElementById("binaryQauntity");
    quantity.value = bs;
    bs--;
    
    price = document.getElementById("binaryPrice");
    
    totalPrice = document.getElementById("totalDiscountPrice");
    totalPrice.value = totalPrice.value - (quantity.value * price.value);
    }
    </script>
    
    <script type="text/javascript">
    var ss = 1;
    
    function incSingle(){
    quantity = document.getElementById("singleQuantity");
    quantity.value = ss;
    ss++;
    
    price = document.getElementById("singlePrice");
    
    totalPrice = document.getElementById("totalDiscountPrice");
    totalPrice.value = totalPrice.value + (quantity.value * price.value);
    }
    
    function decSingle(){
    quantity = document.getElementById("singleQuantity");
    quantity.value = ss;
    ss--;
    
    price = document.getElementById("singlePrice");
    
    totalPrice = document.getElementById("totalDiscountPrice");
    totalPrice.value = totalPrice.value - (quantity.value * price.value);
    }
    </script>


     Şimdiden teşekkür ediyorum herkese 

     

     

    Edit. Görünümü fotoğraf linki olarak bıraktım aşağıya. Butona tıklayınca cortluyor aşağıdaki toplamların hepsi 0 oluyor 

     

    https://hizliresim.com/mBUM8t

    Mutubilir tarafından 20/May/20 04:02 tarihinde düzenlenmiştir

    Aslan bile atı görünce götünü saklar
  2. KısayolKısayol reportŞikayet pmÖzel Mesaj
    herlocksholmes
    herlocksholmes's avatar
    Kayıt Tarihi: 16/Şubat/2014
    Erkek

    resim bulunamadi diyor.


  3. KısayolKısayol reportŞikayet pmÖzel Mesaj
    TeRRoR
    TeRRoR's avatar
    Kayıt Tarihi: 06/Nisan/2007
    Erkek

    toplam fiyat nerede cortluyor baktım baktım göremedim hocam :/


    herkes programcı olmak zorunda değildir, lütfen bir zorunluluk gibi programlama dilleri öğrenmeye çalışmayın. yabancı dil filan öğrenin amq.// s.kimin etini yerim, kasaba minnet etmem.// ince düşünene kalın girer.//
  4. KısayolKısayol reportŞikayet pmÖzel Mesaj
    emirhan-exp
    emirhan-exp's avatar
    Kayıt Tarihi: 10/Ocak/2010
    Erkek
    <script type="text/javascript">
    var ts = 1;
     
    function incBinary(){
    quantity = document.getElementById("tripleQuantity");
    ts++;
    quantity.value = ts;
     
    price = document.getElementById("triplePrice");
     
    totalPrice = document.getElementById("totalDiscountPrice");
    totalPrice.value = totalPrice.value + (quantity.value * price.value);
    }
     
    function decBinary(){
    quantity = document.getElementById("tripleQuantity");
    ts--;
    quantity.value = ts;
    
     
    price = document.getElementById("triplePrice");
     
    totalPrice = document.getElementById("totalDiscountPrice");
    totalPrice.value = totalPrice.value - (quantity.value * price.value);
    }
    </script>
     
    <script type="text/javascript">
    var bs = 1;
     
    function incBinary(){
    quantity = document.getElementById("binaryQauntity");
    bs++;
    quantity.value = bs;
    
     
    price = document.getElementById("binaryPrice");
     
    totalPrice = document.getElementById("totalDiscountPrice");
    totalPrice.value = totalPrice.value + (quantity.value * price.value);
    }
     
    function decBinary(){
    quantity = document.getElementById("binaryQauntity");
    bs--;
    quantity.value = bs;
    
     
    price = document.getElementById("binaryPrice");
     
    totalPrice = document.getElementById("totalDiscountPrice");
    totalPrice.value = totalPrice.value - (quantity.value * price.value);
    }
    </script>
     
    <script type="text/javascript">
    var ss = 1;
     
    function incSingle(){
    quantity = document.getElementById("singleQuantity");
    quantity.value = ss;
    ss++;
     
    price = document.getElementById("singlePrice");
     
    totalPrice = document.getElementById("totalDiscountPrice");
    totalPrice.value = totalPrice.value + (quantity.value * price.value);
    }
     
    function decSingle(){
    quantity = document.getElementById("singleQuantity");
    ss--;
    quantity.value = ss;
    
     
    price = document.getElementById("singlePrice");
     
    totalPrice = document.getElementById("totalDiscountPrice");
    totalPrice.value = totalPrice.value - (quantity.value * price.value);
    }
    </script>

     

    dener misin hocam bi?

  5. KısayolKısayol reportŞikayet pmÖzel Mesaj
    Mutubilir
    Mutubilir's avatar
    Kayıt Tarihi: 14/Kasım/2014
    Erkek

    deneyip döneceğim hocam 


    Aslan bile atı görünce götünü saklar
Toplam Hit: 1314 Toplam Mesaj: 5
js