Change link in popup - by sventertain - on WordPress WooCommerce support

This topic has 8 replies, 2 voices, and was last updated 10 years, 4 months ago ago by Jack Richardson

  • Avatar: sventertain
    sventertain
    Participant
    August 11, 2015 at 13:22

    Hello outthere,

    i would like to change the link destination of “Continue shopping” to the main shop-page in the popup when add a product to the cart?

    Is that possible?

    Thanks!
    Sven

    7 Answers
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    August 11, 2015 at 15:27

    Hello,

    You can change that link in wp-content/themes/royal/etheme.js (line 1392), find the code:
    href: 'javascript:void(0);', and replace javascript:void(0); with your shop link, for example it will look like this href: 'http://site.com/shop',.

    Best regards,
    Jack Richardson.

    Avatar: sventertain
    sventertain
    Participant
    August 11, 2015 at 23:24

    Thanks, thats what i’ve done. Found it in /royal/js/etheme.js. Works!
    What about Theme-Updates? Is it possible to put the JS in the child-theme folder somehow?
    My first try to put it in royal-child/js/ doesn’t work.

    Best, Sven

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    August 12, 2015 at 09:52
    Avatar: sventertain
    sventertain
    Participant
    August 19, 2015 at 17:43

    Hello Jack,

    i’ve tried some variations to include the JS in the royal-child.
    If i include the complete etheme.js with the customized link there is an error on the popup. It loads double. I can close one and the second is not closeable. Anyway it looks broken.

    Another try was to create a second JS which has only the function of the popup. Via Firebug i can see that its loaded, but it seems that its overridden by the etheme.js. The link is not changed.

    Any ideas?

    Thanks a lot! Sven

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    August 19, 2015 at 18:19

    Hello,

    You need add the code in your child theme functions.php file:

    add_action( 'wp_enqueue_scripts', 'etheme' );
    function etheme() {
        wp_enqueue_script( 'etheme', get_stylesheet_directory_uri() . '/js/etheme.js' );
    }

    Create “js” folder in child theme and copy etheme.js file with needed changes in the child theme “js” directory so you won’t lose modifications after theme update.

    Best regards,
    Jack Richardson.

    Avatar: sventertain
    sventertain
    Participant
    August 19, 2015 at 19:23

    Perfect!

    Many thanks!

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    August 19, 2015 at 19:38

    Hello,

    You’re welcome.

    Best regards,
    Jack Richardson.

  • Viewing 8 results - 1 through 8 (of 8 total)

The issue related to '‘Change link in popup’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.