Giter Site home page Giter Site logo

Comments (9)

portercol avatar portercol commented on May 18, 2024 1

That fix above did not work for me as the customer data was not sent.

from project_e_commerce.

ashrithyvs avatar ashrithyvs commented on May 18, 2024

I'm having the same issue

from project_e_commerce.

rajmahil avatar rajmahil commented on May 18, 2024

Getting the same issue

from project_e_commerce.

ARNAV-GHATE avatar ARNAV-GHATE commented on May 18, 2024

@andrewnashed have u got any solution for it

from project_e_commerce.

ARNAV-GHATE avatar ARNAV-GHATE commented on May 18, 2024

Please feel free to post if u get any solution

from project_e_commerce.

andrewnashed avatar andrewnashed commented on May 18, 2024

@ARNAV-GHATE this solution worked for me

function sanitizedLineItems(lineItems) {
return lineItems.reduce((data, lineItem) => {
const item = data;
let variantData = null;
if (lineItem.selected_options.length) {
variantData = {
[lineItem.selected_options[0].group_id]: lineItem.selected_options[0].option_id,
};
}
item[lineItem.id] = {
quantity: lineItem.quantity,
variants: variantData,
...data
};

  return item;
  
  }, {});
};

and then you would use the function in the orderData
like so

    `line_items: sanitizedLineItems(checkoutToken.live.line_items)`

from project_e_commerce.

ARNAV-GHATE avatar ARNAV-GHATE commented on May 18, 2024

@ARNAV-GHATE this solution worked for me

function sanitizedLineItems(lineItems) { return lineItems.reduce((data, lineItem) => { const item = data; let variantData = null; if (lineItem.selected_options.length) { variantData = { [lineItem.selected_options[0].group_id]: lineItem.selected_options[0].option_id, }; } item[lineItem.id] = { quantity: lineItem.quantity, variants: variantData, ...data };

  return item;
  
  }, {});
};

and then you would use the function in the orderData like so

    `line_items: sanitizedLineItems(checkoutToken.live.line_items)`

where we have to use this code in which component??? not able to get u?

from project_e_commerce.

andrewnashed avatar andrewnashed commented on May 18, 2024

@ARNAV-GHATE this solution worked for me
function sanitizedLineItems(lineItems) { return lineItems.reduce((data, lineItem) => { const item = data; let variantData = null; if (lineItem.selected_options.length) { variantData = { [lineItem.selected_options[0].group_id]: lineItem.selected_options[0].option_id, }; } item[lineItem.id] = { quantity: lineItem.quantity, variants: variantData, ...data };

  return item;
  
  }, {});
};

and then you would use the function in the orderData like so

    `line_items: sanitizedLineItems(checkoutToken.live.line_items)`

where we have to use this code in which component??? not able to get u?

inside the payment form

from project_e_commerce.

eramadani3 avatar eramadani3 commented on May 18, 2024

Im getting a memory leak when it says error invalid data, anyone know why? Its in the address form

from project_e_commerce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.