mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 14:06:59 +00:00
clean the logs
This commit is contained in:
parent
59afdf371c
commit
71fd397a2c
@ -18,31 +18,15 @@ export const productVariant = ({ product, selectedOptions }) => {
|
|||||||
const optionNames =
|
const optionNames =
|
||||||
product?.options?.map(option => option?.name ?? '') ?? [];
|
product?.options?.map(option => option?.name ?? '') ?? [];
|
||||||
|
|
||||||
console.log({
|
|
||||||
product: product?.handle,
|
|
||||||
optionNames,
|
|
||||||
variants: product?.variants,
|
|
||||||
});
|
|
||||||
|
|
||||||
for (const variant of product?.variants ?? []) {
|
for (const variant of product?.variants ?? []) {
|
||||||
let matching = true;
|
let matching = true;
|
||||||
|
|
||||||
console.log({ variantTitle: variant?.title });
|
|
||||||
|
|
||||||
for (const option of variant?.selectedOptions) {
|
for (const option of variant?.selectedOptions) {
|
||||||
const optionName = option?.name ?? '';
|
const optionName = option?.name ?? '';
|
||||||
const optionValue = option?.value ?? '';
|
const optionValue = option?.value ?? '';
|
||||||
|
|
||||||
console.log({ optionName, optionValue, optionNames });
|
|
||||||
|
|
||||||
for (let i = 0; i < optionNames?.length; i++) {
|
for (let i = 0; i < optionNames?.length; i++) {
|
||||||
if (optionName == optionNames[i]) {
|
if (optionName == optionNames[i]) {
|
||||||
console.log({
|
|
||||||
optionName,
|
|
||||||
optionValue,
|
|
||||||
selectedOption: selectedOptions[i],
|
|
||||||
});
|
|
||||||
|
|
||||||
if (optionValue != selectedOptions[i]) {
|
if (optionValue != selectedOptions[i]) {
|
||||||
matching = false;
|
matching = false;
|
||||||
}
|
}
|
||||||
@ -72,8 +56,6 @@ export default function PurchaseInput({ product }) {
|
|||||||
? productVariant({ product, selectedOptions })
|
? productVariant({ product, selectedOptions })
|
||||||
: product?.variants?.[0];
|
: product?.variants?.[0];
|
||||||
|
|
||||||
console.log({ variant });
|
|
||||||
|
|
||||||
return availableForSale ? (
|
return availableForSale ? (
|
||||||
isForSale && (
|
isForSale && (
|
||||||
<>
|
<>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user