1

My steps:

  1. Copy magento-2-directory/magento/vendor/magento/module-catalog-widget/view/frontend/templates/product/widget/content/**grid.phtml** to magento-2-directory/app/design/frontend/Agestor/default/Magento_CatalogWidget/templates/product/widget/content/**grid.phtml** Directory
  2. Create requirejs-config.js to magento-2-directory/app/design/frontend/Agestor/default. requirejs-config.js
  3. Widjet not work and I have errors in consol.Widjet Errors
1
  • Guys, any tips please. Not cool, when use widgets without carousel.
    – Sylon
    Feb 11, 2017 at 13:01

2 Answers 2

2

You have to just create requirejs-config.js at below location with code,

magento-2-directory/app/design/frontend/Agestor/default/Magento_CatalogWidget/requirejs-config.js

/**
 *  This is used for slider
 */
var config = {
    paths: {            
            'owlcarousel': "js/owl.carousel.min"
        },   
    shim: {
        'owlcarousel': {
            deps: ['jquery']
        }
    }
};

Run php bin/magento setup:static-content:deploy command and remove cache.

7
  • Thank you! But I have connection this js with theme. I have same requirejs-config.js in magento-2-directory/app/design/frontend/Agestor/default.
    – Sylon
    Jan 19, 2017 at 9:57
  • you can create file inside above locatino and you can use in your template. Jan 19, 2017 at 9:58
  • On foto you can see path for requirejs-config.js. This file works with my theme.
    – Sylon
    Jan 19, 2017 at 10:01
  • You can change just content of your requirejs file at your theme file and chekc Jan 19, 2017 at 10:02
  • But you write same code, what do I use to connect owl.carousel.min.
    – Sylon
    Jan 19, 2017 at 10:07
1
<referenceContainer name="content">
        <block class="Vender\modulename\Block\Product" name="Custome.product" before="-" template="vender_module::product/custom-list.phtml" cacheable="false">
            <block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="custome.top" as="addto">
                <block class="Magento\Wishlist\Block\Catalog\Product\ProductList\Item\AddTo\Wishlist"
                           name="custome.top" as="wishlist" before="compare"
                           template="Magento_Wishlist::catalog/product/list/addto/wishlist.phtml"/>    
                <block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
                           name="custome.comapre.top" as="compare"
                           template="Magento_Catalog::product/list/addto/compare.phtml"/>
            </block>
            <block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers.top" as="details.renderers">
                <block class="Magento\Framework\View\Element\Template" as="default"/>
                <block class="Magento\Swatches\Block\Product\Renderer\Listing\Configurable" as="configurable" template="Magento_Swatches::product/listing/renderer.phtml">

                </block>
            </block> 
        </block>
        </block>
</referenceContainer>


Vender\modulename\Block\Produc extend \Magento\Catalog\Block\Product\ListProduct

and use magento/  module-catalog/view/frontend/templates/product list.phtml 

<script type="text/javascript">
    require(['jquery','slickslider'], function (jQuery) {
            jQuery(document).ready(function () {
                jQuery('.basic-regular').not('.slick-initialized').slick({
                    infinite: false,
                    slidesToShow: 4 ,
                    slidesToScroll: 2 
                });
        });
    </script>
4
  • Thanks! But this not answer. You try use slickslider with widget on Magento 2?
    – Sylon
    Jan 19, 2017 at 10:48
  • Without widget i did that using phtml file. see screeshot awesomescreenshot.com/0a3686bkdd Jan 20, 2017 at 9:39
  • Can you write instruction in answer please?
    – Sylon
    Jan 20, 2017 at 10:09
  • mail me on [email protected], i will send you full code package. you can use list.phtml html code into your custom template. Jan 20, 2017 at 10:16

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.