Navigazione

    Privacy - Termini e condizioni
    © 2020 Search On Media Group S.r.l.
    • Registrati
    • Accedi
    • CATEGORIES
    • Discussioni
    • Non letti
    • Recenti
    • Hashtags
    • Popolare
    • Utenti
    • Stream
    • Interest
    • Categories
    1. Home
    2. coinfeuropea
    3. Post
    C

    coinfeuropea

    @coinfeuropea

    • Profilo
    • Chi segue 0
    • Da chi è seguito 0
    • Discussioni 1
    • Post 1
    • Migliore 0
    • Gruppi 0
    Iscrizione Ultimo Accesso
    Età 59
    0
    Reputazione
    1
    Post
    0
    Visite al profilo
    0
    Da chi è seguito
    0
    Chi segue
    User Newbie

    Post creati da coinfeuropea

    • sommare subtotali con sconto quantitá in carrello compra

      Salve a tutti.
      Dopo varie ricerche e prove, ho trovato un carrello di compra in internet che fa quello che mi serve, pero ho bisogno di utilizzare sconti per quantitá.
      Ho modificato il codice e posso vedere il subtotale con lo sconto, pero il totale rimane con i valori senza sconto perche moltiplica il prezzo per la quantità e no i subtotali.
      Colpa la mia ignoranza non riesco a sommare i subtotali.
      allego il codice.
      Un grazie a tutti per leggere questo post e per un eventuale aiuto.
      Massimo

      // totale
      $this->cart_contents['cart_total'] += ($val['price'] * $val['qty']);

      $this->cart_contents['total_items'] += $val['qty'];

      //codice modificato per sconti

      if ($val['qty']<=3) {
      $this->cart_contents[$key]['subtotal'] = ($this->cart_contents[$key]['price'] * $this->cart_contents[$key]['qty']);
      }
      if (($val['qty']>=4) && ($item['discount'] = 1)) {
      $this->cart_contents[$key]['subtotal'] = ($this->cart_contents[$key]['price'] * $this->cart_contents[$key]['qty']/1.10);
      }
      if (($val['qty']>=8) && ($item['discount'] = 1)){
      $this->cart_contents[$key]['subtotal'] = ($this->cart_contents[$key]['price'] * $this->cart_contents[$key]['qty']/1.15);
      }
      if (($val['qty']>=12) && ($item['discount'] = 1)){
      $this->cart_contents[$key]['subtotal'] = ($this->cart_contents[$key]['price'] * $this->cart_contents[$key]['qty']/1.20);
      }
      if (($val['qty']>15) && ($item['discount'] = 1)) {
      $this->cart_contents[$key]['subtotal'] = ($this->cart_contents[$key]['price'] * $this->cart_contents[$key]['qty']/1.30);
      }

      postato in Coding
      C
      coinfeuropea