Tagged: x
-
AuthorPosts
-
October 10, 2016 at 8:51 pm #1210805
IntegratutionsParticipantDear Sir/Mdm,
Is there a way to showcase or add in some visual or functionality to showcase other color options available for my shoes on the collections page?
October 11, 2016 at 2:14 am #1211038
RupokMemberHi there,
You can add some more options that you will find on the product editor but it will be shown on the single product only. Let’s explore the other options.
Thanks!
October 11, 2016 at 10:01 am #1211553
IntegratutionsParticipantI understand that’s the current limitations. π
What are other options that can help me do that?
October 11, 2016 at 11:27 am #1211683
ThaiModeratorHi There,
To achieve that, please add the following code under functions.php file locates in your child theme:
add_action( 'woocommerce_before_shop_loop_item_title', 'print_color_options' ); function print_color_options(){ global $product; $terms = get_the_terms( get_the_ID(), 'pa_color' ); if($terms){ echo '<div class="color-options">'; foreach ($terms as $key => $term) { echo '<span class="'.$term->slug.'">' . $term->name . '</span>'; } echo '</div>'; } }Hope it helps π
October 16, 2016 at 9:21 am #1218170
IntegratutionsParticipantThank you for your reply. π
I have added these to my functions.php but i didn’t see any changes. Please advice.
October 16, 2016 at 9:49 am #1218195
ThaiModeratorHi There,
In this case, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
β Link login to your site
β WordPress Admin username / PasswordDonβt forget to select Set as a private reply. This ensures your information is only visible to our staff.
Thanks.
October 16, 2016 at 6:09 pm #1218584
IntegratutionsParticipantThis reply has been marked as private.October 16, 2016 at 10:17 pm #1218850
Rue NelModeratorHello There,
Because what you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that wonβt be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
You should place the custom code in your child theme’s functions.php file. And also, you did not set the color as the product attribute. To know more how you can properly set up a color attribute for your product, please check the documentation here: https://docs.woocommerce.com/document/variable-product/
Hope this helps.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1210805 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
