Change Price of Catalog Item using Catalog Client Script

santoshsahoonis
Kilo Guru

Hello,

I need to change the price in the cart using catalog client script.
I am using a text box to enter a value in it, and this value gets added to the price in the cart.

Just let me know how to set the price using catalog client script.

Thanks,
santosh

13 REPLIES 13

MoustafaEid
Kilo Explorer

Santosh,
Can you elaborate more on how the text box you have on the item affects the pricing? The "Singe Line Text" variable type doesn't seem to have a "Pricing Implication" option, and I'm curious on how are you doing it.

I am trying to find a way to set the pricing programmatically myself. I've dug around the client-side JS script and I found out that, when a variable selection changes that has a pricing implication, an AJAX call is made to recalculate the price of the item using the calcPrice method in the CatalogPriceCalculator script include. The method iterates over all variable selections for the item and adds up the prices and returns it.

If any one knows a way to change the price of the item, and have it carry over to the checkout page, that would be much appreciated!


You have to use a workaround here, if you want to play with the price feild in the shopping cart.
Use settimeout javascript function to pause for a sec and then use DOM to get the price from the catalog.

Below the Price, you can add another feild "total Price" and control what is being displayed there.

if you don't understand the above, comment me and I will elaborate more.


Hi Santosh,

Can you elaborate about this, it's exactly the issue I have.

I have a Generic Item and if I selected it, I want to ask user to give custom price in textbox area.

Thanks,


I am also stuck with this. I have created two variables lease start and lease end to declare the lease interval.



I want to control the price in shopping cart on the basis of duration selected.



For eg: The default price is 500 for two weeks, if the duration exceeds 2 weeks then the price should increase by 250 per week.



Regards,


Sachin