Guest User

Untitled

a guest
Feb 18th, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.10 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. * Add your own functions here. You can also copy some of the theme functions into this file.
  5. * Wordpress will use those functions instead of the original functions then.
  6. */
  7.  
  8. // Bringt Widget Area in den Header neben das Logo
  9. add_action( 'ava_before_bottom_main_menu', 'enfold_customization_header_widget_area' );
  10. function enfold_customization_header_widget_area() {
  11.     dynamic_sidebar( 'header' );
  12. }
  13.  
  14. // remove default sorting dropdown in StoreFront Theme
  15. function avia_woocommerce_frontend_search_params()
  16. {
  17. return;
  18. }
  19.  
  20. // Button Text beim bestellen
  21. add_filter( 'woocommerce_order_button_text', 'mmx_order_button_text' );
  22. function mmx_order_button_text() {
  23.     return __( 'Kostenpflichtig bestellen', 'woocommerce' );
  24. }
  25.  
  26. // remove related product on product site
  27. /*function avia_remove_related_product() {
  28. remove_action( 'woocommerce_after_single_product_summary', 'avia_woocommerce_output_related_products', 20);
  29. }
  30. add_action( 'init', 'avia_remove_related_product');*/
  31.  
  32. // Titel auf Produktseite
  33. add_filter( 'avf_title_args', 'avf_product_titlee', 0, 2 );
  34. function avf_product_titlee( $args, $id ) {
  35.     if ( is_singular('product') ) { $args['title'] = get_the_title($id); }
  36.     return $args;
  37. }
  38.  
  39. // add post type product
  40. add_action('ava_frontend_search_form','ava_frontend_search_form_mod');
  41. function ava_frontend_search_form_mod()
  42. {
  43.     echo '<input type="hidden" name="post_type" value="product">';
  44. }
  45.  
  46. add_action('woocommerce_after_add_to_cart_button','cmk_additional_button');
  47. function cmk_additional_button() {
  48.     echo '<button class="popmake-3546" id="button-angebot" data-do-default="">Ja, bitte senden Sie mir ein Angebot zu!</button>';
  49. }
  50.  
  51.  
  52.  
  53.  
  54. add_filter( 'woocommerce_get_price_html', 'custom_price_message' );
  55. function custom_price_message( $price ) {
  56.   $new_price = $price . ' <span class="custom-price-prefix">' . __('<br> >> JETZT ANSEHEN >>').'</span>';
  57.   return $new_price;
  58. }
  59.  
  60. add_filter( 'add_to_cart_text', 'woo_custom_single_add_to_cart_text' );                // < 2.1
  61. add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_single_add_to_cart_text' );  // 2.1 +
  62.  
  63. function woo_custom_single_add_to_cart_text() {
  64.  
  65.     return __( 'In den Warenkorb legen', 'woocommerce' );
  66.  
  67. }
  68.  
  69. function ava_woocommerce_after_cart_mod(  ) {
  70.     echo '<div class="after_cart"><span class="waren"><h3>Bequem und sicher bestellen</h3><br><h4><span style="color: #009900">&#10004;</span> Bezahlung:</h4>Bequem auf Rechnung, PayPal, Sofortkauf oder Vorkasse<br><br><h4><span style="color: #009900">&#10004;</span> Produktion:</h4>Sie erhalten vorab einen Korrekturabzug als PDF oder eine fertige Mustertasse.<br><br><h4><span style="color: #009900">&#10004;</span> Lieferzeit:</h4>Wir brauchen ca. 5 Tage f&uumlr die Produktion nach Druckfreigabe.</span></div>';
  71. };
  72.  
  73. add_action ('woocommerce_after_cart', 'ava_woocommerce_after_cart_mod', 100, 0 );
  74.  
  75. add_action( 'after_setup_theme', 'mmx_avia_woocommerce_settings' );
  76. function mmx_avia_woocommerce_settings(){
  77.     global $avia_config;
  78.     $avia_config['shop_single_column_items'] = 5;
  79.     $avia_config['shop_single_column'] = 5;
  80. }
  81.  
  82. add_action('init', 'avf_move_product_output');
  83. function avf_move_product_output() {
  84.     remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
  85.     remove_action(    'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 1 );
  86.     add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 5 );
  87. }
  88.  
  89. add_action( 'woocommerce_after_shop_loop_item', 'remove_add_to_cart_buttons', 1 );
  90.  
  91.     function remove_add_to_cart_buttons() {
  92.       if( is_product_category() || is_shop()) {
  93.         remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
  94.       }
  95.     }
  96.  
  97.  
  98. // Display 240 products per page. Goes in functions.php
  99. add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 240;' ), 20 );
  100.  
  101. add_filter('comments_open','__return_false', 10, 2);
  102.  
  103.  
  104. /*add_action('ava_before_footer','avia_above_footer');
  105. function avia_above_footer(){
  106. dynamic_sidebar( 'above footer' );
  107. }*/
Advertisement
Add Comment
Please, Sign In to add comment