| @@ -101,7 +101,7 @@ const ProductDetails = function ({ detailaccessories, backend, user, ...props }) | |||||
| product_name: detailproduct[0].name, | product_name: detailproduct[0].name, | ||||
| } | } | ||||
| setFormValue(newformValue) | setFormValue(newformValue) | ||||
| console.log(JSON.stringify(newformValue)); | |||||
| // console.log(JSON.stringify(newformValue)); | |||||
| const response = await fetch( | const response = await fetch( | ||||
| "/api/transaction/AddToCart", | "/api/transaction/AddToCart", | ||||
| { | { | ||||
| @@ -114,7 +114,7 @@ const ProductDetails = function ({ detailaccessories, backend, user, ...props }) | |||||
| ); | ); | ||||
| if (response.ok) { | if (response.ok) { | ||||
| var res = await response.json(); | var res = await response.json(); | ||||
| console.log("cek response :", res); | |||||
| // console.log("cek response :", res); | |||||
| if (res["STATUS"] === 1) { | if (res["STATUS"] === 1) { | ||||
| res["DATA"]["cart"]; | res["DATA"]["cart"]; | ||||
| swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | ||||
| @@ -181,7 +181,7 @@ const ProductDetails = function ({ detailaccessories, backend, user, ...props }) | |||||
| </div> | </div> | ||||
| <br /> */} | <br /> */} | ||||
| <button type="submit">Add to Cart</button> | |||||
| {/* <button type="submit">Add to Cart</button> */} | |||||
| <a href="#" className="add-to-wishlist-btn" title="Add to Wishlist"> | <a href="#" className="add-to-wishlist-btn" title="Add to Wishlist"> | ||||
| <Icon.Heart /> | <Icon.Heart /> | ||||
| @@ -101,7 +101,7 @@ const ProductDetails = function ({ detailapparel, backend, user, ...props }) { | |||||
| product_name: detailproduct[0].name, | product_name: detailproduct[0].name, | ||||
| } | } | ||||
| setFormValue(newformValue) | setFormValue(newformValue) | ||||
| console.log(JSON.stringify(newformValue)); | |||||
| // console.log(JSON.stringify(newformValue)); | |||||
| const response = await fetch( | const response = await fetch( | ||||
| "/api/transaction/AddToCart", | "/api/transaction/AddToCart", | ||||
| { | { | ||||
| @@ -114,7 +114,7 @@ const ProductDetails = function ({ detailapparel, backend, user, ...props }) { | |||||
| ); | ); | ||||
| if (response.ok) { | if (response.ok) { | ||||
| var res = await response.json(); | var res = await response.json(); | ||||
| console.log("cek response :", res); | |||||
| // console.log("cek response :", res); | |||||
| if (res["STATUS"] === 1) { | if (res["STATUS"] === 1) { | ||||
| res["DATA"]["cart"]; | res["DATA"]["cart"]; | ||||
| swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | ||||
| @@ -181,7 +181,7 @@ const ProductDetails = function ({ detailapparel, backend, user, ...props }) { | |||||
| </div> | </div> | ||||
| <br /> */} | <br /> */} | ||||
| <button type="submit">Add to Cart</button> | |||||
| {/* <button type="submit">Add to Cart</button> */} | |||||
| <a href="#" className="add-to-wishlist-btn" title="Add to Wishlist"> | <a href="#" className="add-to-wishlist-btn" title="Add to Wishlist"> | ||||
| <Icon.Heart /> | <Icon.Heart /> | ||||
| @@ -101,7 +101,7 @@ const ProductDetails = function ({ detailhelmet, backend, user, ...props }) { | |||||
| product_name: detailproduct[0].name, | product_name: detailproduct[0].name, | ||||
| } | } | ||||
| setFormValue(newformValue) | setFormValue(newformValue) | ||||
| console.log(JSON.stringify(newformValue)); | |||||
| // console.log(JSON.stringify(newformValue)); | |||||
| const response = await fetch( | const response = await fetch( | ||||
| "/api/transaction/AddToCart", | "/api/transaction/AddToCart", | ||||
| { | { | ||||
| @@ -114,7 +114,7 @@ const ProductDetails = function ({ detailhelmet, backend, user, ...props }) { | |||||
| ); | ); | ||||
| if (response.ok) { | if (response.ok) { | ||||
| var res = await response.json(); | var res = await response.json(); | ||||
| console.log("cek response :", res); | |||||
| // console.log("cek response :", res); | |||||
| if (res["STATUS"] === 1) { | if (res["STATUS"] === 1) { | ||||
| res["DATA"]["cart"]; | res["DATA"]["cart"]; | ||||
| swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | ||||
| @@ -181,7 +181,7 @@ const ProductDetails = function ({ detailhelmet, backend, user, ...props }) { | |||||
| </div> | </div> | ||||
| <br /> */} | <br /> */} | ||||
| <button type="submit">Add to Cart</button> | |||||
| {/* <button type="submit">Add to Cart</button> */} | |||||
| <a href="#" className="add-to-wishlist-btn" title="Add to Wishlist"> | <a href="#" className="add-to-wishlist-btn" title="Add to Wishlist"> | ||||
| <Icon.Heart /> | <Icon.Heart /> | ||||
| @@ -9,7 +9,7 @@ import NumberFormat from 'react-number-format'; | |||||
| const ProductCard = function ({ product, backend, user, ...props }) { | const ProductCard = function ({ product, backend, user, ...props }) { | ||||
| const products = useSelector((state) => state.products) | const products = useSelector((state) => state.products) | ||||
| console.log(product) | |||||
| // console.log(product) | |||||
| const Product = product.map((data) => { | const Product = product.map((data) => { | ||||
| return ( | return ( | ||||
| @@ -119,7 +119,7 @@ const ProductDetails = function ({ detailproduct, backend, user, ...props }) { | |||||
| // product_img: detailproduct[0].backend.img[0], | // product_img: detailproduct[0].backend.img[0], | ||||
| } | } | ||||
| setFormValue(newformValue) | setFormValue(newformValue) | ||||
| console.log(JSON.stringify(newformValue)); | |||||
| // console.log(JSON.stringify(newformValue)); | |||||
| const response = await fetch( | const response = await fetch( | ||||
| "/api/transaction/AddToCart", | "/api/transaction/AddToCart", | ||||
| { | { | ||||
| @@ -132,7 +132,7 @@ const ProductDetails = function ({ detailproduct, backend, user, ...props }) { | |||||
| ); | ); | ||||
| if (response.ok) { | if (response.ok) { | ||||
| var res = await response.json(); | var res = await response.json(); | ||||
| console.log("cek response :", res); | |||||
| // console.log("cek response :", res); | |||||
| if (res["STATUS"] === 1) { | if (res["STATUS"] === 1) { | ||||
| res["DATA"]["cart"]; | res["DATA"]["cart"]; | ||||
| swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | ||||
| @@ -188,7 +188,7 @@ const ProductDetails = function ({ detailproduct, backend, user, ...props }) { | |||||
| </div> | </div> | ||||
| <br /> | <br /> | ||||
| <button type="submit">Add to Cart</button> | |||||
| {/* <button type="submit">Add to Cart</button> */} | |||||
| <a href="#" className="add-to-wishlist-btn" title="Add to Wishlist"> | <a href="#" className="add-to-wishlist-btn" title="Add to Wishlist"> | ||||
| <Icon.Heart /> | <Icon.Heart /> | ||||
| @@ -14,7 +14,7 @@ import NumberFormat from 'react-number-format'; | |||||
| const ProductCard = function ({ ygp, yamalube, helmet, apparel, accessories, backend, ...props }) { | const ProductCard = function ({ ygp, yamalube, helmet, apparel, accessories, backend, ...props }) { | ||||
| const products = useSelector((state) => state.products) | const products = useSelector((state) => state.products) | ||||
| console.log(ygp) | |||||
| // console.log(ygp) | |||||
| const YGP = ygp.map((data) => { | const YGP = ygp.map((data) => { | ||||
| return ( | return ( | ||||
| @@ -101,7 +101,7 @@ const ProductDetails = function ({ detailyamalube, backend, user, ...props }) { | |||||
| product_name: detailproduct[0].name, | product_name: detailproduct[0].name, | ||||
| } | } | ||||
| setFormValue(newformValue) | setFormValue(newformValue) | ||||
| console.log(JSON.stringify(newformValue)); | |||||
| // console.log(JSON.stringify(newformValue)); | |||||
| const response = await fetch( | const response = await fetch( | ||||
| "/api/transaction/AddToCart", | "/api/transaction/AddToCart", | ||||
| { | { | ||||
| @@ -114,7 +114,7 @@ const ProductDetails = function ({ detailyamalube, backend, user, ...props }) { | |||||
| ); | ); | ||||
| if (response.ok) { | if (response.ok) { | ||||
| var res = await response.json(); | var res = await response.json(); | ||||
| console.log("cek response :", res); | |||||
| // console.log("cek response :", res); | |||||
| if (res["STATUS"] === 1) { | if (res["STATUS"] === 1) { | ||||
| res["DATA"]["cart"]; | res["DATA"]["cart"]; | ||||
| swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | ||||
| @@ -181,7 +181,7 @@ const ProductDetails = function ({ detailyamalube, backend, user, ...props }) { | |||||
| </div> | </div> | ||||
| <br /> */} | <br /> */} | ||||
| <button type="submit">Add to Cart</button> | |||||
| {/* <button type="submit">Add to Cart</button> */} | |||||
| <a href="#" className="add-to-wishlist-btn" title="Add to Wishlist"> | <a href="#" className="add-to-wishlist-btn" title="Add to Wishlist"> | ||||
| <Icon.Heart /> | <Icon.Heart /> | ||||
| @@ -36,7 +36,7 @@ const options = { | |||||
| }; | }; | ||||
| const ProductDetails = function ({ detailygp, backend, user, ...props }) { | const ProductDetails = function ({ detailygp, backend, user, ...props }) { | ||||
| console.log(detailygp); | |||||
| // console.log(detailygp); | |||||
| const [formValue, setFormValue] = React.useState({ | const [formValue, setFormValue] = React.useState({ | ||||
| product_img: "", | product_img: "", | ||||
| @@ -102,7 +102,7 @@ const ProductDetails = function ({ detailygp, backend, user, ...props }) { | |||||
| product_name: detailproduct[0].name, | product_name: detailproduct[0].name, | ||||
| } | } | ||||
| setFormValue(newformValue) | setFormValue(newformValue) | ||||
| console.log(JSON.stringify(newformValue)); | |||||
| // console.log(JSON.stringify(newformValue)); | |||||
| const response = await fetch( | const response = await fetch( | ||||
| "/api/transaction/AddToCart", | "/api/transaction/AddToCart", | ||||
| { | { | ||||
| @@ -115,7 +115,7 @@ const ProductDetails = function ({ detailygp, backend, user, ...props }) { | |||||
| ); | ); | ||||
| if (response.ok) { | if (response.ok) { | ||||
| var res = await response.json(); | var res = await response.json(); | ||||
| console.log("cek response :", res); | |||||
| // console.log("cek response :", res); | |||||
| if (res["STATUS"] === 1) { | if (res["STATUS"] === 1) { | ||||
| res["DATA"]["cart"]; | res["DATA"]["cart"]; | ||||
| swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | ||||
| @@ -182,7 +182,7 @@ const ProductDetails = function ({ detailygp, backend, user, ...props }) { | |||||
| </div> | </div> | ||||
| <br /> */} | <br /> */} | ||||
| <button type="submit">Add to Cart</button> | |||||
| {/* <button type="submit">Add to Cart</button> */} | |||||
| <a href="#" className="add-to-wishlist-btn" title="Add to Wishlist"> | <a href="#" className="add-to-wishlist-btn" title="Add to Wishlist"> | ||||
| <Icon.Heart /> | <Icon.Heart /> | ||||
| @@ -65,6 +65,8 @@ const CartContent = function ({ backend, cart_product, ...props }) { | |||||
| return uuid; | return uuid; | ||||
| } | } | ||||
| // console.log(GenerateID()); | |||||
| return ( | return ( | ||||
| <form | <form | ||||
| onSubmit={async (e) => { | onSubmit={async (e) => { | ||||
| @@ -75,7 +77,7 @@ const CartContent = function ({ backend, cart_product, ...props }) { | |||||
| product_color: cart_product[0].product_color, | product_color: cart_product[0].product_color, | ||||
| } | } | ||||
| setFormValue(newformValue) | setFormValue(newformValue) | ||||
| console.log(JSON.stringify(newformValue)); | |||||
| // console.log(JSON.stringify(newformValue)); | |||||
| const response = await fetch( | const response = await fetch( | ||||
| "/api/transaction/AddToCheckout", | "/api/transaction/AddToCheckout", | ||||
| { | { | ||||
| @@ -88,7 +90,7 @@ const CartContent = function ({ backend, cart_product, ...props }) { | |||||
| ); | ); | ||||
| if (response.ok) { | if (response.ok) { | ||||
| var res = await response.json(); | var res = await response.json(); | ||||
| console.log("cek response :", res); | |||||
| // console.log("cek response :", res); | |||||
| if (res["STATUS"] === 1) { | if (res["STATUS"] === 1) { | ||||
| res["DATA"]["checkout"]; | res["DATA"]["checkout"]; | ||||
| swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | ||||
| @@ -187,7 +189,7 @@ const CartContent = function ({ backend, cart_product, ...props }) { | |||||
| ...formValue, | ...formValue, | ||||
| product_total: e.target.value.toString(), | product_total: e.target.value.toString(), | ||||
| }) | }) | ||||
| console.log("isi target value : ", e.target.value); | |||||
| // console.log("isi target value : ", e.target.value); | |||||
| }} | }} | ||||
| /> | /> | ||||
| </span> | </span> | ||||
| @@ -60,7 +60,7 @@ const CheckoutContent = function ({ backend, checkout_product, user, provinces, | |||||
| product_price: checkout_product[0].product_total, | product_price: checkout_product[0].product_total, | ||||
| } | } | ||||
| setFormValue(newformValue) | setFormValue(newformValue) | ||||
| console.log(JSON.stringify(newformValue)); | |||||
| // console.log(JSON.stringify(newformValue)); | |||||
| const response = await fetch( | const response = await fetch( | ||||
| "/api/transaction/create", | "/api/transaction/create", | ||||
| { | { | ||||
| @@ -73,7 +73,7 @@ const CheckoutContent = function ({ backend, checkout_product, user, provinces, | |||||
| ); | ); | ||||
| if (response.ok) { | if (response.ok) { | ||||
| var res = await response.json(); | var res = await response.json(); | ||||
| console.log("cek response :", res); | |||||
| // console.log("cek response :", res); | |||||
| if (res["STATUS"] === 1) { | if (res["STATUS"] === 1) { | ||||
| res["DATA"]["transaction"]; | res["DATA"]["transaction"]; | ||||
| swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | swal("Produk Berhasil Ditambah ke Keranjang", "Silahkan Cek Keranjang Belanja Anda", "success"); | ||||
| @@ -58,7 +58,7 @@ export async function getServerSideProps(context) { | |||||
| if (res["STATUS"] === 1) { | if (res["STATUS"] === 1) { | ||||
| dealers = res["DATA"]["dealers"]; | dealers = res["DATA"]["dealers"]; | ||||
| } | } | ||||
| console.log(userObj); | |||||
| // console.log(userObj); | |||||
| return { | return { | ||||
| props: { dealers, backend, user }, // will be passed to the page component as props | props: { dealers, backend, user }, // will be passed to the page component as props | ||||