| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Webinar for X-Cart 5 developers on March,18th. | ||||
|
|
Thread Tools |
#41
|
|||||||||
|
|||||||||
Re: Webinar for X-Cart 5 developers on March,18th.
Happy to hear that you solved the problem with translation.
You fix basically meant that News model is now extends an abstract model that allows translation (i18n) and as soon as you create the NewsTranslation model, X-Cart 5 automatically creates the utility columns like id, so you only need to specify meaningful part: what field types to use for title and body columns. As for your question about why use AEntity at all, many models does not need translations. Classic example is Inventory. There is simply nothing to translate, so using AEntity here saves your time because you do not need InventoryTranslation class. Also, you do not create excessive tables in your database. You can check XLite/Model folder for more examples of models that created based on AEntity. Finally, I am pretty happy that you are asking questions and I am even more happy to help you learn X-Cart 5 through your questions. I am sorry, I cannot reply straight away, because of big amount of work at the moment, but I will do my best to answer on forums as quick as possible, so please keep asking with no hesitation : ) Tony. Quote:
|
|||||||||
#42
|
|||||||||
|
|||||||||
Re: Webinar for X-Cart 5 developers on March,18th.
Tony,
First let me say thank you, it is very encouraging having your help during this process. I am developing a new module, for a drop down menu system. This module is only affecting the admin side at the moment. I have a root level menu, with sub-menu items. Similar to categories and subcategories but less complicated. I need to know how to query the database, and retrieve the name of the root level category based on its id. Simple, I know! Here is a brief video outlining the challenge: http://youtu.be/fUN8WpSHnE4 Module is attached, I renamed the tar file to zip so it would upload. Thanks in advance Tony, I hope to hear from you soon.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#43
|
|||||||||
|
|||||||||
Re: Webinar for X-Cart 5 developers on March,18th.
Tony,
I have made some progress on this issue, I edited XLite\Module\Baby\DropDown\Controller\Admin and added this code: Code:
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#44
|
|||||||||
|
|||||||||
Re: Webinar for X-Cart 5 developers on March,18th.
Hi Mike!
Sorry for being silent for a while. 1) The following test script will show you how you can get the category name by ID: PHP Code:
This code must be put into PHP script in the root folder of X-Cart 5. You can see the whole process here. We are pulling a category object from repository and then calling getName() out of it to get name. You can call methods get<PROPERTY NAME> to any property of the object like getId(), getBody() and so on. These getters are added automatically during cache rebuild process and you do not have to create them manually. 2) If you define the method that returns the category object in the controller and call it getDropDownObject, then you can output its name in your template as: {getDropDownObject.name} or {getDropDownObject.getName()} if you want to call as a method of this object or {getDropDownObject.getName():h} if you want to allow HTML tags. Please, let me know if it helps. Tony. Quote:
|
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|