Advertisement
Guest User

Untitled

a guest
Mar 19th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. <?php
  2. // Exit if accessed directly
  3. if ( !defined( 'ABSPATH' ) ) exit;
  4.  
  5. // BEGIN ENQUEUE PARENT ACTION
  6. // AUTO GENERATED - Do not modify or remove comment markers above or below:
  7.  
  8.  
  9. if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
  10. function chld_thm_cfg_parent_css() {
  11. wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css' );
  12. }
  13. endif;
  14. add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css' );
  15.  
  16. // END ENQUEUE PARENT ACTION
  17.  
  18.  
  19.  
  20. remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
  21. add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 25 );
  22.  
  23.  
  24.  
  25.  
  26. add_action( 'woocommerce_single_product_summary', 'kt_add_custom_field', 36 );
  27.  
  28. function kt_add_custom_field() {
  29. global $post;
  30.  
  31. echo '<br> <div class="prod-code, pc-brand">Brand: '.get_post_meta( $post->ID, 'Brand', true ).'</div>';
  32. echo '<div class="prod-code pc-designer">Designer: '.get_post_meta( $post->ID, 'Designer', true ).'</div>';
  33.  
  34. }
  35.  
  36.  
  37.  
  38. add_action( 'woocommerce_shop_loop_item_title', 'kt_archive_add_brand_field', 1 );
  39.  
  40. function kt_archive_add_brand_field() {
  41. global $post;
  42.  
  43. echo '<br> <span class="pc-shop-brand">'.get_post_meta( $post->ID, 'Brand', true ).'</span>';
  44. }
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. function custom_backorder_text( $available_array, $product_object ) {
  52.  
  53. if( $available_array["availability"] == "Available on backorder" ){
  54.  
  55. $custom_meta_value = get_post_meta( $product_object->id, 'Lead Time', true );
  56.  
  57. $available_array["availability"] = "Lead Time: ".$custom_meta_value;
  58.  
  59. $available_array["class"] = "prod-code pc-leadtime";
  60.  
  61. return $available_array;
  62.  
  63. }
  64.  
  65. }
  66.  
  67. add_filter( 'woocommerce_get_availability', 'custom_backorder_text', 99, 2);
  68.  
  69.  
  70.  
  71.  
  72. function my_custom_function(){
  73. do_action("woocommerce_tm_epo");
  74. }
  75.  
  76. add_action( 'woocommerce_single_product_summary', 'my_custom_function', 25 );
  77.  
  78.  
  79. add_filter('col-md-12 clearfix kad-header-left', 'kt_add_search_form_split_menu', 10, 2);
  80. function kt_add_search_form_split_menu($items, $args) {
  81. global $virtue_premium;
  82.  
  83. if( !($args->theme_location == 'secondary_navigation') && (isset($virtue_premium['header_style']) && $virtue_premium['header_style'] == "center" ) )
  84. return $items;
  85.  
  86. ob_start();
  87. ?>
  88. <li class="menu-search-icon-kt">
  89. <a class="kt-menu-search-btn collapsed" title="<?php echo __('Search', 'virtue');?>" data-toggle="collapse" data-target="#kad-menu-search-popup">
  90. <i class="icon-search"></i>
  91. </a>
  92. <div id="kad-menu-search-popup" class="search-container container collapse">
  93. <div class="kt-search-container">
  94. <?php if(isset($virtue_premium['menu_search_woo']) && $virtue_premium['menu_search_woo'] == '1') {
  95. get_product_search_form();
  96. } else {
  97. get_search_form();
  98. } ?>
  99. </div>
  100. </div>
  101. </li>
  102. <?php $output = ob_get_contents();
  103. ob_end_clean();
  104. return $items . $output;
  105. }
  106.  
  107.  
  108. add_action( 'wp_enqueue_scripts', 'add_my_script' );
  109. function add_my_script() {
  110. wp_enqueue_script( 'my-js', '/wp-content/themes/virtue_premium_child/set_summary_top.js', array(), "1", true);
  111. }
  112. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement