updating products

10 views
Skip to first unread message

Johannes Nel

unread,
Feb 24, 2011, 6:56:33 AM2/24/11
to magja-discuss
Hi

I realise that update of products are not supported. I was wondering what the reasoning behind this is, is it simply that time has not been found to do this or are there technichal reasons for this.
Also would product price fall under a product attribute or is it part of the product itself?

I have to implement this in the next few weeks, so a heads up on any issues would be great.

regards
Johan

--
j:pn
\\no comment

Christoph Petersen

unread,
Feb 24, 2011, 8:18:17 AM2/24/11
to magja-discuss
Hi Johannes,

On 24.02.2011 12:56, Johannes Nel wrote:
> Hi
>
> I realise that update of products are not supported. I was wondering
> what the reasoning behind this is, is it simply that time has not been
> found to do this or are there technichal reasons for this.
> Also would product price fall under a product attribute or is it part of
> the product itself?
>

If you use the version from SVN you'll have support for updating
products. I actually use it and it seems to work fine.

> I have to implement this in the next few weeks, so a heads up on any
> issues would be great.
>
> regards
> Johan

BR
Christoph

Johannes Nel

unread,
Feb 24, 2011, 8:31:11 AM2/24/11
to magja-...@googlegroups.com, Christoph Petersen
when was this commited?
as i grabbed the code about 2 weeks ago.

I saw a comment in my code which says save is not supported, but I do see the save method.

Thanks.

Christoph Petersen

unread,
Feb 24, 2011, 8:34:25 AM2/24/11
to magja-discuss


On Feb 24, 2:31 pm, Johannes Nel <johannes....@gmail.com> wrote:
> when was this commited?
> as i grabbed the code about 2 weeks ago.
>
> I saw a comment in my code which says save is not supported, but I do see
> the save method.

r309 looks like it. See http://code.google.com/p/magja/source/list.

>
> Thanks.
>

BR
Christoph

Johannes Nel

unread,
Feb 24, 2011, 1:14:20 PM2/24/11
to magja-...@googlegroups.com, Christoph Petersen
Hi

I am getting a weird error on the save

keyValue not implemented for class java.util.LinkedList


here is the code I have to reproduce it

 MagentoSoapClient magentoSoapClient = MagentoSoapClient.getInstance();
         ProductRemoteService productRemoteService = new RemoteServiceFactory().getProductRemoteService();
         productRemoteService.setSoapClient(magentoSoapClient);

         Product prod =  productRemoteService.getBySku("Product D");
         prod.qty = 676.00;
         prod.price = 999.99;
         prod.inStock = false;
        
         productRemoteService.save(prod);
        

I realise this is not related to the implementation, but I am pretty noob in java and this library (i am using jython to string it all together), so any pointers would be much appreciated.

johan

Christoph Petersen

unread,
Feb 25, 2011, 2:17:31 AM2/25/11
to magja-discuss
Hi Johannes,

>  MagentoSoapClient magentoSoapClient = MagentoSoapClient.getInstance();
>          ProductRemoteService productRemoteService = new
> RemoteServiceFactory().getProductRemoteService();
>          productRemoteService.setSoapClient(magentoSoapClient);
>
>          Product prod =  productRemoteService.getBySku("Product D");
>          prod.qty = 676.00;
>          prod.price = 999.99;
>          prod.inStock = false;
>
>          productRemoteService.save(prod);
>
> I realise this is not related to the implementation, but I am pretty noob in
> java and this library (i am using jython to string it all together), so any
> pointers would be much appreciated.
>

Ah yeah. I had that one as well. I think there is something wrong with
the assignment of categories when you retrieve a product from the
server. I'll try to bundle up a patch today.

> johan
>

BR
Christoph

Johannes Nel

unread,
Feb 25, 2011, 2:25:24 AM2/25/11
to magja-...@googlegroups.com, Christoph Petersen
Yeah, i tracked the problem down to the serializer, it looks like lists in lists are not supported.

This however made me wonder, if I do not invoke
Product prod =  productRemoteService.getBySku("Product D");

then o0bviously I have a sparesly populated product, but setting my values on it and persisting it, what gets overwritten and what does not on the otherside of the wire.
so my line of testing today would be around that.

Christoph Petersen

unread,
Feb 25, 2011, 2:29:41 AM2/25/11
to magja-discuss
Thing is that the error will come every time you use a product from
the server as during serialization two things happen:

* .set("categories") with an array of numbers
* .set("category_ids") with an ArrayList

The latter is not used somewhere to my knowledge. Don't nail me on the
exact names above as I looked into this last week. As I mentioned
earlier - I fixed this already locally but as my IntelliJ "beautifies"
all the code I need to stage the patch first before I can submit/
commit something.

Stay tuned.

Johannes Nel

unread,
Feb 25, 2011, 6:36:08 AM2/25/11
to magja-...@googlegroups.com, Christoph Petersen
Thanks for the help you have been providing thus far!
I look forward to the patch.

Christoph Petersen

unread,
Feb 24, 2011, 7:09:30 AM2/24/11
to magja-...@googlegroups.com
Hi Johannes,

On 24.02.2011 12:56, Johannes Nel wrote:

> Hi
>
> I realise that update of products are not supported. I was wondering
> what the reasoning behind this is, is it simply that time has not been
> found to do this or are there technichal reasons for this.
> Also would product price fall under a product attribute or is it part of
> the product itself?
>

If you use the version from SVN you'll have support for updating


products. I actually use it and it seems to work fine.

> I have to implement this in the next few weeks, so a heads up on any


> issues would be great.
>
> regards
> Johan

BR
Christoph

Christoph Petersen

unread,
Feb 27, 2011, 6:11:36 AM2/27/11
to magja-discuss
Seems that sending from my client produces 3 days lag :/

Johannes: Please see the email titled "[PATCH] Fix serialization
problem when trying to save products fetched from remote" for a
possible solution for your problem.

BR
Christoph
Reply all
Reply to author
Forward
0 new messages