Giter Club home page Giter Club logo

Comments (4)

gilokimu avatar gilokimu commented on September 25, 2024

Please provide the request details you made and response gotten / expected response

from woodroid.

hoba-dafidi avatar hoba-dafidi commented on September 25, 2024

Thank you for your prompt response.
This is the product i want to update
att1
att2
att3

I followed your examples

In ViewModel:
public WooLiveData updateProduct(int id, Product product) {
return productRepository.update(id, product);
}

and the ProductRepository
public WooLiveData update(int id, Product product) {
final WooLiveData callBack = new WooLiveData();

    woocommerce.ProductRepository().update(id, product).enqueue(callBack);
    return callBack;
}

This is the response:
res1
res2
res3

As you can see, the attributes are gone. When I check it on the woocommerce site, there is no attribute associated with it again but the Attributes are still listed in the Attribute page on the admin site

from woodroid.

gilokimu avatar gilokimu commented on September 25, 2024

I am not able to fix this at the moment, but I do believe the issue is because of the field productAttributes in the Product class, needs to have an attribute

@SerializedName("attributes")
lateinit var productAttributes: ArrayList<ProductAttribute>

from woodroid.

hoba-dafidi avatar hoba-dafidi commented on September 25, 2024

I finally found the solution.
The attributes in the Product object to be updated has its visible and variable properties set to false and the option property set to null.

So, I have to correct those and it worked.
Thank you for your time sir

from woodroid.

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.