• Welcome to KonaKart Community Forum. Please login or sign up.
 

Save a different price in the order

Started by David, November 28, 2007, 06:10:47 pm

Previous topic - Next topic

David

Hi again,

as I say other times, I am integrating KonaKart with an external ERP. The prices I show on the web are not the same prices that are on KonaKart database, I get them in real time from my application.

Now I'm working on the orders and I wonder if it's possible to save my special price on the database.

I tried it on OrderIntegrationMgr.java, with the methods of setFinalPriceExTax and setPrice of the OrderProductIf, but it doesn't work.

Regards

David

Brian

Hi David,

I think that the best thing for you to do is to edit CheckoutConfirmationSubmitAction.java . It is called checkoutOrder and hasn't been saved yet at this point.

Regards,

Brian

David

Thanks for your answer Briani, it works perfect

One day i'll have to send a cake to all konakart's team for all this help  ;)

David

Another question related to this

In CheckoutConfirmationSubmitAction.java I get the orderProducts from the checkoutOrder. I tried to change them the price, but I couldn't. I tried it with setFinalPriceExTax, setFinalPriceIncTax and setPrice...

Should I do this from another java action class??


Regards

David

julie

Hi David,

Both the the price and finalPriceExTax should be saved in the DB if you modify them before saving the order. The price is saved in the products_price attribute and the finalPriceExTax is divided by the quantity and saved in the final_price attribute. The difference between the two is that the products_price is the price of a single product without tax or options and the final_price  is the price of  a single product without tax but with options.

Regards,

Julie

Anni

hi,

are there any convenience methods for saving the prices to the database? I only found saveOrder(), but nothing for the prices or products themselves.

regards,
anni

pete

You need to use the Admin engine to edit products. Please look at http://www.konakart.com/apiexamplesfaq.php for examples of how to use the Admin API.

Anni

thanks for the answer. but I don't have the admin api available when changing the action classes ... they are only available for the admin app.

pete

It's really just a case of including the right jars. However, this begs the question, why do you want to allow a customer to change the price of products ? Surely they'd make them all free  :)

Anni

hi,

of course, I don't want to allow the customer to change the price  ::)! however, I need to adjust it for specific products before checkout, or before the checkout is completed. the pricing system of the company, for which I'm setting the shop up, is quite complicated. so I see no other way but to code this price adjustment in.

but never mind that. which jars do I have to include? all three konakartadmin(_whatever).jar or just one of them?

regards,
anni

pete

That means that you don't want to change the prices of the products in the database then, just on the order before saving it. To do this you need to edit the OrderProducts within the order similar to what David did.

Anni

that's why I was posting in this thread  ;) but julie mentioned that the changed prices have to be saved to the database before the order is saved. and I'm still not really sure how to do that (since I can't find a method which does this...)

pete

What she meant is that when the order is saved, these attributes will also be saved.

Anni

but it doesn't work!  :( my problem is the same as david's. I changed the price for the products but it doesn't have any effect on orders made in the shop. because of this I thought, I have to save the prices myself...  :-\

pete

What did you do exactly ? Did you loop through the OrderProducts of the order and change the price attribute and the finalPriceExTax attribute of the OrderProducts and then save the order ? Did you look in the database for the values that were saved ?