Plugin Directory

Changeset 2498331


Ignore:
Timestamp:
03/17/2021 10:41:18 PM (5 years ago)
Author:
wpharvest
Message:

Fixed bugs.

Location:
documents-for-woocommerce/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • documents-for-woocommerce/trunk/README.md

    r2497391 r2498331  
    1313## Changelog ##
    1414
     15### 1.0.2 ###
     16Bug fix
     17
     18### 1.0.1 ###
     19Bug fix
     20
    1521### 1.0.0 ###
    1622Released plugin
  • documents-for-woocommerce/trunk/assets/main.css

    r2497391 r2498331  
    4040    align-items: center;
    4141    justify-content: center;
    42     width: 20px;
     42    width: 40px;
     43    margin: 0;
    4344}
  • documents-for-woocommerce/trunk/documents-for-woocommerce.php

    r2497407 r2498331  
    124124            echo '<div id="documents_product_data" class="panel woocommerce_options_panel hidden">';
    125125
    126             woocommerce_wp_text_input( array(
    127                 'id'                => 'document_main_title',
    128                 'value'             => $tab_title,
    129                 'label'             => 'Documents Tab Title',
    130                 'description'       => 'This is the name of the tab shown on the frontend',
    131                 'desc_tip'          => true,
    132             ) );
     126                woocommerce_wp_text_input( array(
     127                    'id'                => 'document_main_title',
     128                    'value'             => $tab_title,
     129                    'label'             => 'Documents Tab Title',
     130                    'description'       => 'This is the name of the tab shown on the frontend',
     131                    'desc_tip'          => true,
     132                ) );
    133133
    134             $documents = get_post_meta( get_the_ID(), 'documents', true );
    135             if( $documents ){
    136                 $i = 1;
     134                $documents = get_post_meta( get_the_ID(), 'documents', true );
    137135                echo '<table class="widefat woocommerce_documents">';
    138136                    echo '<thead>';
     
    146144                    echo '</thead>';
    147145                    echo '<tbody>';
     146                    if( $documents ){
     147                        $i = 1;
    148148                        foreach( $documents as $key => $each_document ) {
    149149                            echo '<tr>';
     
    152152                            echo '</tr>';
    153153                        }
     154                    } else {
     155                        echo '<tr>';
     156                        include __DIR__ . '/templates/html-product-document.php';
     157                        echo '</tr>';
     158                    }
    154159                    echo '</tbody>';
    155160                echo '</table>';
    156161                echo '<a href="#" class="button add_doc_button">' . esc_html__( "Add document", "woocommerce" ) . '</a>';
    157             }
    158162
    159163            echo '</div>';
  • documents-for-woocommerce/trunk/readme.txt

    r2497692 r2498331  
    55Tested up to: 5.7
    66Requires PHP: 5.6
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.2
    88License: GNU General Public License v3.0
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1616Documents for WooCommerce allows you to add downloadable documents to products in WooCommerce and display them on the frontend under a separate tab.
    1717
     18Ideal for adding downloadable User Guides, User Manuals, Size Charts, etc to your product pages.
     19
    1820== Installation ==
    1921
     
    2325
    24261. Backend options
    25 2. Storefront example
     272. Backend options
     283. Backend options
     294. Storefront example
    2630
    2731== Changelog ==
     32
     33= 1.0.2 =
     34Bug fix
     35
     36= 1.0.1 =
     37Bug fix
    2838
    2939= 1.0.0 =
  • documents-for-woocommerce/trunk/templates/html-product-document.php

    r2497391 r2498331  
    77</td>
    88<td colspan="2">
    9     <input type="text" class="document_title" value="<?php echo $each_document["name"]; ?>" name="document_title[]" placeholder="File name">
     9    <input type="text" class="document_title" value="<?php echo isset($each_document) ? $each_document["name"] : ''; ?>" name="document_title[]" placeholder="File name">
    1010</td>
    1111<td colspan="2" class="file_url">
    12     <input type="text" class="document_url" value="<?php echo $each_document["url"]; ?>" name="document_url[]" placeholder="https://">
     12    <input type="text" class="document_url" value="<?php echo isset($each_document) ? $each_document["url"] : ''; ?>" name="document_url[]" placeholder="https://">
    1313</td>
    1414<td>
Note: See TracChangeset for help on using the changeset viewer.