product_add_to_cart() public static method

Display a single product price + cart button.
public static product_add_to_cart ( array $atts ) : string
$atts array
return string
 function woo_add_to_cart_shortcode($atts)
 {
     if (empty($atts)) {
         return '';
     }
     extract(shortcode_atts(array('title' => '', 'url' => '', 'target' => '', 'tooltip' => '', 'id' => '', 'sku' => '', 'style' => 'border:4px solid #ccc; padding: 12px;', 'show_price' => 'true'), $atts));
     if (!empty($url) && !empty($title)) {
         $title = '<a href="' . esc_url($url) . '"' . (!empty($target) ? ' target="' . esc_attr($target) . '"' : '') . '>' . esc_html($title) . '</a>';
     }
     $output = $title ? '<div class="ts-add-to-cart' . ($tooltip ? ' ts-cart-tooltip ts-cart-tooltip-' . esc_attr($tooltip) : '') . '"><div class="add-to-cart-title"><h4>' . $title . '</h4></div>' : '';
     if (class_exists('WC_Shortcodes')) {
         $output .= WC_Shortcodes::product_add_to_cart($atts);
     }
     $output .= $title ? '</div>' : '';
     return $output;
 }