<?php
/**@var \Magetop\Advancepreview\Block\Adminhtml\Product\Edit\PreviewAdditionalTab $block */
//echo get_class($block);
$productId = $block->getRequest()->getParam('id',0);
$urls = $block->getAjaxUrl();
$saveUrl = $urls['save_url'];
$itemsUrl = $urls['item_url'];
$editUrl = $urls['edit_url'];
$dellUrl = $urls['dell_url'];

?>
<?php if($productId > 0) : ?>
    <input type="hidden" id="txt-preview-additional-save-url" value="<?php echo $saveUrl; ?>">
    <input type="hidden" id="txt-preview-additional-items-url" value="<?php echo $itemsUrl; ?>">
    <input type="hidden" id="txt-preview-additional-edit-url" value="<?php echo $editUrl; ?>">
    <input type="hidden" id="txt-preview-additional-dell-url" value="<?php echo $dellUrl; ?>">
    <input type="hidden" id="txt-product-additional-id" value="<?php echo $productId; ?>">

<button type="button" id="btn-add-product-additional-preview"><?php echo __('Add Item') ?></button>
    <div id="product-additional-review-message"></div>
<div style="text-align: center; margin-top: 10px; font-size: 1.8em;"><?php echo __('Additional Options Lists') ?></div>
<div id="preview-product-additional-lists-content">

</div>
<div id="preview-product-additional-form-content" style="display: none">

</div>

<script>
    require([
        'jquery',
        'preview_additional_form'
    ],function ($, previewAdditionalForm) {
        previewAdditionalForm.init();
    })
</script>
<?php else: ?>
<p><?php echo __('Please create product before configuring Preview Discount') ?></p>
<?php endif; ?>
