Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #343310

    Hi!

    I’m looking for solution to show the sharing buttons for each product page and on category pages. I have added code in the themes function.php to get sharing buttons on the common pages. I found some previously topics about this here on the forum, but when I paste that code into the file, I only get a fatal error message and have to uppload a clean functions.php file!

    Help is preciated!

    #343399

    Hi Effektid!

    Add this code at the bottom of functions.php:

    add_action('woocommerce_after_single_product_summary', 'avia_add_social_toolbar', 10, 2);
    function avia_add_social_toolbar($id = "", $context = "")
    {
    		avia_social_share_links();
    }

    And add this to the Quick CSS:

    .single-product .av-share-box {
        margin-bottom: 20px;
    }

    Regards,
    Arvish

    #343440

    Thanks for your answer, but it’s not working! I get the same fatal error message and need to replace the functions.php file with a new copy. Any other ideas?

    #344212

    Hi!

    It does work fine on my local installation. Do you mind creating a temporary admin login and posting it here privately so we can add the code for you?

    Best regards,
    Yigit

    #345176
    This reply has been marked as private.
    #345722

    Hi!

    Thank you for the info but you forgot the website url. Please replace the code with this:

    add_action('woocommerce_after_single_product_summary', 'avia_add_social_toolbar', 10);
    function avia_add_social_toolbar()
    {
    		$content  = avia_social_share_links(array(), false);
    		$content .= '<div style="height:1px; margin-top:50px;" class="hr"></div>';
    		
    		echo $content;
    	    
    }

    Best regards,
    Ismael

    #345848
    This reply has been marked as private.
    #346468

    Hello! Anyone there!?

    I found the error that caused the fatal error message when I added the code above to functions.php. I had already added a simliar code to get the sharing buttons in the bottom of the common pages. After I removed that code it worked, but now I don’t have any sharing buttons on the pages!

    Is there a way to combine these to script?

    #347012

    Hey!

    Could you forward us the link and credentials to your site so we can have a closer look.

    Cheers!
    Arvish

    #347055
    This reply has been marked as private.
    #347673

    Hey!

    You skipped our post above. Remove browser cache then check the single product page: **removed upon request**

    Best regards,
    Ismael

    • This reply was modified 10 years, 1 month ago by Yigit.
    #347685
    This reply has been marked as private.
    #348034

    Hi!

    If you want to show the share link on pages, add this at the bottom of the previous code:

    add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 10, 1);
    function avia_add_social_toolbar_template_builder($content = "")
    {
            $content .= '<div style="height:1px; margin-top:20px;" class="hr"></div>';
    	$content .= avia_social_share_links(array(), false);
    	return $content;
    }

    Regards,
    Ismael

    #348680
    This reply has been marked as private.
    #348973

    Hi!

    Links are removed. Shall we mark the thread as resolved? :)

    Cheers!
    Yigit

    #349233

    Thanks! Yes, it’s resolved!

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Buttons to share Woo Commerce products?’ is closed to new replies.