Hi
I changed the default code in this file:
with the following code:
<?php
/**
* Listing map block template with location and image.
*
* @package HivePress\Templates
*/
namespace HivePress\Templates;
use HivePress\Helpers as hp;
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
/**
* Listing map block template class with location and image.
*
* @class Listing_Map_Block
*/
class Listing_Map_Block extends Template {
/**
* Class constructor.
*
* @param array $args Template arguments.
*/
public function __construct( $args = [] ) {
$args = hp\merge_trees(
[
'blocks' => [
'listing_container' => [
'type' => 'container',
'_order' => 10,
'attributes' => [
'class' => [ 'hp-listing', 'hp-listing--map-block', 'custom-popup-width' ], // Added custom class for width
],
'blocks' => [
'listing_title' => [
'type' => 'container',
'tag' => 'h5',
'_order' => 10,
'attributes' => [
'class' => [ 'hp-listing__title' ],
],
'blocks' => [
'listing_title_text' => [
'type' => 'part',
'path' => 'listing/view/block/listing-title',
'_order' => 10,
],
'listing_verified_badge' => [
'type' => 'part',
'path' => 'listing/view/listing-verified-badge',
'_order' => 10,
],
],
],
'listing_location' => [
'type' => 'container',
'tag' => 'h5',
'_order' => 20,
'attributes' => [
'class' => [ 'hp-listing__location' ],
],
'blocks' => [
'listing_location_text' => [
'type' => 'part',
'path' => 'listing/view/listing-location',
'_order' => 20,
],
],
],
'listing_image' => [
'type' => 'container',
'tag' => 'div',
'_order' => 25, // Adjust the order as needed
'attributes' => [
'class' => [ 'hp-listing__image' ],
],
'blocks' => [
'listing_image_content' => [
'type' => 'part',
'path' => 'listing/view/block/listing-image', // Ensure this path outputs the image
'_order' => 25,
],
],
],
],
],
],
],
$args
);
parent::__construct( $args );
}
}
So now the popup shows the listing title, address, and images, the question is how do i add to this the listing price, and some attributes
Thank you so much.