Adding custom button for "download product images" to the PDP Impulse Theme

Burky
New Member
23 0 0

Hi, I would like to add a button for download product images on the PDP for Impulse theme. Is it possible? When I am adding it css doesn't work on the button and also Javascript. How can I make it possible? 

Shopify user
Replies 6 (6)

theycallmemakka
Shopify Partner
1337 296 328

Hi @Burky ,

 

Can you let me know which image should be downloaded when the button is clicked?

Buy me a Coffee


Enjoy Shopify for $1. Sign up now


For quick response - Message Me


Ping me at: theycallmemakka@gmail.com

Burky
New Member
23 0 0

Hello Makka 🙂 

Current product images.

Shopify user
theycallmemakka
Shopify Partner
1337 296 328

Also can you provide a screenshot of where you want the button to be?

 

Buy me a Coffee


Enjoy Shopify for $1. Sign up now


For quick response - Message Me


Ping me at: theycallmemakka@gmail.com

Burky
New Member
23 0 0

I have added already to the Dawn theme. right under descriptions. Same place if possible 

 

 

Screenshot 2024-03-26 at 16.05.37.png

Shopify user
theycallmemakka
Shopify Partner
1337 296 328

can you provide link to the store? I will provide code for your theme once i review it

Buy me a Coffee


Enjoy Shopify for $1. Sign up now


For quick response - Message Me


Ping me at: theycallmemakka@gmail.com

theycallmemakka
Shopify Partner
1337 296 328

Hi @Burky ,

The following code should download the product image. However, as i do not know the exact selector of the button, I could not provide the complete code. 

 

If you can provide me URL to the product page, i will provide the complete code for the store.

 

<script>
var imageUrl = document.querySelector('.product__thumbs a[data-product-thumb]').getAttribute('href');
var downloadLink = document.createElement('a');
downloadLink.href = imageUrl;
downloadLink.download = 'image.jpg';
downloadLink.click();
downloadLink.remove();

</script>

 

If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

 

Best Regards,
Makka

Buy me a Coffee


Enjoy Shopify for $1. Sign up now


For quick response - Message Me


Ping me at: theycallmemakka@gmail.com