WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm wondering whether it's possible to make 2 different checkout pages for 2 different products?

If a buyer chooses the product #1, he/she will be redirected to the checkout page #1. If he/she chooses the product #2, he/she will be redirected to the checkout page #2.

These 2 checkout pages have some same fields and some different fields. Some same fields are optional on the checkout page #1 but are mandatory on the checkout page #2.

Any help is appreciated. :)

share|improve this question
What if a user buys both products? – Ewout Mar 23 '13 at 18:07
Hi @Ewout, Thanks for your question. A user may buy only one product at a time. – Box Mar 23 '13 at 23:51

If you want to make sure a user can only buy one product at a time, you need to disable shopping after a user has bought a product: otherwise a user could press 'back', and add the other product to the cart.

That said, you could try changing the checkout fields conditionally by putting this in functions.php:

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

function custom_override_checkout_fields( $fields ) {
    global $woocommerce;

    //assuming only one product in cart
    foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {
        $_product = $values['data'];

    switch ($_product->id) {
        case '666': //product id for product 1
            //do stuff with the checkout fields
        case '999': //product id for product 2
            //do stuff with the checkout fields

    return $fields;

take a look at this tutorial for more info about changing checkout fields.

share|improve this answer
Thanks for your answer. :) Merging the 2 different checkout pages into one is an approach. – Box Mar 25 '13 at 22:15
is the answer not what you are looking for? – Ewout Mar 25 '13 at 22:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.