In the Deal details page I want to add a new button Pay Now and then user clicks it, then redirects to the checkout/orderId page. How is it possible ? Please help.
1 Answer
Use a rule. Example:
{ "rules_forward_user_directly_to_checkout" : {
"LABEL" : "Forward user directly to checkout",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [],
"REQUIRES" : [ "commerce_order", "rules", "commerce_cart" ],
"ON" : { "commerce_cart_product_add" : [] },
"IF" : [],
"DO" : [ { "redirect" : { "url" : "checkout" } } ]
}
}
Note that you don't need to redirect to checkout/%order_id
, you just need to redirect to checkout
and Commerce will take care of the rest.