Home Forums WoodMart support forum Show variation title on variation selection

Show variation title on variation selection

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #581434

    designmono
    Participant

    Hi,

    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?

    #581497

    Hello,

    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.

    #581521

    designmono
    Participant

    Wonderful, 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?

    #581673

    Hello,

    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.

    #581684

    designmono
    Participant

    All right!

    #581746

    Hello,

    Can you please share the product page url where the variaiton swatches are showing.

    Best Regards.

    #581785

    designmono
    Participant

    You can check this product for example.

    #581819

    Hello,

    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

Viewing 8 posts - 1 through 8 (of 8 total)