Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
How to use BigCommerce utils.api.productAttributes.optionChange

How to use utils.api.productAttributes.optionChange on a React functional component and also when you don't have access to $form.serialize()

I tried to manually create a formData like this but it does not work.

  const addOption = () => {
    const formData = new FormData();
    formData.append("action", "add");
    formData.append("product_id", "459");
    formData.append("optionValue", "12213");
    formData.append("attribute", "25331");

    console.log(formData);

    utils.api.productAttributes.optionChange(
      459,
      formData,
      (err, response) => {
        const attributesData = response.data || {};

        console.log("err: ", err);
        console.log("res: ", response);

        // I just copied this from the documentation but where do I get these methods?
        this.updateProductAttributes(attributesData); 
        this.updateView(attributesData); 
      }
    );
  };  

I'm getting these errors though the response status code is 200, and my formData is just empty.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!