<?php

?>
<?php
/** @var \MGS\BuyNow\Block\Product\ListProduct $block */
$product = $block->getProduct();
$buttonTitle = $block->getButtonTitle() ?: 'Buy Now';
?>
<?php if ($product->isSaleable()): ?>
    <?php $postParams = $block->getAddToCartPostParams($product); ?>
    <div class="mageprince-buynow">
        <form action="<?= $block->escapeUrl($postParams['action']); ?>"
              id="product_addtocart_form_<?= /* @noEscape */ $postParams['data']['product']; ?>"
              method="post">
            <input type="hidden"
                   name="product"
                   value="<?= /* @noEscape */ $postParams['data']['product']; ?>">
            <input type="hidden"
                   name="uenc"
                   value="<?= /* @noEscape */ $postParams['data']['uenc']; ?>">
            <?= $block->getBlockHtml('formkey') ?>
            <button type="submit"
                    title="<?= $block->escapeHtml(__($buttonTitle)) ?>"
                    class="action tocart primary mageprince-buynow-btn">
                <span><?= $block->escapeHtml(__($buttonTitle)) ?></span>
            </button>
        </form>
    </div>
<?php endif; ?>
