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

    Hi,
    I would like to use the shopping cart icon that appears in the mobile version of the web to link it to the shop page directly.
    In our shop there is no sense to shop more than one product as we sell appointments, therefore it would be useful to send them to the shop itself.

    Is it possible? Do we have to hide that icon and create a new floating button linked to the shop page?

    Thanks in advance,
    Dani.

    #872627

    Hey daniandres,
    Try adding this code to the end of your functions.php file in Appearance > Editor:

    function change_checkout_url( $url ){
    
        // Force SSL if needed
        $scheme = ( is_ssl() || 'yes' === get_option( 'woocommerce_force_ssl_checkout' ) ) ? 'https' : 'http';
        $url = site_url( '/custom-page/', $scheme );
    
        return $url;
    }
    add_filter( 'woocommerce_get_checkout_url', 'change_checkout_url', 10, 2 );

    change /custom-page/ to your page

    Best regards,
    Mike

    #872720

    Hi Mike,
    I tried to add your function to our functions.php but the web refuses to load.
    By the other hand I’ve thought that we are using WMPL to make a multilingual site and it would be more difficult to redirect this button
    according to the actual language.

    Perhaps it’s easier to hide the mobile cart button and then adding a floating button for each language home page.
    What do you think?

    Thanks.

    #872789

    Hi,
    Ok, how about adding a custom menu at the top of your page?
    2017-11-05_113353
    Go to Enfold Theme Options > Header > Extra Elements > Header Secondary Menu and activate, then go to your menus and create a new menu, you can name it anything.
    Add two custom menu items, set the URL to your pages, in the Navigation Label add this code, one for each link:

    
    Tienda <img title="Español" src="https://[your-url].com/wp-content/plugins/sitepress-multilingual-cms/res/flags/es.png">
    Shop <img title="English" src="https://[your-url].com/wp-content/plugins/sitepress-multilingual-cms/res/flags/en.png">

    Save menu and set it in the Manage Locations tab
    To hide the menu on any screen larger than a phone add this code in the General Styling > Quick CSS field:

    @media only screen and (min-width: 767px) { 
    .av_extra_header_active {display:none!important;}}

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.