New Landing How can we help? Atelier Add download link under product image in single product page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Posted in: Atelier
  • #329790
    Seif
    Member
    Post count: 6

    Hello, I’m trying to integrate a download link under each products with their respective download links(which are uploaded when the product is set as downloadable). I’m aware that this system works only when you buy the product, but I would like to change it.
    So my question is; where in the files is the location for the product image for the single product page, so I could place a button underneath? I’ve looked in single-product.php, content-single-product.php, content-product.php and was not able to trace down the main image that’s zoomable. I would really appreciate it! Thank you.

    #329912
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    The product image slideshow HTML is powered by WooCommerce, not the theme. Editing the template files is the wrong method, you will want to override the functions we have in our framework using a child theme.

    You can also hook into the supplied actions seen throughout the template files with your own functions.

    Knowing this, in the file content-single-product.php you will find the action woocommerce_before_single_product_summary. This is located after the main product image.

    You can then hook into that action to add your own content via your own custom function which you would add to your child theme functions.php file.

    Thanks.

    #329913
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Check in atelier/woocommerce/loop/ those files are the responsible for the product loop in the shop page.

    -Rui

    #330973
    Seif
    Member
    Post count: 6

    Thank you very much for your replies!

    @Rui Guerreiro: I appreciate your help, however I was talking about the single product’s page.


    @David
    Martin: I appreciate your support.
    Could someone help me to find the way to get the download link of the specified product? I am trying to find my way through WordPress, and my personal method would be to execute a SQL query to fetch the download link(which I suppose is categorized as a wp_post entry). However, I know there’s a better and more secure way by using hooks and whatnot.

    Thank you in advance.

    #330974
    Seif
    Member
    Post count: 6

    I have solved my problem. This did the trick:

    			$downloads = $product->get_files();
    			$dlcount = 0;
    			foreach( $downloads as $key => $each_download ) 
    			{
    				if ($dlcount == 0) echo '<div class="title-wrap"><h3 class="spb-heading" style="text-transform: uppercase;"><span>Download</span><h3></div>';
    				echo '   <a style="margin-left: 10px;" href="'.$each_download["file"].'" target="_blank">'.$each_download["name"].'</a><br>';
    				$dlcount++;
    			}
    			if ($dlcount > 0)
    				echo '<div style="padding-bottom: 50px;"></div>';

    Thank you for your help!

    #331018
    David Martin – Support
    Moderator
    Post count: 20834

    Glad to help you out!

    If you have found the theme/support useful, we appreciate it if you can leave feedback on our item if you have the time as it really helps us out.

    Thanks,
    David

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register