Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #650468

    Hi Support,

    I would like to add the ‘Show Details’ button on the overview page back. At the moment, the shop overview page only shows the ‘Visit the storet’ button. I have this in affiliate mode and would like back the button, please?

    Thanks
    Vincent

    #651191

    Hey Vincent,

    Thank you for using Enfold.

    Could you please provide a link to the page? How did you set the shop to affiliate mode?

    Best regards,
    Ismael

    #651415

    Hi Ismael,

    Hee is a link to the page (In private area).

    Thanks
    Vincent

    #652442

    Hi,

    I see. I totally forget about that type. Please add this in the functions.php file:

    add_action('after_setup_theme', 'ava_product_mod', 50);
    function ava_product_mod() {
    	remove_action( 'woocommerce_after_shop_loop_item', 'avia_add_cart_button', 16);
    	add_action( 'woocommerce_after_shop_loop_item', 'avia_add_cart_button_mod', 16);
    }
    
    function avia_add_cart_button_mod()
    {
    	global $product, $avia_config;
    
    	if ($product->product_type == 'bundle' ){
    		$product = new WC_Product_Bundle($product->id);
    	}
    
    	$extraClass  = "";
    
    	ob_start();
    	woocommerce_template_loop_add_to_cart();
    	$output = ob_get_clean();
    
    	if(!empty($output))
    	{
    		$pos = strpos($output, ">");
    
    		if ($pos !== false) {
    		    $output = substr_replace($output,"><span ".av_icon_string('cart')."></span> ", $pos , strlen(1));
    		}
    	}
    
    	if($product->product_type == 'variable' && empty($output))
    	{
    		$output = '<a class="add_to_cart_button button product_type_variable" href="'.get_permalink($product->id).'"><span '.av_icon_string("details").'></span> '.__("Select options","avia_framework").'</a>';
    	}
    
    	if(in_array($product->product_type, array('subscription', 'simple', 'bundle', 'external')))
    	{
    		$output .= '<a class="button show_details_button" href="'.get_permalink($product->id).'"><span '.av_icon_string("details").'></span>  '.__("Show Details","avia_framework").'</a>';
    	}
    	else
    	{
    		$extraClass  = "single_button";
    	}
    
    	if(empty($extraClass)) $output .= " <span class='button-mini-delimiter'></span>";
    
    	if($output && !post_password_required() && '' == avia_get_option('product_layout',''))
    	{
    		echo "<div class='avia_cart_buttons $extraClass'>$output</div>";
    	}
    }
    

    Best regards,
    Ismael

    #652624

    Thanks, Ismael, that looks nice :) and I appreciate your help.

    All solved now.

    Vincent

    #653833

    Hi,

    glad we could help. Let us know in a new ticket if you have some more questions related to the theme. We are happy to assist you.

    Best regards,
    Andy

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Add Back 'Show Details' Button in Affiliate Mode’ is closed to new replies.