| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Where is the function getTotal() declared? | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() This question is related to another question of mine.
I see that the function getTotal() is used in many places including classes/XLite/View/Minicart.php, but the only place where I found it declared so far is classes/XLite/Module/CDev/XPaymentsConnector/Model/Order.php. I suppose I am missing something, but where?
__________________
X-cart 5.2.12, php 5.6 Ed from Grenoble, France |
|||||||
#2
|
|||||||||
|
|||||||||
![]() When re-deploying, X-Cart 5.2.x auto-generates get* and set* methods for model properties. getTotal() translates to $this->total. You won't find these methods in the classes/ directory, but you will find them in the var/run/classes directory.
However, the upcoming X-Cart 5.3 won't autogenerate these methods anymore, so module authors will have to declare them manually.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful ![]() Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#3
|
|||||||
|
|||||||
![]() Thank you very much, I went through /var/run/classes, but I couldn't find where total() was declared. It would be nice if there were a documentation in KB that deals with this kind of thing. Anyway, would anyone know where I can find the function total() is declared?
__________________
X-cart 5.2.12, php 5.6 Ed from Grenoble, France |
|||||||
#4
|
|||||||||
|
|||||||||
![]() There is no function "total". "Total" is a field in table. When the object is built XC automatically creates getTotal and setTotal functions to read/write in this field.
So if you have TableA and field in it called "total" $TableA->total; $TableA->getTotal(); $tableA->setTotal(); all work with the field "total" from table "TableA"
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#5
|
|||||||
|
|||||||
![]() Thank you very much, this is now clear.
__________________
X-cart 5.2.12, php 5.6 Ed from Grenoble, France |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|