| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Adding a field to the banner slide | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Adding a field to the banner slide
I'm trying to add live text to the banner slide. I have followed the tutorial here:
http://kb.x-cart.com/display/XDD/Adding+new+property+to+a+product I've added two fields to the model: PHP Code:
So far, I created the new model, and it's updated the database correctly when I redeploy the store. But I can't seem to get the new fields to show up in the admin area. This is my view file: //BannerRotationSlide.php PHP Code:
So, first question is am I editing the correct file, BannerRotationSlide.php? If so, what am I doing wrong here?
__________________
5.2 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Adding a field to the banner slide
I have not read through your code, or looked at the files to see what the correct code is. But one thing to always check is the run directory.
Are your module directories showing up in the run directory after rebuild? Is your file showing up? Is it extending/modifying the class correctly? If not then you may have namespace or filename issues, module might not be enabled, etc. It may not be your code, you need to ensure that the basics are working first.
__________________
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. |
|||||||||
#3
|
|||||||
|
|||||||
Re: Adding a field to the banner slide
Ah, yes, the BannerRotationSlide.php file is there, but the BannerRotation.php file extending the view model is not. I will double check, but my classes look the same as the example code (with the relevant bits changed). Any ideas why that isn't getting copied over?
__________________
5.2 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Adding a field to the banner slide
You call both classes
class BannerRotationSlide That's your error
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: Adding a field to the banner slide
There is no \XLite\View\Model\BannerRotationSlide class. "View\Model\*" classes are for pages where you edit a single object. In case of banner slides there is no such a page and all slides are managed on a single page.
I believe you should look into decorating this class: \XLite\View\ItemsList\BannerRotationImages
__________________
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 |
|||||||||
#6
|
|||||||
|
|||||||
Re: Adding a field to the banner slide
None of this is working so far. To clarify, I can see the columns in the database, so decorating /Model/BannerRotationSlide.php works to create the database. It also allows me to add the following in my banner rotation body.tpl and show the results:
PHP Code:
What I can't seem to get working is to have those two extra fields show up in the admin area in Catalog/FrontPage/BannerRotation
__________________
5.2 |
|||||||
#7
|
|||||||||
|
|||||||||
Re: Adding a field to the banner slide
By decorating the \XLite\Model\BannerRotationSlide you add the custom columns to the database table. This also lets you read data from these columns in your templates.
You also tried to decorate \XLite\View\Model\BannerRotationSlide. As I said there is no such a class, that's why you code doesn't work - you modify something that doesn't exist. There would be such a class if X-Cart had a page for editing a single banner. But there is no such a page and all banners are managed on a single page. I suggest you to look into decorating this class: \XLite\View\ItemsList\BannerRotationImages. I'm not sure 100%, but I believe that this is the class that controls what fields should be shown in the table of banner slides when you edit them.
__________________
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 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|