3

There's a dropdown field - "Design Package/Theme" when creating a widget which allows you to select the theme the widget will be applied to. This field is not optional.

Once the widget is created, this field cannot be changed. I now want to apply the widget to a new theme but am unable to do it. Is there any way to do this via the database?

This seems very unintuitive to me, because:

  1. What happens if you want a widget to apply to multiple themes
  2. What happens when you want to change the theme the widget applies to

3 Answers 3

2

Honestly I wondered myself why the theme restriction is there.
I assume that in order to show some widget options all the layout handles of the theme need to be loaded and if you later want to change the theme, some handles may not be there anymore so your widget may not work.
For the same reason I assume you are not allowed to add the same widget instance to 2 different themes at once. But don't take this for granted. I'm jsut speculating.

but one thing is clear, you can change at your own risk the theme from the table widget_instance by changing the field package_theme.
Just make sure you remember the initial value in case you need to revert.

1
  • That makes sense! Probably not the best way to go about avoiding those problems though. Many thanks, all updated and working :) Commented May 20, 2015 at 14:42
4

Update for Marius answer when you use Magento latest version (2.1.8)

There is no column package_theme in widget_instance table anymore.

To change design of widget instance (at your own risk)

  • update theme_id column in widget_instance with your new theme id
  • in Admin panel go to the widget instance edit page and save (it updates layout_update table).
1

Run this SQL query UPDATE `layout_link` SET `theme_id` = '[SELECED_THEME_ID]' UPDATE `widget_instance` SET `theme_id` = '[SELECED_THEME_ID]'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.