make "add to cart" button go straight to checkout?
Hi there,
I'm playing with DC for the first time today - very impressed I must say. It's a big leap forward from Ubercart.
I wonder if anyone can point me in the right direction for this. I would like to modify the "add to cart" button so that it takes the customer straight to the checkout page - and change the button label to "buy now" or some such.
How should I go about this?
Cheers,
Phil
Comments
+1 Need a way to configure
+1
Need a way to configure it:
Is there a hidden configuration somewhere or should I file a feature request on d.o. ?
Redirect to cart after adding a product
I haven't tested this, but I suspect you might just be able to do this using Rules:
Hope this helps,
John / NEARDARK
works well
Thanks neardark, that works a treat.
It doesn't work for me
I tried the rule as suggested by neardark and it worked, but when I added some conditions to check the products added to cart, it stop working.
This is the rule:
{ "rules_reindirizza_utente_dopo_aggiunta_abbonamento_al_carrello" : {
"LABEL" : "Reindirizza l'utente dopo l'aggiunta di un abbonamento al carrello",
"PLUGIN" : "reaction rule",
"TAGS" : [ "commerce" ],
"REQUIRES" : [ "commerce_order", "rules", "commerce_cart" ],
"ON" : [ "commerce_cart_product_add" ],
"IF" : [
{ "commerce_order_contains_product" : {
"commerce_order" : [ "commerce_order" ],
"product_id" : "7",
"operator" : "\u003e=",
"value" : "1"
}
},
{ "OR" : [
{ "commerce_order_contains_product" : {
"commerce_order" : [ "commerce_order" ],
"product_id" : "8",
"operator" : "\u003e=",
"value" : "1"
}
},
{ "OR" : [
{ "commerce_order_contains_product" : {
"commerce_order" : [ "commerce_order" ],
"product_id" : "9",
"operator" : "\u003e=",
"value" : "1"
}
}
]
}
]
}
],
"DO" : [ { "redirect" : { "url" : "cart" } } ]
}
}
What am I doing wrong?
Edit: it seems it's a problem linked to logic operators.