<?php
/**
* Template Name: Popular Products
*
*/
get_header(); ?>
<section class="Popular-title">
<div class="container">
<div class="title">
<h1>
<?php the_field('popular_title'); ?>
</h1>
</div>
<body>
<form action="https://www.altronics.com.au/search" method="get" target="_blank">
<input type="text" name="q" placeholder="Search Altronics" required style="padding: 10px; font-size: 16px; margin-right: 5px; border: 1px solid #ccc; border-radius: 4px;">
<button type="submit" style="border: none; background-color: #0c254d; color: #ffcc40; padding: 10px 20px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; border-radius: 12px;">Search</button>
</form>
</body>
</div>
</section>
<section class="popular-products">
<div class="container">
<div class="row align-items-center mb-5">
<ul>
<?php
if( have_rows('products') ):
while( have_rows('products') ) : the_row();
$image = get_sub_field('product_image');
$size = 'full';
?>
<li class="col">
<div class="product">
<a href="<?php echo the_sub_field('product_link'); ?>">
<div class="product-title">
<h3><?php echo get_sub_field('product_title'); ?></h3>
</div>
<div class="product-image">
<?php if( $image ) {
echo wp_get_attachment_image( $image, $size );
} ?>
</div>
</a>
</div>
</li>
<?php
endwhile;
endif;
?>
</ul>
<!-- <div class="col-sm-6">
<div class="product">
<a href="#">
<div class="product-title">
<h3></h3>
</div>
<div class="product-image">
<img src="<?php echo esc_url( $Catalogue['book_1']['url'] ); ?>" />
</div>
</a>
</div>
</div> -->
</div>
</div>
</section>
<?php get_footer(); ?>