Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

How to calculate smarty values

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
kyros
Smarty n00b


Joined: 21 Jul 2015
Posts: 3

PostPosted: Tue Jul 21, 2015 11:39 am    Post subject: How to calculate smarty values Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1183

PostPosted: Tue Jul 21, 2015 4:01 pm    Post subject: Reply with quote

Smarty is a temlate engine for PHP. It runs on server and knows nothing about HTML or JavaScript.
Back to top
View user's profile Send private message
kyros
Smarty n00b


Joined: 21 Jul 2015
Posts: 3

PostPosted: Fri Jul 24, 2015 2:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1183

PostPosted: Sat Jul 25, 2015 12:33 am    Post subject: Reply with quote

http://www.smarty.net/forums/viewtopic.php?p=89098#89098
Back to top
View user's profile Send private message
kyros
Smarty n00b


Joined: 21 Jul 2015
Posts: 3

PostPosted: Fri Jul 31, 2015 10:14 am    Post subject: Reply with quote

Hello,

sorry but, what's that link? I can not follow it.. It turns to the same page
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1183

PostPosted: Fri Jul 31, 2015 2:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP