mirror of
https://github.com/vercel/commerce.git
synced 2025-05-14 21:47:51 +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 =
|
||||
product?.options?.map(option => option?.name ?? '') ?? [];
|
||||
|
||||
console.log({
|
||||
product: product?.handle,
|
||||
optionNames,
|
||||
variants: product?.variants,
|
||||
});
|
||||
|
||||
for (const variant of product?.variants ?? []) {
|
||||
let matching = true;
|
||||
|
||||
console.log({ variantTitle: variant?.title });
|
||||
|
||||
for (const option of variant?.selectedOptions) {
|
||||
const optionName = option?.name ?? '';
|
||||
const optionValue = option?.value ?? '';
|
||||
|
||||
console.log({ optionName, optionValue, optionNames });
|
||||
|
||||
for (let i = 0; i < optionNames?.length; i++) {
|
||||
if (optionName == optionNames[i]) {
|
||||
console.log({
|
||||
optionName,
|
||||
optionValue,
|
||||
selectedOption: selectedOptions[i],
|
||||
});
|
||||
|
||||
if (optionValue != selectedOptions[i]) {
|
||||
matching = false;
|
||||
}
|
||||
@ -72,8 +56,6 @@ export default function PurchaseInput({ product }) {
|
||||
? productVariant({ product, selectedOptions })
|
||||
: product?.variants?.[0];
|
||||
|
||||
console.log({ variant });
|
||||
|
||||
return availableForSale ? (
|
||||
isForSale && (
|
||||
<>
|
||||
|
Loading…
x
Reference in New Issue
Block a user