<?php
/**
 * @var $row
 * @var $display_title
 * @var $img
 */

if ( $row && get_post_type( $row->pid ) == 'job' && get_post_status( $row->pid ) == 'publish' ) {

	if ( $display_title == 'yes' ) { ?>

		<h4><?php _e( "Recently Bought", "wpjobster" ); ?></h4>

	<?php } ?>

	<div class="recently-bought-wrapper">

		<div class="recently-bought-box">

			<div class="image">

				<a href="<?php echo get_post_permalink( $row->pid ); ?>">

					<img src="<?php echo $img; ?>" alt="">

				</a>

			</div>

			<h5>

				<a href="<?php echo get_post_permalink( $row->pid ); ?>">

					<?php echo $row->job_title; ?>

				</a>

			</h5>

		</div>

		<a class="ui fluid primary button" href="<?php echo get_post_permalink( $row->pid ); ?>">

			<?php _e( "Buy it again", "wpjobster" ); ?>

		</a>

	</div>

<?php } else echo '<style>.recently-bought-row-wrapper{display:none;}</style>'; // for page builder