Plugin Directory

Changeset 2782841


Ignore:
Timestamp:
09/10/2022 06:14:05 PM (3 years ago)
Author:
jrobie23
Message:

added cart and checkout functionality - removed images from ui

Location:
hookywoo/tags/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • hookywoo/tags/trunk/README.md

    r2782582 r2782841  
    44License: GNU GENERAL PUBLIC LICENSE
    55License URI: http://fsf.org/
    6 Requires at least: 3.7.1
    7 Tested up to: 6.0.2
    8 Stable tag: 1.5.3
    9 Requires PHP: 5.3
     6Requires at least: 5.0.1
     7Tested up to: 6.2.0
     8Stable tag: 2.0.0
     9Requires PHP: 7.0
    1010
    1111A WYSIWYG solution for adding content to the majority of all WooCommerce Action Hooks.
     
    2626The "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.
    2727
    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>
     28Includes "Shop/Archive" , "Single Product", "Cart" and "Checkout" Hooks.
    3029
    31 <a href="https://madcowweb.com/contact-us/">Contact Us</a>
     30<a href="https://madcowweb.com/contact-us/" target="_blank">Contact Us</a>
    3231== Installation ==
    3332
     
    4746`<div class="my-cool-div">My Awesome Stuff inside my div</div>`
    4847
    49 = Will I lose my changes if I upgrade =
     48= Will I lose my changes if I update =
    5049
    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.
     50No. The data is stored safely in the database.
    5251
    5352== 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
    5458= 1.1.0 =
    5559* Added tabbed function to better separate page sections
     
    6266= 1.4.5 =
    6367fix php errors for empty indexes on empty fields
    64 = 1.5.1 =
    65 update URLs
    66 = 1.5.2 =
    67 fix typo
  • hookywoo/tags/trunk/css/style.css

    r1735892 r2782841  
    11/* 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;
    175}
    186
    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;
    229}
    2310
     11
     12/* FIX HOOK STYLING ISSUES */
     13
     14.hw-after-cart,
     15.hw-before-product-tabs {
     16    clear: both;
     17}
     18
     19
    2420/* Change background color of buttons on hover */
     21
    2522.nav-tab:hover {
    2623    background-color: #008000;
     
    2825}
    2926
     27
    3028/* Create an active/current tablink class */
     29
    3130.nav-tab-active {
    3231    background-color: #008000;
  • hookywoo/tags/trunk/hookywoo-hooks-customizer.php

    r2133657 r2782841  
    11<?php
    2 if ( ! defined( 'ABSPATH' ) ) {
    3     exit; // Exit if accessed directly
    4 }
    52/**
    63 * Plugin Name: HookyWoo WooCommerce Hooks Customizer
    7  * Plugin URI: https://github.com/RidgeviewTech/HookyWoo-Pro/settings
    84 * Description: WYSIWYG Editor for WooCommerce Hooks
    9  * Author: Jason Robie
     5 * Author: Mad Cow Web Design
    106 * Author URI: https://madcowweb.com/
    11  * Version: 1.5.2
     7 * Version: 2.0.0
    128 *
    139 * This program is free software: you can redistribute it and/or modify
     
    2218 */
    2319
    24 /**
    25  * Check if WooCommerce is active
    26  **/
    27 if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
    28 
    2920class HookyWoo_Plugin {
    3021
    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        }
    3437
    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' );
    4442    }
    4543
    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' );
    4951
    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    }
    5754
    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        } ?>
    6072
    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">
    7674        <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>
    7775        <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">
    8181        <?php
    82           if( $active_tab == 'single_page_options' ) {
     82        if( $active_tab == 'single_page_options' ) {
    8383            settings_fields( 'single_product_page_section' );
    8484            do_settings_sections( 'single_product_page_section' );
    85           } elseif( $active_tab == 'shop_page_options' ) {
     85        } elseif( $active_tab == 'shop_page_options' ) {
    8686            settings_fields( 'shop_archive_page_section' );
    8787            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();
    9096        ?>
    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 }
    99100
    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() { ?>
    105114        <h1>Single Product Customization Section</h1>
    106         <h2 class="hookywoo">Custom Hook locations are highlighted in bold, green, italic font</h2>
    107115        <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() { ?>
    111118        <h1>Shop/Archive Page Customization Section</h1>
    112         <h2 class="hookywoo">Custom Hook locations are highlighted in bold, green, italic font</h2>
    113119        <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  }
    116129
    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    }
    123142
    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        }
    128157    }
    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   }
    142158}
    143159new HookyWoo_Plugin();
    144 }
  • hookywoo/tags/trunk/includes/hw-shop.php

    r1846609 r2782841  
    33    exit; // Exit if accessed directly
    44}
    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);
    1863
    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 }
     64require_once( 'loop-classes.php' );
     65$shop_loop = new Hooky_Loop_Class( $strings );
  • hookywoo/tags/trunk/includes/hw-single-product.php

    r1846609 r2782841  
    33    exit; // Exit if accessed directly
    44}
    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);
     79require_once( 'loop-classes.php' );
     80$shop_loop = new Hooky_Loop_Class( $strings );
  • hookywoo/tags/trunk/includes/shop-page-fields.php

    r1846609 r2782841  
    77    'uid' => 'before_shop_page_content',
    88    'label' => 'Before Shop Page Main Content',
     9    'helper' => '',
    910    'supplemental' => '*This text WILL appear outside of the page content',
    1011    'section' => 'shop_archive_page_section',
     
    1415    'uid' => 'shop_page_description',
    1516    'label' => 'Shop Page Description',
     17    'helper' => '',
     18    'supplemental' => '',
    1619    'section' => 'shop_archive_page_section',
    1720    'type' => 'textarea',
     
    2023    'uid' => 'before_loop_product_image',
    2124    'label' => 'Before Loop Product Image',
     25    'helper' => '',
    2226    'supplemental' => '*This text WILL interfere with the Sale Flash icon',
    2327    'section' => 'shop_archive_page_section',
     
    2731    'uid' => 'after_loop_product_image',
    2832    'label' => 'After Loop Product Image',
     33    'helper' => '',
    2934    'supplemental' => '*This text will be included in the product link',
    3035    'section' => 'shop_archive_page_section',
     
    3439    'uid' => 'after_loop_product_title',
    3540    'label' => 'After Loop Product Title',
     41    'helper' => '',
    3642    'supplemental' => '*This text will be included in the product link',
    3743    'section' => 'shop_archive_page_section',
     
    4147    'uid' => 'before_loop_product_cart_button',
    4248    'label' => 'Before Loop Product Cart Button',
     49    'helper' => '',
     50    'supplemental' => '',
    4351    'section' => 'shop_archive_page_section',
    4452    'type' => 'textarea',
     
    4755    'uid' => 'after_main_shop_content',
    4856    'label' => 'After Main Shop Content',
     57    'helper' => '',
     58    'supplemental' => '',
    4959    'section' => 'shop_archive_page_section',
    5060    'type' => 'textarea',
     
    5363foreach( $fields as $field ){
    5464    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'] );
    5666}
  • hookywoo/tags/trunk/includes/single-page-fields.php

    r2133657 r2782841  
    1 <?php 
     1<?php
    22if ( ! defined( 'ABSPATH' ) ) {
    33    exit; // Exit if accessed directly
    44}
    55$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    ),
    6078);
    6179foreach( $fields as $field ){
    6280    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'] );
    6482}
Note: See TracChangeset for help on using the changeset viewer.