Questions tagged [widget]
Denotes questions regarding Magento Widget
281
questions
1
vote
3
answers
151
views
Load widgets in specific position on category list page - Magento2.4
We would like to create widgets with layout updates and load these widgets in a specific place on the category list page.
So we would like to create a widget from admin, load a CMS static block and ...
1
vote
0
answers
19
views
Render link attribute in custom page builder content type
Lets assume a custom page builder content type with a text attribute representing a link
In master.html I'm already retrieving the following attributes
<!--master.html-->
<<div attr="...
0
votes
0
answers
22
views
remove same product from two widget
In our magento 2 store.
We have 3 sections
Featured Products
Trending Products
Top Picks
in this section the products are showing, but problem is product can have all these 3 attributes selected.
i ...
0
votes
1
answer
38
views
custom widget to retrive price
I am new to this Magento platform.
I want to create a custom widget to retrieve the price so that I can use it just by calling the widget on the front page.
May anyone help me?
0
votes
0
answers
32
views
Widget using "display on anchor categroy" not working on magento 2
This is driving me nuts, i'm trying to show a static block on the right sidebar of each product based on the category they are in. But it won't show anything on the frontend !
When i use the "...
1
vote
1
answer
30
views
Use widget to add dynamic text inside the short description tab based on text attribut of product?
I'm looking to have dynamic text that changes based on the store view and the product for seo reason. Below i've used a simple exemple of a dynamic country name :
1 - On the attribut configuration ...
0
votes
0
answers
24
views
How to load widget data from a specific category?
I am an absolute beginner of Magento.
Created a new page via Content -> Pages. On that page, I want to show the recent 10 T-shirts from the tees category. Therefore I included a widget but I can ...
0
votes
1
answer
46
views
Get parent category url in Catalog Widget template
I have a cms page that I am using to display products via CatalogWidget template. I would like to modify the template to have the title of the category link to the category page, but I have been ...
0
votes
0
answers
124
views
Magento2 Static Block Widget Renders As Raw Code Instead Of HTML
I have a CMS-created page where I used the "Insert Widget" option to insert a static block into the textarea field, which ended up as:
{{widget type="Magento\Cms\Block\Widget\Block"...
0
votes
1
answer
180
views
Magento 2.4 - Prevent widget from loading on mobile
We have an instagram widget on our site.
Perfect for desktops - but very negative for the pagespeed score on mobile.
So I would like to prevent it from loading on mobile.
Not hide it with {display:...
0
votes
3
answers
226
views
Can't Insert Product List Widget
I have a Magento ver. 2.4.3-p1.
When I try to insert the "catalog product list" widget on a CMS page with the below code:
<p>{{widget type="Magento\CatalogWidget\Block\Product\...
0
votes
1
answer
22
views
Can a widget extend a class besdides Template?
All widgets I have ever created programmatically extends Template implements BlockInterface and I was curious if you can extend different classes for a widget module's block?
1
vote
1
answer
557
views
Recently Viewed Widget - override - Magento 2.4.5
i want recently viewed widget to display bestsellers if there is no recently view products. I tried to create my own recently viewed widget, but all answers and examples use deprecated class:
Magento\...
0
votes
1
answer
95
views
Translate "Add to Cart" button on Recently Viewed widget
I think "Add to Cart" button recently viewed is hard coded.
Can anyone confirm this?
I did find a guide about changing the words in app/design/frontend/VendorName/ThemeName/...
1
vote
1
answer
39
views
home page widget - product weird padding on hover
I have the widget in my home page
{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" title="" show_pager="0"
products_count="6" template="...
1
vote
1
answer
488
views
Magento 2 mixins stopped working
I want to create a mixin on a third party module (MageWorx OptionFeatures)
This is what i have now.
app/code/MyCompany/MyModule/view/base/requirejs-config.js
var config = {
config: {
...
1
vote
0
answers
94
views
How to override New Products template from magento directory?
In Magento2 I need to show the "New Products" section in the homepage.
Already did that, from admin I've created a widget and assign to it New Products Grid Template, as you can see down ...
1
vote
2
answers
649
views
<depends> doesn't work as expected in widget.xml in Magento 2
So I'm trying to create dependent field, that would appear if the respective drop-down value will be chosen. My widget.xml looks like this:
<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
0
votes
1
answer
540
views
Magento 2 how add product select to the widget xml?
I want to add a sku product selection to the widget, but I can't find how to do it
Please tell me how can this be done
2
votes
0
answers
85
views
How do I retrieve data from Conditions
I have a problem. I created a widget where inside <parameters> I have a field with conditions.
<parameter name="products" xsi:type="conditions" visible="true" ...
0
votes
1
answer
198
views
Best way to call JS widget only on specific page
I have created a Javascript widget which does some function based on product add/remove cart action.
I would like to include the JS only on product pages viz: Category and Product detail page.I know a ...
0
votes
1
answer
852
views
How to get product collection by Widget's Encoded Conditions in Magento 2.3.5
I have a widget with conditions_encoded (including Multiple Category Ids, Multiple SKUs) in one section of the admin panel.
The requirement is to show the product list with custom pagination, custom ...
1
vote
2
answers
1k
views
Add dynamic rows (No UI Component) block, into the custom widget
I need to add dynamic rows into the custom-made-widget, without uiComponent.
I have a system.xml with the block:
<section id="general" type="text">
<group id="...
0
votes
1
answer
340
views
Magento 2 Add CAPTCHA to login form in createblock
I am building a widget to allow the Login form to display on a CMS page. I am able to get the form to display, but when I try to login, I am redirected to the customer/account page and get the error &...
0
votes
2
answers
285
views
Load Products by SKU Using Dependency Injection
I am building a custom widget that I want to display specific products based on the product SKU. I have tried a few different code examples to get products using the dependency injection method, but ...
1
vote
0
answers
507
views
Magento 2 - Custom Widget Wysiwyg Editor allow html tags
I try to add a wysiwyg editor to my custom widget.
I added the field to my widget.xml
<parameter name="content" xsi:type="block" required="false" visible=&...
0
votes
0
answers
179
views
Datepicker in custom widget Magento 2.3.4
Is there any chance to create a field in custom widget with datepicker?
I have a field that means end of sale and now I can type there text in spcific format only. I want to have there a datepicker (...
0
votes
1
answer
246
views
How can I get all widget_instances of a widget type from the database?
I created a new widget type named "lorem_widget" and also a few widgets instances of them, which are persisted in widget_instances.
Now I want to get all of these widgets out of the database ...
0
votes
1
answer
1k
views
How to override Magento_CatalogWidget::product/widget/content/grid.phtml widget template in custom Module?
I want to override grid.phtml in custome module without using preference.I have tried this link but it does not work for me.
widget.xml
<?xml version="1.0" encoding="UTF-8"?&...
0
votes
1
answer
395
views
Auto close modal widget after 5 seconds
I created a modal widget that appears after adding product to cart, it works perfectly .Now I need to close the modal after 5 seconds.please help!
1
vote
1
answer
233
views
How do I load custom CSS for a widget only when the widget is used?
I have a custom widget for the product page (catalog product view). How can I load the custom CSS file into the head only when the Widget is actually placed on the page?
I am looking for a best ...
0
votes
2
answers
559
views
Show Widget in the Html
I have an html file for checkout where I want to show the widget which is coming from the database . Instead of displaying the widget it shows widget code. I have attached screenshot of the same. ...
0
votes
1
answer
439
views
Add additional information to product list item in widget
I was able to add some additional information to the products in the category and the search-result page with a plugin.
Unfortunately it doesn't work for the widgets (product list widgets, related ...
1
vote
0
answers
343
views
How to access widget configuration options in Block class?
Although there's a similar question asked, it doesn't have an answer as the comment there refers to a question which has a comment that shows how to access the admin panel configuration parameters in ...
2
votes
0
answers
340
views
Magento 2 How to create checkbox field in widget
I have a custom widget in which I need to create the checkbox field in one of my widget. I am using parameter type as block
Below is my code
1 . widget.xml file
<widget class="Sandesh\...
0
votes
0
answers
265
views
Wysiwyg widget escaping character
I've created a widget with a wysiwyg inside it (with the class from this module Dmatthew\WidgetParameters\Block\Adminhtml\Widget\Type\Wysiwyg)
BUT
When I'm adding my content, with the strong, ...
0
votes
0
answers
30
views
magento 2 append widget
<reference name="content">
<block type="cms/widget_page_link" name="48fc761f38fa9838fcc3a3b498c47f72" template="cms/widget/link/link_block.phtml"&...
0
votes
2
answers
202
views
Magento 2: Not able to delete second layout in widget
Magento 2.4
Admin > Content > widget
After creating a new widget I have added two layouts.
When I had tried to delete the second layout then the delete button is not worked.
https://drive....
0
votes
2
answers
523
views
How to override module-catalog/Block/Widget/Link.php in magento 2
I need to change functionality of getHref() method. So I Created several below files in my code folder.
1.<vendor>\Catalog\Block\Widget\Link\Link.php
<?php
namespace Tea\Catalog\Block\Widget;
...
1
vote
2
answers
1k
views
How do I place a widget in a custom page layout?
I've created multiple custom pages like a contact page and FAQ page but both the pages and the containers I've labeled don't show up in the widget panel.
What's the right way to add widgets to your ...
1
vote
1
answer
274
views
Issue With Displaying Gallery Widget
I am trying to add images product gallery to my custom widget using Fotorama.
What it should look like:
So I tried to initialize the gallery widget using the js script. Based on the info I got from ...
0
votes
1
answer
572
views
How to use fotorama in my custom widget?
I want to display my product image gallery in my custom widget.
$images = $_item->getMediaGalleryImages(); is how I got my images for product.
I want to display the image using fotorama? is this ...
0
votes
1
answer
690
views
How to add View Model to a Custom Widget?
I am extending ProductList widget and I want to call a View Model from another module testing\ProductFeatures\ViewModel in my own custom template.
I have tried researching on how to use the View Model ...
1
vote
0
answers
146
views
Magento 2 Sort order on catalogue widget
I have a working widget that shows the products but how can I get the products to be sorted by the name. I have researched and a-lot of options show how to add a button that will sort the products but ...
0
votes
1
answer
38
views
How to filter products as per custom attribute value in Magento 2
I am trying to sort products as per the custom attribute value "new_sort_by" but unfortunately I could not filter. please check my code
Create a product attribute "new_sort_by"
...
0
votes
2
answers
101
views
WishlistCollection keeps returning 0 products
I'm trying to make a widget using the wishlist to show whether you've added the current product to the wishlist already or not. I've seen some other threads with answers and I can safely say I tried ...
0
votes
1
answer
324
views
How use preference for core widget block class?
How override core block class for core Catalog Category Link widget?
I try:
<preference for="Magento\Catalog\Block\Widget\Link"
type="Vendor\ModuleName\Rewrites\Block\...
1
vote
0
answers
132
views
Can i use UI-select component in a widget?
I'm attempting to use the UI-select component for the Category in a widget. I haven't had any luck finding a resource that shows it is possible. My question is if i can use UI-select component as ...
0
votes
1
answer
568
views
Magento 2 How to extend Recently Viewed Products widget
I want to extend Recently Viewed Products widget so I can add review attribute.
After creating this file: Vendor/MyModule/view/frontend/ui_component/widget_recently_viewed.xml:
<listing xmlns:xsi=&...
1
vote
0
answers
87
views
How can you have multiple dependences for a single parameter in a widget.xml file?
Like many things with Magento widgets, this should be simple but clearly isn't.
How can I use the same depends logic but for multiple parameter values?
so
<depends>
<parameter name="...