<?php 
	use Magento\Framework\App\Action\Action;
	
	$viewMode = 'grid';
	$image = 'category_page_grid';
	$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
	$_product = $this->getLoadProduct($this->getProductId());
	$_productNameStripped = $block->stripTags($_product->getName(), null, true);
	$productImage = $block->getImage($_product, $image);
	$_helper = $this->helper('Magento\Catalog\Helper\Output');
	$builderHelper = $this->helper('MGS\Fbuilder\Helper\Data');
	$hideName = $this->getBlockData('hide_name');
	$hideReview = $this->getBlockData('hide_review');
	$hidePrice = $this->getBlockData('hide_price');
	$hideAddCart = $this->getBlockData('hide_addcart');
	$hideAddWishlist = $this->getBlockData('hide_addwishlist');
	$hideAddCompare = $this->getBlockData('hide_addcompare');
	
	$htmlStructure = $builderHelper->getStoreConfig('fbuilder/html_structure/product_grid');
?>
<div class="product-item-info" data-container="product-grid">
	<div class="item-inner">
		<div class="box-image">
			<a href="<?= /* @escapeNotVerified */ $_product->getProductUrl() ?>" class="product photo product-item-photo" tabindex="-1">
				<?php echo $productImage->toHtml() ?>
			</a>
		</div>
		
		<div class="product details product-item-details box-info">
			<?php if($hideName!=1): ?>
				<h2 class="product name product-item-name product-name">
					<a class="product-item-link"
					   href="<?php echo $_product->getProductUrl() ?>">
						<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>
					</a>
				</h2>
			<?php endif ?>
			<?php if($hideReview!=1): ?>
				<?php echo $block->getReviewsSummaryHtml($_product, $templateType) ?>
			<?php endif ?>
			
			<?php if($hidePrice!=1): ?>
				<?php echo $block->getProductPrice($_product) ?>
			<?php endif ?>
			
			<?php echo $this->getLayout()->createBlock('Magento\Swatches\Block\Product\Renderer\Listing\Configurable')->setProduct($_product)->setTemplate('Magento_Swatches::product/listing/renderer.phtml')->toHtml() ?>
			
			<?php //echo $block->getProductDetailsHtml($_product) ?>
			
			<?php if(($hideAddCart!=1) || ($hideAddWishlist!=1) ||($hideAddCompare!=1)): ?>
				<div class="bottom-action">
				
					<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && ($hideAddWishlist!=1)): ?>
						<a href="#" class="action towishlist btn-action link-wishlist" title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>" aria-label="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>" data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($block->getProduct()) ?>' data-action="add-to-wishlist" role="button">
							<span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
						</a>
					<?php endif ?>
					
					<?php if($hideAddCart!=1 && $_product->isSaleable()): ?>
						<?php $postParams = $block->getAddToCartPostParams($_product); ?>
						<form data-role="tocart-form" data-product-sku="<?=  /* @NoEscape */ $_product->getSku() ?>" action="<?= /* @NoEscape */ $postParams['action'] ?>" method="post">
							<input type="hidden" name="product" value="<?= /* @escapeNotVerified */ $postParams['data']['product'] ?>">
							<input type="hidden" name="<?= /* @escapeNotVerified */ Action::PARAM_NAME_URL_ENCODED ?>" value="<?= /* @escapeNotVerified */ $postParams['data'][Action::PARAM_NAME_URL_ENCODED] ?>">
							<?= $block->getBlockHtml('formkey') ?>
							<button type="submit" title="<?= $block->escapeHtml(__('Add to Cart')) ?>" class="action tocart primary btn-action btn-cart">
								<span><?= /* @escapeNotVerified */ __('Add to Cart') ?></span>
							</button>
						</form>
					<?php endif ?>
					
					<?php if($hideAddCompare!=1): ?>
						<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare'); ?>
						<a href="#" class="action tocompare btn-action link-compare" title="<?= $block->escapeHtml(__('Add to Compare')) ?>" aria-label="<?= $block->escapeHtml(__('Add to Compare')) ?>" data-post='<?= /* @escapeNotVerified */ $compareHelper->getPostDataParams($_product) ?>' role="button">
							<span><?= /* @escapeNotVerified */ __('Add to Compare') ?></span>
						</a>
					<?php endif ?>
				</div>
			<?php endif ?>
		</div>
	</div>
	
	
</div>