Home › Forums › WoodMart support forum › Show variation title on variation selection
Show variation title on variation selection
- This topic has 7 replies, 2 voices, and was last updated 5 months, 1 week ago by Aizaz Imtiaz Awan.
-
AuthorPosts
-
July 6, 2024 at 9:48 am #581434
designmonoParticipantHi,
We have insterted custom variation titles that are displayed nicely on the shop page, cart & checkout.
However, the product page itself includes the main product title and doesn’t change according to the chosen variation.
Is there any possibility to make the product title change to variation title?
July 6, 2024 at 1:41 pm #581497
Aizaz Imtiaz AwanKeymasterHello,
Navigate to Theme Settings > Custom JS > Add the following code.
jQuery( document ).ready( function( $ ) { var title_text = $( '.product-type-variable .product_title' ).text(); // get default title function add_variation_txt_to_title() { var new_title_text = ''; $( '.variations select' ).each( function() { new_title_text += ' ' + $( this ).find( ':selected' ).val(); // collect all variation selected <options> }) $( '.product-type-variable .product_title' ).text( title_text + new_title_text ); // set new title } add_variation_txt_to_title(); // call on load $( '.variations select' ).change( function() { // call on <select >change add_variation_txt_to_title(); }) })
Best Regards.
July 6, 2024 at 2:57 pm #581521
designmonoParticipantWonderful, thank you for sharing the code so quickly!
This code adds an attribute slug to the title. It does not change the title to custom variation title as requested (see screenshot).
However, we can try to use your suggested solution instead. In this case it would be nice to add the attribute term name instead of the slug. Could you help with this please?
Also, could you make this code work for the quick-view popup too?
July 8, 2024 at 10:00 am #581673
Aizaz Imtiaz AwanKeymasterHello,
Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.
Best Regards.
July 8, 2024 at 10:19 am #581684
designmonoParticipantAll right!
July 8, 2024 at 2:17 pm #581746
Aizaz Imtiaz AwanKeymasterHello,
Can you please share the product page url where the variaiton swatches are showing.
Best Regards.
July 8, 2024 at 3:07 pm #581785
designmonoParticipantYou can check this product for example.
July 8, 2024 at 3:43 pm #581819
Aizaz Imtiaz AwanKeymasterHello,
Sorry, but there is no option in Theme Settings available for that.
It requires customizations and this is beyond our limitations and support policy.
Regards.
Xtemos Studios -
AuthorPosts
Tagged: variation title
- You must be logged in to create new topics. Login / Register