This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fetch('/saveInDB/livraison', { | |
| credentials: 'include', | |
| method: 'post', | |
| body: JSON.stringify(values), | |
| headers: new Headers({'Content-Type': 'application/json'}) | |
| }) | |
| .then(res => res.json()) | |
| .then(res => { | |
| if (res.error) { | |
| console.log(res.error); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const makeTransaction = (amount, nonceFromTheClient) => { | |
| gateway.transaction.sale({ | |
| amount: amount, | |
| paymentMethodNonce: nonceFromTheClient, | |
| options: { | |
| submitForSettlement: true | |
| } | |
| }, function(err, result) { | |
| if (result.success) { | |
| logger.info('[Braintree] Nouvelle transaction: %s', result.transaction.id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, {Component} from 'react'; | |
| class AddProduct extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| cart: [""], | |
| prix: '', | |
| nom: '', | |
| qte: 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get montantHorsFdp() { | |
| if (panier.listeProduits.length > 0) { | |
| return panier.listeProduits.reduce((sum, i) => ( | |
| sum += i.qte * i.prix | |
| ), 0); | |
| } else { | |
| return 0 | |
| } | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, {Component} from 'react'; | |
| import shopStore, {panier, panierOperations} from '../Store/shopStore'; | |
| import {view} from 'react-easy-state'; | |
| import client from '../Store/client'; | |
| class Cart extends Component { | |
| render() { | |
| return (<div className="cart box_light1 center fullsize"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, {Component} from 'react'; | |
| import shopStore, {panier, panierOperations} from '../Store/shopStore'; | |
| import {view} from 'react-easy-state'; | |
| import client from '../Store/client'; | |
| class Cart extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const upsert = (table, sessid, data, returned) => { | |
| return knex.select('*').groupBy(returned) | |
| .from(table) | |
| .where({ | |
| userid: sessid | |
| }) | |
| .count() | |
| .then((count) => { | |
| if (count == 0) { | |
| return knex(table) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cart: | |
| { id: 776, | |
| pid: '10', | |
| userid: 'FA19EE7sBK6QlJ9pjTBUB6Wu4QlLGvZ9', | |
| quantite: '1', | |
| reduction: '0', | |
| sous_total: '85', | |
| montanttotal: 832, | |
| fdp: 45, | |
| prix: 85, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const saveProduct = panier.listeProduits.map((p, i) => { | |
| const data = { | |
| pid: p.id, | |
| cartid: panier.cartid, | |
| nom: p.nom, | |
| quantite: p.qte, | |
| prix: p.prix, | |
| reduction: panier.reduction, | |
| sous_total: p.qte * p.prix, | |
| fdp: panier.fdp, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, {useState} from 'react'; | |
| import {SketchPicker} from 'react-color'; | |
| import Canvas3D from './Canvas3D'; | |
| import contreplaque from './contreplaque.jpg'; | |
| import okoume from './okoume.jpg'; | |
| import '../styles/App.scss'; | |
| const formeInit = { | |
| rangee: 7, | |
| epaisseur: 0.003, |