My aim is to modify the prices of all products in Konakart according to the customer who is looking at them. So I wrote a little pricemanipulation-class with only one important method that consumes the sessionId of the user, an isntance of the kkCustomEngine, an originalProductPrice and the quantity of the product thats price is going to geht manipulated.
To make my modifications happen to all prices everywhere in Konakart I edited some API-calls like GetAllProducts or GetAllSpecials as in the code above. Nearly everything works fine apart from the prices shown in the "Whats new" and the "Specials" panel. At the moment my pricemodification method only looks if there is an sessionId and then sets the price to 1111.11 € if there is one, 9999.99 € otherwise.
As you can see in the Picture that I have added to one of my previous posts most of the prices get modified right if the user is logged in (set to 1111.11 €), but in the "Whats new" and the "Specials" panel my method seems not to be able to find a sessionId, so the price is set to 9999.99 €. I cant understand why, because the sessionId that is passed to GetAllProducts/GetAllSpecials (according to my tests those two are the API-Calls that return the productIf-Objects for "Whats new" and "Specials") should be the same as in every other API-Call. Do you have an idea what mistakes I am making? Or is it maybe a Bug (what I don't believe)?
Another Problem is, that I want to save which Products prices I have already modified, so I thought it would be suggestive to save this information in the session-object, but how can I get Access to it from an API-Call? Because from my knowledge about http and stuff a HttpServletRequest-object is needed to retrieve the session-object. Maybe you have an idea how to get the session or how I could save some user-dependend information for a while.
I am thankfull for all answers you can give me!