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