Home › Forums › WooCommerce Personalized Product Options Manager (PPOM) › Image dropdown: hide image but show title
- This topic has 5 replies, 2 voices, and was last updated 3 years, 9 months ago by RA.
-
AuthorPosts
-
November 24, 2020 at 10:20 pm #20809Y PBlocked
Hello,
I am using PPOM with the image dropdown module and I would like to hide the images but still show the title of the options. I have tried the following code that I found on this forum but it hides both the image and the title:// hide image dropdown on cart add_filter('ppom_meta_data_field', 'ppom_disable_dropdown_image_on_cart', 99, 99); function ppom_disable_dropdown_image_on_cart($meta_data, $key, $field_meta, $product_id) { // ppom_pa($meta_data); if( $field_meta['type'] == 'imageselect' ) { $image_id = $meta_data['value']; $image_option = PPOM_IMAGESELECT()->get_image_option_by_image_id($image_id, $field_meta); $image_title = isset($image_option['title']) ? stripslashes($image_option['title']) : ''; $meta_data['display'] = $image_title; } // ppom_pa($meta_data); return $meta_data; }
How can I hide the image only ?
Thanks in advance for your help 🙂
November 24, 2020 at 10:27 pm #20811RAParticipantWouldn’t a regular “select” drop down be exactly what you are looking for?
Why use the image dropdown if you are going to remove the images? That seems counter-intuitive.
If you are trying to hide a single image in the drop down list then you could easily use CSS to hide the image.
November 24, 2020 at 10:32 pm #20812Y PBlockedNo, because I would like to show the images on the dropdown on the product page but not in the cart as it is not very useful and takes too much space.
November 25, 2020 at 12:55 am #20813RAParticipantJust use CSS to shrink them down or hide them. Also, be sure to apply the same CSS rules on the final checkout page, thank you page and admin / customer email receipts.
Cart CSS example:
tr.cart_item td.product-name ul.variation li span img.img-thumbnail{ display: none !important; }
For the emails you would have to edit the email style template if you are using HTML-formatted email templates.
November 25, 2020 at 10:28 am #20816Y PBlockedThank you for your reply.
I tried your code but it didn’t work for me.
However, I manage to add some CSS globally that works both for the cart page and the cart widget in the sidebar:/* Hide images from PPOM variation in cart */ .variation .img-thumbnail{ display: none !important; }
November 25, 2020 at 3:33 pm #20826RAParticipantSorry the code didn’t work for you. At least you’re going in the right direction now.
Don’t forgot to apply the same method to the outgoing emails.
Good luck!
-
AuthorPosts
- You must be logged in to reply to this topic.