Advertisement
Fany_VanDaal

Úprava tlačítka v pokladně

Jan 26th, 2023
968
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. //od Pavel Kočárek
  2. add_filter('woocommerce_order_button_html', 'order_button_with_price_html');
  3.  
  4. function order_button_with_price_html($html) {
  5.      
  6.     $custom_text = esc_html__( 'Koupit za', 'woocommerce') . ' ' . WC()->cart->get_total();
  7.  
  8.         $html = '<button type="submit" class="button alt' . esc_attr(wc_wp_theme_get_element_class_name('button') ? ' ' . wc_wp_theme_get_element_class_name('button') : '') . '" name="woocommerce_checkout_place_order" id="place_order" value="' . esc_attr(strip_tags(str_replace(['<br>', '<br/>', '<br />'], ' ', $custom_text))) . '">' . $custom_text . '</button>';
  9.  
  10.     return $html;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement