Voting starts in March for the Drupal Association Board election.
How to print the add to cart button in a custom content type template?
The add to cart button shows up on the default product content type installed with Ubercart, but doesn't show on custom content types.
I can't find an example node template file either, and all examples on the web talk about how to print the add to cart button in Drupal 7.
Looking a the code in uc_product, I came up with this:
$form_object = new \Drupal\uc_product\Form\AddToCartForm($node->nid->getString()); $add_to_cart_form = \Drupal::formBuilder()->getForm($form_object, $node); dsm($add_to_cart_form);
This gives me an object in $add_to_cart_form but what do I do with it? Is this the right way to print the add to cart button in D8 for ubercart?