|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
kyros Smarty n00b
Joined: 21 Jul 2015 Posts: 3
|
Posted: Tue Jul 21, 2015 11:39 am Post subject: How to calculate smarty values |
|
|
Hello,
I am programming in cs-cart (version 4.2.4) and I would like to change the price of a product according to some insert values of the client. Specifically, I have two inputs (for the client):
<label for="mikos">Μήκος χαλιού<input type="text" size="20" id="mikos" /></label>
<label for="platos">Πλάτος χαλιού<input type="text" size="20" id="platos" onchange="return func()" /></label>
in the third input with some code of javascript I change the value of it.
<input type="text" name="price_metro" id="price_metro" />
Until now everything is fine. Now, I have the variable that has the price of the product I have inserted from the CP which is this variable:
{$smarty.capture.$price nofilter} *if I echo this variable without nofilter, I get the whole html code..<span>....* So, I leave this as is.
My question is, how to add the value of the input type "price_metro" to {$smarty.capture.$price nofilter}
I am new in smarty template engine. Any help would be appreciated. thanks |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Jul 21, 2015 4:01 pm Post subject: |
|
|
Smarty is a temlate engine for PHP. It runs on server and knows nothing about HTML or JavaScript. |
|
Back to top |
|
kyros Smarty n00b
Joined: 21 Jul 2015 Posts: 3
|
Posted: Fri Jul 24, 2015 2:05 pm Post subject: |
|
|
Hello there,
sorry for the delay.. Maybe I explained my question wrong. I am doing my math via javascript and if I "alert" the final value I see the right one. Now, I am trying to pass this final value, so I can send this price to the server... There is no way to do that?
something like: {assign va="final" value="my_value"}
i am trying to find out the variable that cs-cart uses to send the price..
Moreover, I can not enable the debugger of cs-cart although I read some tuts.. Thanks for your respond anyway!!!! |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
|
Back to top |
|
kyros Smarty n00b
Joined: 21 Jul 2015 Posts: 3
|
Posted: Fri Jul 31, 2015 10:14 am Post subject: |
|
|
Hello,
sorry but, what's that link? I can not follow it.. It turns to the same page |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Jul 31, 2015 2:10 pm Post subject: |
|
|
That's because you're unable to read the answer first time it given. I linked it to you again instead of retyping anew. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|