Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

110
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda