Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Decorate XC module

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #11  
Old 06-26-2018, 03:20 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default 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
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #12  
Old 07-16-2018, 04:30 AM
 
amarquis amarquis is offline
 

Advanced Member
  
Join Date: Apr 2018
Posts: 70
 

Default Re: Decorate XC module

Thanks Tony, that worked.
__________________
5.3.5.8
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:46 AM.

   

 
X-Cart forums © 2001-2020