WooCommerce product image dynamically – WordPress Development Stack Exchange

Question

what would be a neat way to dynamically change product pictures based on URL request? Eg. /product/item?id=2&option=1 I want to display a cat as the main product photo, and for /product/item?id=2&option=2 I want to show a dog? It has to be the same product and there’s unlimited number of options that may be generated dynamically. I’m thinking to have a custom table with product images based on option ID and then with javascript replace WooCommerce photo slider with “correct” images. Any other options? Thanks!

0
Konstantin Ilinov 2 weeks 2023-05-19T02:35:19-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse