ASTRA_Ext_WooCommerce_Markup::next_product_preview_image_insertion( string $output, string $format, string $link, object $post, string $adjacent )

Insert Post thumbnail into anchor.


Description

Type – Next.


Parameters

$output

(string) (Required) The adjacent post link.

$format

(string) (Required) Link anchor format.

$link

(string) (Required) Link permalink format.

$post

(object) (Required) WP_Post - The adjacent post.

$adjacent

(string) (Required) Whether the post is previous or next.


Return

(string) HTML markup.


Source

File: addons/woocommerce/classes/class-astra-ext-woocommerce-markup.php

		public function next_product_preview_image_insertion( $output, $format, $link, $post, $adjacent ) {
			if ( $post && $post->ID ) {
				$product       = wc_get_product( $post->ID );
				$image_size    = apply_filters( 'astra_product_navigation_image_size', array( 100, 100 ) );
				$image_markup  = '<div class="ast-navigation-product-preview" data-direction="next"><div class="ast-navigation-wrapper">' . get_the_post_thumbnail( $post->ID, $image_size );
				$image_markup .= '<div class="ast-navigation-content"><div class="ast-navigation-product-title">' . get_the_title( $post->ID ) . '</div><div class="ast-navigation-price">' . wp_kses_post( $product->get_price_html() ) . '</div></div></div></div></a>';
				$output        = str_replace( '</a>', $image_markup, $output );
			}
			return $output;
		}

Changelog

Changelog
Version Description
3.9.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.