Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1338679

    Hello,

    On an e-commerce website I’m building for a client, we would like to use badges on product images. It works fine for the product gallery or the catalog ; but we would also like to use the product slider. But there, for some reason, the ‘woocommerce_product_thumbnails’ action (to which the badges are tied) is not called in the product slider
    Would it possible to add this possibility in what is now class-avia-product-slider ? I noticed that if I slip in the action on line 417, it works and the badges appear on the product picture in the slider. But I4m sure there is a more elegant (and viable…) way to do this…

    Thanks for the help !

    What my modification looks like (around line 417) :

    					$image = get_the_post_thumbnail( $product_id, 'square', array( 'class' => "av-catalogue-image av-cart-update-image av-catalogue-image-{$show_images}" ) );
    
    					$text  = $image;
    					do_action( 'woocommerce_product_thumbnails' );
    					$text .= '<div class="av-catalogue-item-inner">';
    					$text .=	'<div class="av-catalogue-title-container">';
    					$text .=		"<div class='av-catalogue-title av-cart-update-title'>{$title}</div>";
    					$text .=		"<div class='av-catalogue-price av-cart-update-price'>{$price}</div>";
    					$text .=	'</div>';
    					$text .=	"<div class='av-catalogue-content'>{$content}</div>";
    					$text .= '</div>';
    #1338811

    Hey JaimBateman,

    Thank you for the inquiry.

    The solution above seems to be sufficient enough, but we will forward this thread to our channel for further consideration. Please keep the modifications for now.

    If you would like to temporarily add the modification in your child theme and override the original file, please check this documentation.

    // https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb

    Best regards,
    Ismael

    #1338897

    Hi Ismael,

    Thanks for your answer. Before I start fiddling with stuff, I would just like to confirm that the function to allow the use of customized templates for the shortcodes also works for the shortcode helpers. The modified file (class-avia-product-slider.php) is located in the avia-shortcode-helpers folder, not the avia-shortcode folder ; won’t I need to adjust the function or to create a special sub-folder ?

    Cheers, and thanks again !

    #1339259

    Hi,

    the avia-shortcode-helpers folder, not the avia-shortcode folder ; won’t I need to adjust the function or to create a special sub-folder ?

    You can create a copy of the masonry helper file inside the child theme’s shortcodes folder. The theme will be able to recognize any shortcodes in that path.

    In the next path, we will add an action hook called avf_product_slider_html_list_before_item in the same file. You can use that to insert anything after the catalogue content.

    $text  = $image;
    					$text .= '<div class="av-catalogue-item-inner">';
    					$text .=	'<div class="av-catalogue-title-container">';
    					$text .=		"<div class='av-catalogue-title av-cart-update-title'>{$title}</div>";
    					$text .=		"<div class='av-catalogue-price av-cart-update-price'>{$price}</div>";
    					$text .=	'</div>';
    					$text .=	"<div class='av-catalogue-content'>{$content}</div>";
    					$text .= '</div>';
    
    					/**
    					 * Allows to call e.g.
    					 *		do_action( 'woocommerce_product_thumbnails' );
    					 * 
    					 * @since x.x.x
    					 * @param array $this->config
    					 * @param aviaShortcodeTemplate $this->sc_context
    					 */
    					do_action( 'avf_product_slider_html_list_before_item', $this->config, $this->sc_context );
    

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.