cancel
Showing results for 
Search instead for 
Did you mean: 

Add Buy Now button with knockout js (html template)

Add Buy Now button with knockout js (html template)

I am adding the Buy Now button in all sections.
 
I have been able to add it in almost all sections, but I have a block in one part of the home that brings the recently visited products and the front is showing with html template and ko js library.
 
I have used the github (https://github.com/mageprince/magento2-buynow) module for this implementation, but it is only there to implement it in phtml files and not html.
 

Is there a way to call the block and phtml shown in the module to the html file?

 

This is my code at path /app/design/frontend/Vendor/default/Magento_Catalog/web/template/product/list/listing.html

 

<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<div if="hasData()"
     class="block" css="additionalClasses">
    <h2 class="filterproduct-title product-catalog-widget">
        <span class="content">
            <strong role="heading"
                aria-level="2"
                text="label"/>
        </span>
        <span class="title_line"></span>
    </h2>
    <div css="'products-' + displayMode" id="products-grid" class="owl-top-narrow">
        <div class="products wrapper grid products-grid eltiempo-widget eltiempo-widget__list">
            <div class="filterproducts products list items product-items owl-carousel">
                <div class="item product product-item recently" repeat="foreach: filteredRows, item: '$row'">
                    <div class="product-item-info" data-container="product-grid">
                        <fastForEach args="data: getRegion('general-area'), as: '$col'" >
                            <render args="$col.getBody()"/>
                        </fastForEach>
                        <div class="product details product-item-details">
                            <fastForEach args="data: getRegion('details-area-name'), as: '$col'" >
                                <render args="$col.getBody()"/>
                            </fastForEach>
                            <div class="product-item-inner">
                                <div class="product actions product-item-actions product-item-recently">
                                    <fastForEach args="data: getRegion('details-area'), as: '$col'" >
                                        <render args="$col.getBody()"/>
                                    </fastForEach>
                                    <div class="actions-primary">
                                        <!--//////////////////I need the block and phtml call here!///////////////////-->
                                        <div class="button-container recently" if="getRegion('action-primary-area')().length">
                                            <fastForEach args="data: getRegion('action-primary-area'), as: '$col'" >
                                                <render args="$col.getBody()"/>
                                            </fastForEach>
                                        </div>
                                            <fastForEach args="data: getRegion('action-secondary-area'), as: '$col'" >
                                                <render args="$col.getBody()"/>
                                            </fastForEach>
                                    </div>
                                </div>
                            </div>
                            <div if="getRegion('description-area')().length"
                                    class="product-item-description">
                                <fastForEach args="data: getRegion('description-area'), as: '$col'" >
                                    <render args="$col.getBody()"/>
                                </fastForEach>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="" data-bind="afterRender: pdpRvowlInit"></div>
</div>