Changeset 2782841
- Timestamp:
- 09/10/2022 06:14:05 PM (3 years ago)
- Location:
- hookywoo/tags/trunk
- Files:
-
- 7 edited
-
README.md (modified) (4 diffs)
-
css/style.css (modified) (2 diffs)
-
hookywoo-hooks-customizer.php (modified) (2 diffs)
-
includes/hw-shop.php (modified) (1 diff)
-
includes/hw-single-product.php (modified) (1 diff)
-
includes/shop-page-fields.php (modified) (8 diffs)
-
includes/single-page-fields.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
hookywoo/tags/trunk/README.md
r2782582 r2782841 4 4 License: GNU GENERAL PUBLIC LICENSE 5 5 License URI: http://fsf.org/ 6 Requires at least: 3.7.17 Tested up to: 6. 0.28 Stable tag: 1.5.39 Requires PHP: 5.36 Requires at least: 5.0.1 7 Tested up to: 6.2.0 8 Stable tag: 2.0.0 9 Requires PHP: 7.0 10 10 11 11 A WYSIWYG solution for adding content to the majority of all WooCommerce Action Hooks. … … 26 26 The "after cart" and "before product tabs" divs are both set to clear:all; for basic layout reasons. Those, and all others, can be over ridden in your own theme's stylesheet. 27 27 28 Includes "Shop/Archive" , "Single Product" Hooks. 29 For PRO Version (includes Checkout and Cart pages), please visit <a href="https://madcowweb.com/hookywoo-product/">Mad Cow Web</a> 28 Includes "Shop/Archive" , "Single Product", "Cart" and "Checkout" Hooks. 30 29 31 <a href="https://madcowweb.com/contact-us/" >Contact Us</a>30 <a href="https://madcowweb.com/contact-us/" target="_blank">Contact Us</a> 32 31 == Installation == 33 32 … … 47 46 `<div class="my-cool-div">My Awesome Stuff inside my div</div>` 48 47 49 = Will I lose my changes if I up grade =48 = Will I lose my changes if I update = 50 49 51 No. The data is stored safely in the database. Just remove the Standard Plugin and Upload the Pro version as you would any other plugin.50 No. The data is stored safely in the database. 52 51 53 52 == Changelog == 53 = 2.0.0 = 54 * Added Cart and Checkout page functionality 55 * Updated readme file with more instructions 56 * Removed images from interface 57 * Added new elements for cart and checkout - list items - so they display correctly 54 58 = 1.1.0 = 55 59 * Added tabbed function to better separate page sections … … 62 66 = 1.4.5 = 63 67 fix php errors for empty indexes on empty fields 64 = 1.5.1 =65 update URLs66 = 1.5.2 =67 fix typo -
hookywoo/tags/trunk/css/style.css
r1735892 r2782841 1 1 /* FONTS ON ADMIN PAGES */ 2 .wp-admin h1{ 3 font-weight: bold; 4 } 5 .wp-admin h2.hookywoo{ 6 font-size: 1.3em; 7 color: green; 8 font-style: italic; 9 font-weight: 900; 10 text-transform: uppercase; 11 margin: 0.5em 0; 12 font-family: Merriweather, Georgia, serif; 13 padding: 0; 14 } 15 .wp-admin h3.hookywoo{ 16 margin: 0.5em 0; 2 3 .wp-admin h1 { 4 font-weight: bold; 17 5 } 18 6 19 /* FIX HOOK STYLING ISSUES */ 20 .hw-after-cart, .hw-before-product-tabs{ 21 clear: both; 7 .wp-admin h3.hookywoo { 8 margin: 0.5em 0; 22 9 } 23 10 11 12 /* FIX HOOK STYLING ISSUES */ 13 14 .hw-after-cart, 15 .hw-before-product-tabs { 16 clear: both; 17 } 18 19 24 20 /* Change background color of buttons on hover */ 21 25 22 .nav-tab:hover { 26 23 background-color: #008000; … … 28 25 } 29 26 27 30 28 /* Create an active/current tablink class */ 29 31 30 .nav-tab-active { 32 31 background-color: #008000; -
hookywoo/tags/trunk/hookywoo-hooks-customizer.php
r2133657 r2782841 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) {3 exit; // Exit if accessed directly4 }5 2 /** 6 3 * Plugin Name: HookyWoo WooCommerce Hooks Customizer 7 * Plugin URI: https://github.com/RidgeviewTech/HookyWoo-Pro/settings8 4 * Description: WYSIWYG Editor for WooCommerce Hooks 9 * Author: Jason Robie5 * Author: Mad Cow Web Design 10 6 * Author URI: https://madcowweb.com/ 11 * Version: 1.5.27 * Version: 2.0.0 12 8 * 13 9 * This program is free software: you can redistribute it and/or modify … … 22 18 */ 23 19 24 /**25 * Check if WooCommerce is active26 **/27 if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {28 29 20 class HookyWoo_Plugin { 30 21 31 public function __construct() { 32 // Hook into the admin menu 33 add_action( 'admin_menu', array( $this, 'create_plugin_settings_page' ) ); 22 public function __construct() { 23 // Hook into the admin menu 24 add_action( 'admin_menu', array( $this, 'create_plugin_settings_page' ) ); 25 // Add Settings and Fields 26 add_action( 'admin_init', array( $this, 'setup_sections' ) ); 27 add_action( 'admin_init', array( $this, 'setup_single_page_fields' ) ); 28 add_action( 'admin_init', array( $this, 'setup_shop_page_fields' ) ); 29 add_action( 'admin_init', array( $this, 'setup_cart_page_fields' ) ); 30 add_action( 'admin_init', array( $this, 'setup_checkout_page_fields' ) ); 31 add_action( 'admin_enqueue_scripts', 'hookywoo_styles' ); 32 add_action( 'wp_enqueue_scripts', 'hookywoo_styles' ); 33 function hookywoo_styles() { 34 wp_register_style( 'hookywoo_styles', plugin_dir_url( __FILE__ ) . 'css/style.css' ); 35 wp_enqueue_style( 'hookywoo_styles' ); 36 } 34 37 35 // Add Settings and Fields 36 add_action( 'admin_init', array( $this, 'setup_sections' ) ); 37 add_action( 'admin_init', array( $this, 'setup_single_page_fields' ) ); 38 add_action( 'admin_init', array( $this, 'setup_shop_page_fields' ) ); 39 add_action( 'admin_enqueue_scripts', 'hookywoo_styles' ); 40 add_action( 'wp_enqueue_scripts', 'hookywoo_styles' ); 41 function hookywoo_styles() { 42 wp_register_style( 'hookywoo_styles', plugin_dir_url( __FILE__ ) . 'css/style.css' ); 43 wp_enqueue_style( 'hookywoo_styles' ); 38 include_once( plugin_dir_path( __FILE__ ) . 'includes/hw-shop.php' ); 39 include_once( plugin_dir_path( __FILE__ ) . 'includes/hw-single-product.php' ); 40 include_once( plugin_dir_path( __FILE__ ) . 'includes/hw-cart.php' ); 41 include_once( plugin_dir_path( __FILE__ ) . 'includes/hw-checkout.php' ); 44 42 } 45 43 46 include_once( plugin_dir_path( __FILE__ ) . 'includes/hw-shop.php' ); 47 include_once( plugin_dir_path( __FILE__ ) . 'includes/hw-single-product.php' ); 48 } 44 public function create_plugin_settings_page() { 45 // Add the menu item and page 46 $page_title = 'HookyWoo Settings Page'; 47 $menu_title = 'HookyWoo Settings'; 48 $capability = 'manage_options'; 49 $slug = 'hookywoo_settings_page'; 50 $callback = array( $this, 'hookywoo_plugin_settings_page_content' ); 49 51 50 public function create_plugin_settings_page() { 51 // Add the menu item and page 52 $page_title = 'HookyWoo Settings Page'; 53 $menu_title = 'HookyWoo Settings'; 54 $capability = 'manage_options'; 55 $slug = 'hookywoo_settings_page'; 56 $callback = array( $this, 'hookywoo_plugin_settings_page_content' ); 52 add_submenu_page( 'woocommerce', $page_title, $menu_title, $capability, $slug, $callback ); 53 } 57 54 58 add_submenu_page( 'woocommerce', $page_title, $menu_title, $capability, $slug, $callback ); 59 } 55 public function hookywoo_plugin_settings_page_content( $active_tab = '' ) {?> 56 <div class="wrap"> 57 <h2>HookyWoo WooCommerce Hooks Customization (Pro Version)</h2><?php 58 if( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] ){ 59 $this->admin_notice(); 60 } ?> 61 <?php if( isset( $_GET[ 'tab' ] ) ) { 62 $active_tab = $_GET[ 'tab' ]; 63 } else if( $active_tab == 'shop_page_options' ) { 64 $active_tab = 'shop_page_options'; 65 } else if( $active_tab == 'cart_page_options' ) { 66 $active_tab = 'cart_page_options'; 67 } else if( $active_tab == 'checkout_page_options' ) { 68 $active_tab = 'checkout_page_options'; 69 } else { 70 $active_tab = 'single_page_options'; 71 } ?> 60 72 61 public function hookywoo_plugin_settings_page_content( $active_tab = '' ) {?> 62 <div class="wrap"> 63 <h2>HookyWoo WooCommerce Hooks Customization</h2><?php 64 if( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] ){ 65 $this->admin_notice(); 66 } ?> 67 <?php if( isset( $_GET[ 'tab' ] ) ) { 68 $active_tab = $_GET[ 'tab' ]; 69 } else if( $active_tab == 'shop_page_options' ) { 70 $active_tab = 'shop_page_options'; 71 } else { 72 $active_tab = 'single_page_options'; 73 } ?> 74 75 <h2 class="nav-tab-wrapper"> 73 <h2 class="nav-tab-wrapper"> 76 74 <a href="?page=hookywoo_settings_page&tab=single_page_options" class="nav-tab <?php echo $active_tab == 'single_page_options' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Single Product Page Options', 'hookywoo' ); ?></a> 77 75 <a href="?page=hookywoo_settings_page&tab=shop_page_options" class="nav-tab <?php echo $active_tab == 'shop_page_options' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Shop/Archive Page Options', 'hookywoo' ); ?></a> 78 </h2> 79 80 <form method="post" action="options.php"> 76 <a href="?page=hookywoo_settings_page&tab=cart_page_options" class="nav-tab <?php echo $active_tab == 'cart_page_options' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Cart Page Options', 'hookywoo' ); ?></a> 77 <a href="?page=hookywoo_settings_page&tab=checkout_page_options" class="nav-tab <?php echo $active_tab == 'checkout_page_options' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Checkout Page Options', 'hookywoo' ); ?></a> 78 </h2> 79 80 <form method="post" action="options.php"> 81 81 <?php 82 if( $active_tab == 'single_page_options' ) {82 if( $active_tab == 'single_page_options' ) { 83 83 settings_fields( 'single_product_page_section' ); 84 84 do_settings_sections( 'single_product_page_section' ); 85 } elseif( $active_tab == 'shop_page_options' ) {85 } elseif( $active_tab == 'shop_page_options' ) { 86 86 settings_fields( 'shop_archive_page_section' ); 87 87 do_settings_sections( 'shop_archive_page_section' ); 88 } 89 submit_button(); 88 } elseif( $active_tab == 'cart_page_options' ) { 89 settings_fields( 'cart_page_section' ); 90 do_settings_sections( 'cart_page_section' ); 91 } else { 92 settings_fields( 'checkout_page_section' ); 93 do_settings_sections( 'checkout_page_section' ); 94 } 95 submit_button(); 90 96 ?> 91 </form> 92 </div> <?php } 93 94 public function admin_notice() { ?> 95 <div class="notice notice-success is-dismissible"> 96 <p>Hooray! Your settings have been updated!</p> 97 </div><?php 98 } 97 </form> 98 </div> 99 <?php } 99 100 100 public function setup_sections() { 101 add_settings_section( 'single_product_page_section', '', array( $this, 'single_product_section_callback' ) , 'single_product_page_section' ); 102 add_settings_section( 'shop_archive_page_section', '', array( $this, 'shop_section_callback' ), 'shop_archive_page_section' ); 103 } 104 public function single_product_section_callback() { ?> 101 public function admin_notice() { ?> 102 <div class="notice notice-success is-dismissible"> 103 <p>Hooray! Your settings have been updated!</p> 104 </div><?php 105 } 106 107 public function setup_sections() { 108 add_settings_section( 'single_product_page_section', '', array( $this, 'single_product_section_callback' ) , 'single_product_page_section' ); 109 add_settings_section( 'shop_archive_page_section', '', array( $this, 'shop_section_callback' ), 'shop_archive_page_section' ); 110 add_settings_section( 'cart_page_section', '', array( $this, 'cart_page_section_callback' ) , 'cart_page_section' ); 111 add_settings_section( 'checkout_page_section', '', array( $this, 'checkout_page_section_callback' ), 'checkout_page_section' ); 112 } 113 public function single_product_section_callback() { ?> 105 114 <h1>Single Product Customization Section</h1> 106 <h2 class="hookywoo">Custom Hook locations are highlighted in bold, green, italic font</h2>107 115 <h3 class="hookywoo">Use the WYSIWYG editor titles to know where you want your content to appear</h3> 108 <?php echo '<img src="' . plugins_url( 'images/single-product.png', __FILE__ ) . '" > '; 109 } 110 public function shop_section_callback() { ?> 116 <?php } 117 public function shop_section_callback() { ?> 111 118 <h1>Shop/Archive Page Customization Section</h1> 112 <h2 class="hookywoo">Custom Hook locations are highlighted in bold, green, italic font</h2>113 119 <h3 class="hookywoo">Use the WYSIWYG editor titles to know where you want your content to appear</h3> 114 <?php echo '<img src="' . plugins_url( 'images/shop.png', __FILE__ ) . '" > '; 115 } 120 <?php } 121 public function cart_page_section_callback() { ?> 122 <h1>Cart Page Customization Section</h1> 123 <h3 class="hookywoo">Use the WYSIWYG editor titles to know where you want your content to appear</h3> 124 <?php } 125 public function checkout_page_section_callback() { ?> 126 <h1>Checkout Page Customization Section</h1> 127 <h3 class="hookywoo">Use the WYSIWYG editor titles to know where you want your content to appear</h3> 128 <?php } 116 129 117 public function setup_single_page_fields() { 118 include ( plugin_dir_path( __FILE__ ) . 'includes/single-page-fields.php' ); 119 } 120 public function setup_shop_page_fields() { 121 include ( plugin_dir_path( __FILE__ ) . 'includes/shop-page-fields.php' ); 122 } 130 public function setup_single_page_fields() { 131 include ( plugin_dir_path( __FILE__ ) . 'includes/single-page-fields.php' ); 132 } 133 public function setup_shop_page_fields() { 134 include ( plugin_dir_path( __FILE__ ) . 'includes/shop-page-fields.php' ); 135 } 136 public function setup_cart_page_fields() { 137 include ( plugin_dir_path( __FILE__ ) . 'includes/cart-page-fields.php' ); 138 } 139 public function setup_checkout_page_fields() { 140 include ( plugin_dir_path( __FILE__ ) . 'includes/checkout-page-fields.php' ); 141 } 123 142 124 public function field_callback( $arguments ) { 125 $value = get_option( $arguments['uid'] ); 126 if( ! $value ) { 127 $value = $arguments['default']; 143 public function field_callback( $arguments ) { 144 $value = get_option( $arguments['uid'] ); 145 switch( $arguments['type'] ){ 146 case 'text': 147 case 'textarea': 148 printf( '<textarea name="%1$s" id="%1$s" rows="3" cols="50">%2$s</textarea>', $arguments['uid'], $value ); 149 break; 150 } 151 if( $helper = $arguments['helper'] ) { 152 printf( '<span class="helper"> %s</span>', $helper ); 153 } 154 if( $supplemental = $arguments['supplemental'] ){ 155 printf( '<p class="description">%s</p>', $supplemental ); 156 } 128 157 } 129 switch( $arguments['type'] ){130 case 'text':131 case 'textarea':132 printf( '<textarea name="%1$s" id="%1$s" placeholder="%2$s" rows="3" cols="50">%3$s</textarea>', $arguments['uid'], $arguments['placeholder'], $value );133 break;134 }135 if( $helper = $arguments['helper'] ){136 printf( '<span class="helper"> %s</span>', $helper );137 }138 if( $supplemental = $arguments['supplemental'] ){139 printf( '<p class="description">%s</p>', $supplemental );140 }141 }142 158 } 143 159 new HookyWoo_Plugin(); 144 } -
hookywoo/tags/trunk/includes/hw-shop.php
r1846609 r2782841 3 3 exit; // Exit if accessed directly 4 4 } 5 add_action( 'woocommerce_before_main_content', 'HookyWoo_before_shop_page_content' ); 6 function HookyWoo_before_shop_page_content() { 7 echo '<div class="hw-before-shop-page-content">' . get_option( 'before_shop_page_content' ) . '</div>'; 8 } 9 /*Add content below Shop title 10 ** Other default Woo Hooks using woocommerce_archive_description 11 woocommerce_taxonomy_archive_description', 10 12 woocommerce_product_archive_description', 10 13 */ 14 add_action( 'woocommerce_archive_description', 'HookyWoo_below_shop_page_title' ); 15 function HookyWoo_below_shop_page_title() { 16 echo '<div class="hw-below-shop-title">' . get_option( 'shop_page_description' ) . '</div>'; 17 } 5 $strings = array( 6 array( 7 'wooHook' => 'woocommerce_before_main_content', 8 'priority' => '', 9 'elem_start' => '<div', 10 'elem_end' => '</div>', 11 'elem_class' => 'hw-before-shop-page-content', 12 'hooky_content' => get_option('before_shop_page_content'), 13 ), 14 array( 15 'wooHook' => 'woocommerce_archive_description', 16 'priority' => '', 17 'elem_start' => '<div', 18 'elem_end' => '</div>', 19 'elem_class' => 'hw-below-shop-title', 20 'hooky_content' => get_option('shop_page_description'), 21 ), 22 array( 23 'wooHook' => 'woocommerce_before_shop_loop_item', 24 'priority' => '', 25 'elem_start' => '<div', 26 'elem_end' => '</div>', 27 'elem_class' => 'hw-above-loop-image', 28 'hooky_content' => get_option('before_loop_product_image'), 29 ), 30 array( 31 'wooHook' => 'woocommerce_shop_loop_item_title', 32 'priority' => '', 33 'elem_start' => '<div', 34 'elem_end' => '</div>', 35 'elem_class' => 'hw-after-loop-image', 36 'hooky_content' => get_option('after_loop_product_image'), 37 ), 38 array( 39 'wooHook' => 'woocommerce_after_shop_loop_item_title', 40 'priority' => '', 41 'elem_start' => '<div', 42 'elem_end' => '</div>', 43 'elem_class' => 'hw-after-loop-title', 44 'hooky_content' => get_option('after_loop_product_title'), 45 ), 46 array( 47 'wooHook' => 'woocommerce_after_shop_loop_item', 48 'priority' => '', 49 'elem_start' => '<div', 50 'elem_end' => '</div>', 51 'elem_class' => 'hw-before-loop-item-cart-button', 52 'hooky_content' => get_option('before_loop_product_cart_button'), 53 ), 54 array( 55 'wooHook' => 'woocommerce_after_main_content', 56 'priority' => '', 57 'elem_start' => '<div', 58 'elem_end' => '</div>', 59 'elem_class' => 'hw-after-shop-loop', 60 'hooky_content' => get_option('after_main_shop_content'), 61 ), 62 ); 18 63 19 /*Add content before shop loop product 20 ** Other default Woo Hooks using woocommerce_before_shop_loop_item 21 woocommerce_template_loop_product_link_open', 10 22 woocommerce_template_loop_product_link_close', 5 23 woocommerce_template_loop_add_to_cart', 10 24 */ 25 add_action( 'woocommerce_before_shop_loop_item', 'HookyWoo_above_loop_product_image' ); 26 function HookyWoo_above_loop_product_image() { 27 echo '<div class="hw-above-loop-image">' . get_option( 'before_loop_product_image' ) . '</div>'; 28 } 29 30 /*Add content after loop product image and below title 31 ** Other default Woo Hooks using woocommerce_shop_loop_item_title 32 woocommerce_template_loop_product_title', 10 33 */ 34 add_action( 'woocommerce_shop_loop_item_title', 'HookyWoo_after_loop_product_image', 5 ); 35 function HookyWoo_after_loop_product_image() { 36 echo '<div class="hw-after-loop-image">' . get_option( 'after_loop_product_image' ) . '</div>'; 37 } 38 39 /*Add content after loop product title 40 ** Other default Woo Hooks using woocommerce_shop_loop_item_title 41 woocommerce_template_loop_rating', 5 42 woocommerce_template_loop_price', 10 43 */ 44 add_action( 'woocommerce_after_shop_loop_item_title', 'HookyWoo_after_loop_product_title', 5 ); 45 function HookyWoo_after_loop_product_title() { 46 echo '<div class="hw-after-loop-title">' . get_option( 'after_loop_product_title' ) . '</div>'; 47 } 48 49 /*Add content before add to cart button 50 ** Other default Woo Hooks using woocommerce_after_shop_loop_item 51 woocommerce_template_loop_product_link_close', 5 52 woocommerce_template_loop_add_to_cart', 10 53 */ 54 add_action( 'woocommerce_after_shop_loop_item', 'HookyWoo_before_loop_product_cart_button' ); 55 function HookyWoo_before_loop_product_cart_button() { 56 echo '<div class="hw-before-loop-item-cart-button">' . get_option( 'before_loop_product_cart_button' ) . '</div>'; 57 } 58 59 /*Add content after shop loop 60 ** Other default Woo Hooks using woocommerce_after_main_content 61 woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content) 62 */ 63 add_action( 'woocommerce_after_main_content', 'HookyWoo_after_shop_loop', 5 ); 64 function HookyWoo_after_shop_loop() { 65 echo '<div class="hw-after-shop-loop">' . get_option( 'after_main_shop_content' ) . '</div>'; 66 } 64 require_once( 'loop-classes.php' ); 65 $shop_loop = new Hooky_Loop_Class( $strings ); -
hookywoo/tags/trunk/includes/hw-single-product.php
r1846609 r2782841 3 3 exit; // Exit if accessed directly 4 4 } 5 //Add content before Product Title 6 add_action( 'woocommerce_single_product_summary', 'HookyWoo_before_title_content', 3 ); 7 function HookyWoo_before_title_content() { 8 echo '<div class="hw-before-title">' . get_option( 'before_product_title' ) . '</div>'; 9 } 10 11 //Add content after Short Description 12 add_action( 'woocommerce_before_add_to_cart_form', 'HookyWoo_after_short_description_content' ); 13 function HookyWoo_after_short_description_content() { 14 echo '<div class="hw-after-short-description">' . get_option( 'after_short_description' ) . '</div>'; 15 } 16 17 //Add content before Variations 18 add_action( 'woocommerce_before_variations_form', 'HookyWoo_before_variations_content' ); 19 function HookyWoo_before_variations_content() { 20 echo '<div class="hw-before-variations">' . get_option( 'before_variations_content' ) . '</div>'; 21 } 22 23 //Add content after Add to Cart button 24 add_action( 'woocommerce_after_add_to_cart_button', 'HookyWoo_after_add_to_cart_content' ); 25 function HookyWoo_after_add_to_cart_content() { 26 echo '<div class="hw-after-cart">' . get_option( 'after_add_to_cart_button' ) . '</div>'; 27 } 28 29 //Add content after Variations 30 add_action( 'woocommerce_after_variations_form', 'HookyWoo_after_variations_content' ); 31 function HookyWoo_after_variations_content() { 32 echo '<div class="hw-after-variations">' . get_option( 'after_variations_content' ) . '</div>'; 33 } 34 35 //Add content before Product Meta 36 add_action( 'woocommerce_product_meta_start', 'HookyWoo_before_product_meta_content' ); 37 function HookyWoo_before_product_meta_content() { 38 echo '<div class="hw-before-product-meta">' . get_option( 'before_product_meta' ) . '</div>'; 39 } 40 41 //Add content after Product Meta 42 add_action( 'woocommerce_product_meta_end', 'HookyWoo_after_product_meta_content' ); 43 function HookyWoo_after_product_meta_content() { 44 echo '<div class="hw-after-product-meta">' . get_option( 'after_product_meta' ) . '</div>'; 45 } 46 47 //Add content before Product Tabs 48 add_action( 'woocommerce_after_single_product_summary', 'HookyWoo_before_product_tabs_content' ); 49 function HookyWoo_before_product_tabs_content() { 50 echo '<div class="hw-before-product-tabs">' . get_option( 'before_tabs_section' ) . '</div>'; 51 } 52 53 //Add content after Product 54 add_action( 'woocommerce_after_single_product', 'HookyWoo_after_product_content' ); 55 function HookyWoo_after_product_content() { 56 echo '<div class="hw-after-product">' . get_option( 'after_product_content' ) . '</div>'; 57 } 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 5 $strings = array( 6 array( 7 'wooHook' => 'woocommerce_single_product_summary', 8 'priority' => ', 3', 9 'elem_start' => '<div', 10 'elem_end' => '</div>', 11 'elem_class' => 'hw-after-product', 12 'hooky_content' => get_option('before_product_title'), 13 ), 14 array( 15 'wooHook' => 'woocommerce_before_add_to_cart_form', 16 'priority' => '', 17 'elem_start' => '<div', 18 'elem_end' => '</div>', 19 'elem_class' => 'hw-after-short-description', 20 'hooky_content' => get_option('after_short_description'), 21 ), 22 array( 23 'wooHook' => 'woocommerce_before_variations_form', 24 'priority' => '', 25 'elem_start' => '<div', 26 'elem_end' => '</div>', 27 'elem_class' => 'hw-before-variations', 28 'hooky_content' => get_option('before_variations_content'), 29 ), 30 array( 31 'wooHook' => 'woocommerce_after_add_to_cart_button', 32 'priority' => '', 33 'elem_start' => '<div', 34 'elem_end' => '</div>', 35 'elem_class' => 'hw-after-cart', 36 'hooky_content' => get_option('after_add_to_cart_button'), 37 ), 38 array( 39 'wooHook' => 'woocommerce_after_variations_form', 40 'priority' => '', 41 'elem_start' => '<div', 42 'elem_end' => '</div>', 43 'elem_class' => 'hw-after-variations', 44 'hooky_content' => get_option('after_variations_content'), 45 ), 46 array( 47 'wooHook' => 'woocommerce_product_meta_start', 48 'priority' => '', 49 'elem_start' => '<div', 50 'elem_end' => '</div>', 51 'elem_class' => 'hw-before-product-meta', 52 'hooky_content' => get_option('before_product_meta'), 53 ), 54 array( 55 'wooHook' => 'woocommerce_product_meta_end', 56 'priority' => '', 57 'elem_start' => '<div', 58 'elem_end' => '</div>', 59 'elem_class' => 'hw-after-product-meta', 60 'hooky_content' => get_option('after_product_meta'), 61 ), 62 array( 63 'wooHook' => 'woocommerce_after_single_product_summary', 64 'priority' => '', 65 'elem_start' => '<div', 66 'elem_end' => '</div>', 67 'elem_class' => 'hw-before-product-tabs', 68 'hooky_content' => get_option('before_tabs_section'), 69 ), 70 array( 71 'wooHook' => 'woocommerce_after_single_product', 72 'priority' => '', 73 'elem_start' => '<div', 74 'elem_end' => '</div>', 75 'elem_class' => 'hw-after-product', 76 'hooky_content' => get_option('after_product_content'), 77 ), 78 ); 79 require_once( 'loop-classes.php' ); 80 $shop_loop = new Hooky_Loop_Class( $strings ); -
hookywoo/tags/trunk/includes/shop-page-fields.php
r1846609 r2782841 7 7 'uid' => 'before_shop_page_content', 8 8 'label' => 'Before Shop Page Main Content', 9 'helper' => '', 9 10 'supplemental' => '*This text WILL appear outside of the page content', 10 11 'section' => 'shop_archive_page_section', … … 14 15 'uid' => 'shop_page_description', 15 16 'label' => 'Shop Page Description', 17 'helper' => '', 18 'supplemental' => '', 16 19 'section' => 'shop_archive_page_section', 17 20 'type' => 'textarea', … … 20 23 'uid' => 'before_loop_product_image', 21 24 'label' => 'Before Loop Product Image', 25 'helper' => '', 22 26 'supplemental' => '*This text WILL interfere with the Sale Flash icon', 23 27 'section' => 'shop_archive_page_section', … … 27 31 'uid' => 'after_loop_product_image', 28 32 'label' => 'After Loop Product Image', 33 'helper' => '', 29 34 'supplemental' => '*This text will be included in the product link', 30 35 'section' => 'shop_archive_page_section', … … 34 39 'uid' => 'after_loop_product_title', 35 40 'label' => 'After Loop Product Title', 41 'helper' => '', 36 42 'supplemental' => '*This text will be included in the product link', 37 43 'section' => 'shop_archive_page_section', … … 41 47 'uid' => 'before_loop_product_cart_button', 42 48 'label' => 'Before Loop Product Cart Button', 49 'helper' => '', 50 'supplemental' => '', 43 51 'section' => 'shop_archive_page_section', 44 52 'type' => 'textarea', … … 47 55 'uid' => 'after_main_shop_content', 48 56 'label' => 'After Main Shop Content', 57 'helper' => '', 58 'supplemental' => '', 49 59 'section' => 'shop_archive_page_section', 50 60 'type' => 'textarea', … … 53 63 foreach( $fields as $field ){ 54 64 add_settings_field( $field['uid'], $field['label'], array( $this, 'field_callback' ), 'shop_archive_page_section', $field['section'], $field ); 55 register_setting( 'shop_archive_page_section', $field['uid'] );65 register_setting( 'shop_archive_page_section', $field['uid'] ); 56 66 } -
hookywoo/tags/trunk/includes/single-page-fields.php
r2133657 r2782841 1 <?php 1 <?php 2 2 if ( ! defined( 'ABSPATH' ) ) { 3 3 exit; // Exit if accessed directly 4 4 } 5 5 $fields = array( 6 array( 7 'uid' => 'before_product_title', 8 'label' => 'Before Product Title', 9 'section' => 'single_product_page_section', 10 'type' => 'textarea', 11 ), 12 array( 13 'uid' => 'after_short_description', 14 'label' => 'After Short Description', 15 'section' => 'single_product_page_section', 16 'type' => 'textarea', 17 ), 18 array( 19 'uid' => 'before_variations_content', 20 'label' => 'Before Variations Section', 21 'section' => 'single_product_page_section', 22 'type' => 'textarea', 23 ), 24 array( 25 'uid' => 'after_add_to_cart_button', 26 'label' => 'After Add to Cart button', 27 'section' => 'single_product_page_section', 28 'type' => 'textarea', 29 ), 30 array( 31 'uid' => 'after_variations_content', 32 'label' => 'After Variations', 33 'section' => 'single_product_page_section', 34 'type' => 'textarea', 35 ), 36 array( 37 'uid' => 'before_product_meta', 38 'label' => 'Before Product Meta', 39 'section' => 'single_product_page_section', 40 'type' => 'textarea', 41 ), 42 array( 43 'uid' => 'after_product_meta', 44 'label' => 'After Product Meta', 45 'section' => 'single_product_page_section', 46 'type' => 'textarea', 47 ), 48 array( 49 'uid' => 'before_tabs_section', 50 'label' => 'Before Tabs Section', 51 'section' => 'single_product_page_section', 52 'type' => 'textarea', 53 ), 54 array( 55 'uid' => 'after_product_content', 56 'label' => 'After Product Content', 57 'section' => 'single_product_page_section', 58 'type' => 'textarea', 59 ), 6 array( 7 'uid' => 'before_product_title', 8 'label' => 'Before Product Title', 9 'helper' => '', 10 'supplemental' => '', 11 'section' => 'single_product_page_section', 12 'type' => 'textarea', 13 ), 14 array( 15 'uid' => 'after_short_description', 16 'label' => 'After Short Description', 17 'helper' => '', 18 'supplemental' => '', 19 'section' => 'single_product_page_section', 20 'type' => 'textarea', 21 ), 22 array( 23 'uid' => 'before_variations_content', 24 'label' => 'Before Varitions Section', 25 'helper' => '', 26 'supplemental' => '', 27 'section' => 'single_product_page_section', 28 'type' => 'textarea', 29 ), 30 array( 31 'uid' => 'after_add_to_cart_button', 32 'label' => 'After Add to Cart button', 33 'helper' => '', 34 'supplemental' => '', 35 'section' => 'single_product_page_section', 36 'type' => 'textarea', 37 ), 38 array( 39 'uid' => 'after_variations_content', 40 'label' => 'After Variations', 41 'helper' => '', 42 'supplemental' => '', 43 'section' => 'single_product_page_section', 44 'type' => 'textarea', 45 ), 46 array( 47 'uid' => 'before_product_meta', 48 'label' => 'Before Product Meta', 49 'helper' => '', 50 'supplemental' => '', 51 'section' => 'single_product_page_section', 52 'type' => 'textarea', 53 ), 54 array( 55 'uid' => 'after_product_meta', 56 'label' => 'After Product Meta', 57 'helper' => '', 58 'supplemental' => '', 59 'section' => 'single_product_page_section', 60 'type' => 'textarea', 61 ), 62 array( 63 'uid' => 'before_tabs_section', 64 'label' => 'Before Tabs Section', 65 'helper' => '', 66 'supplemental' => '', 67 'section' => 'single_product_page_section', 68 'type' => 'textarea', 69 ), 70 array( 71 'uid' => 'after_product_content', 72 'label' => 'After Product Content', 73 'helper' => '', 74 'supplemental' => '', 75 'section' => 'single_product_page_section', 76 'type' => 'textarea', 77 ), 60 78 ); 61 79 foreach( $fields as $field ){ 62 80 add_settings_field( $field['uid'], $field['label'], array( $this, 'field_callback' ), 'single_product_page_section', $field['section'], $field ); 63 register_setting( 'single_product_page_section', $field['uid'] );81 register_setting( 'single_product_page_section', $field['uid'] ); 64 82 }
Note: See TracChangeset
for help on using the changeset viewer.