Home Forums WoodMart support forum Change Product Title when one of the Variations is picked

Change Product Title when one of the Variations is picked

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #549472

    djordjejeremicmad
    Participant

    Hey,

    I want Product Title to change when the individual Variation is being selected. I treat variations as individual products already, however, i want Product Title to change as well.

    #549603

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    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.

    #549605

    djordjejeremicmad
    Participant

    Thanks!
    You can close this one.

    #549647

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Most Welcome!!!.

    I’m so happy to hear you are pleased with the Theme and Support. XTEMOS strives to deliver the best customer experience, and it makes our day to hear we have accomplished that.

    We count ourselves lucky to have you as a customer. You can always reach us at any time. We are always here to help you.

    Thanks for contacting us.
    Have a great day.

    Topic Closed.
    Best Regards.

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

The topic ‘Change Product Title when one of the Variations is picked’ is closed to new replies.