get_gallery_attachment_ids() wrong value of variable products in cart page
-
I have a very weird problem here. I want to use the first product attachment gallery image as product thumbnail in cart page.
So I use below code in cart.php to get gallery attachment id:$attachment_ids = $_product->get_gallery_attachment_ids();
The weird thing is, it worked perfectly on my localhost (my test website, which woocommerce version is 2.6.8). But it couldn’t get any data of the variable products on my online website (which woocommerce version is 3.1.2). However, it could get the correct data of simple products.
The localhost website and the online website all use the same theme, I don’t know why they have different situation. I wonder is it woocommerce upgrade bug? Please help me, thanks.
p.s. I use the same method to get related product’s attachment gallery images, and it all works.
- The topic ‘get_gallery_attachment_ids() wrong value of variable products in cart page’ is closed to new replies.