X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Decorate XC module (https://forum.x-cart.com/showthread.php?t=76267)

tony_sologubov 06-26-2018 03:20 AM

Re: Decorate XC module
 
Quote:

Originally Posted by amarquis
For example: admin.php?target=global_tabs -> Then click on "New tab".

Here there are 2 fields with the WYSIWYG editor: "Content" and "Brief info"
"Content" field works with my changes (removed some buttons)
"Brief info" doesn't

- The "Add product" form, it doesn't work
- The "Edit category" form, it works
- For Vendors, My Account -> Company details -> Description, it works but I am quite surprised as I am pretty sure it did not work a few days/weeks ago.

Thx


Thanks for the additional details.

"Brief info" on Product tabs > New tab does not work, because it is defined by other form field class:
Code:

\XLite\Module\XC\CustomProductTabs\View\FormField\Textarea\FroalaBriefInfo

So, you want to change it as well.

As for "Add product", it does not work because its textarea is defined by the
Code:

\XLite\View\FormModel\Type\TextareaAdvancedType
class, which essentially inherits
Code:

\Symfony\Component\Form\Extension\Core\Type\TextareaType
one.

FroalaEditor module uses
Code:

\XLite\Module\XC\FroalaEditor\View\FormModel\Type\TextareaAdvancedType
class to define Froala as editor widget for this class and it sets up Froala settings via this method:

Code:

  public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            [
                'oldType' => 'XLite\Module\XC\FroalaEditor\View\FormField\Textarea\Advanced',
            ]
        );
    }


So, you should decorate
Code:

\XLite\View\FormModel\Type\TextareaAdvancedType
class and define configureOptions() method to use your class
Code:

XLite\Module\Udg\Tweaks\View\FormField\Textarea\Advanced
instead of
Code:

XLite\Module\XC\FroalaEditor\View\FormField\Textarea\Advanced

Let me know if it makes sense to you.

Tony

amarquis 07-16-2018 04:30 AM

Re: Decorate XC module
 
Thanks Tony, that worked.


All times are GMT -8. The time now is 05:54 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.