How to change price of catalog item via catalog client script?

Zod
Giga Guru

Hi Experts,

I have a generic catalog item with 2 variables. Deepening on those I need to call a script include to calculate the price? 

Looked quite straight forward to do that via a catalog client script ... on change of one field - calling the script include and getting the price calculated ... 

But somehow I struggle. At least setting the price ..

To get started - how to just set the price of the catalog item via Client script. Let's say on each change of variable "variable= I'd like to set the price to $10.00 .. .

Should just be "g_form.setValue('price', '10.00');" in the client script ... no???

 

 

 

4 REPLIES 4

Brian Lancaster
Tera Sage

What type of variables are they.  Unless they are text fields you should be able to adjust the price right from the variables themselves.

Zod
Giga Guru

the 2 variables are a reference to a CI and the other one to a sys_choice entry ... 

Problem is not the calculation ... problem is that did not figure out yet how to the value at all so that the price is updated in the seriveportal before requesting it ... 

 

Why does "g_form.setValue('price', '10.00')," not work in the catalog client script?

How to access the price field to set the new value?

 

I'm not sure.  I think it may be that once you are in the item view when ordering an item it is not displaying as a standard field anymore.  The price field on item is just to set the initial price when you are in the catalog.  When you create your choices you should be able to set the addition cost.  I don't think you can do this from a reference.

Choice:
find_real_file.png

using the choices does not let me call the script include - no I can't do the calculation.

Need to manipulate client script ...