• Resolved amila

    (@flatworld21)


    1. Add a “checkout” button to one page(not product pages of WooCommerce, but wp pages ).
    2. click “checkout” it transfer to checkout page.

    • This topic was modified 8 years ago by amila.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter amila

    (@flatworld21)

    I did it by this

    <script type='text/javascript'>
    /* <![CDATA[ */
    var wc_add_to_cart_params = {"ajax_url":"\/wp-admin\/admin-ajax.php","wc_ajax_url":"\/?wc-ajax=%%endpoint%%","i18n_view_cart":"View cart","cart_url":"http:\/\/testestste.com\/checkout\/","is_cart":"no","cart_redirect_after_add":"yes"};
    /* ]]> */
    </script>
    <a class="button product_type_simple add_to_cart_button ajax_add_to_cart added" href="/buypage/?add-to-cart=8346" rel="nofollow" data-quantity="1" data-product_id="8346" data-product_sku="" aria-label="Add “test” to your cart">Check out</a>
    seank123

    (@seank123)

    Would one of the WooCommerce shortcodes do it?

    https://docs.woocommerce.com/document/woocommerce-shortcodes/

    seank123

    (@seank123)

    Something like:

    [add_to_cart id=”1234″]

    Kenin

    (@kbassart)

    Automattic Happiness Engineer

    The best way to do this would be to use one of the shortcodes in WooCommerce, or use a custom Add to Cart URL as outlined here: https://businessbloomer.com/woocommerce-custom-add-cart-urls-ultimate-guide/

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

The topic ‘how to do this?’ is closed to new replies.