Plugin Directory

Changeset 1431417


Ignore:
Timestamp:
06/06/2016 12:37:43 PM (10 years ago)
Author:
JohnnyPea
Message:

v1.5.6

Location:
woocommerce-superfaktura/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-superfaktura/trunk/README.txt

    r1424201 r1431417  
    55Requires at least: 4.0
    66Tested up to: 4.5.2
    7 Stable tag: 1.5.5
     7Stable tag: 1.5.6
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6363
    6464== Changelog ==
     65
     66= 1.5.6 =
     67* Pridaná možnosť nastaviť si ako má vyzerať popis produktu vo faktúre
    6568
    6669= 1.5.5 =
  • woocommerce-superfaktura/trunk/class-wc-superfaktura.php

    r1424199 r1431417  
    2424     * @var     string
    2525     */
    26     protected $version = '1.5.5';
     26    protected $version = '1.5.6';
    2727
    2828    /**
     
    5555     */
    5656    protected $plugin_screen_hook_suffix = null;
     57
     58    /**
     59     * Default product description template
     60     * @var string
     61     */
     62    protected $product_description_template_default;
    5763
    5864    /**
     
    7480        //add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
    7581        add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
     82
     83        // backward compatibility with previous (now gone) option
     84        $this->product_description_template_default = '[ATTRIBUTES]' . ( 'yes' === get_option( 'woocommerce_sf_product_description_visibility', 'yes' ) ? "\n[SHORT_DESCR]" : '' );
    7685    }
    7786
     
    433442            $item_meta = new WC_Order_Item_Meta($item['item_meta']);
    434443
    435             $variation_desc = '';
    436             if($item_meta->meta)
    437               $variation_desc = $item_meta->display(true, true, '_', ', ');
    438 
    439444            $item_data = array(
    440445                'name'        => $item['name'],
     
    455460            $product = wc_get_product( $product_id );
    456461
    457             $item_data['description'] = $variation_desc;
    458 
    459             if ( get_option('woocommerce_sf_product_description_visibility') == 'yes' ) {
    460                 $item_data['description'] .= "\n".wp_strip_all_tags($product->get_post_data()->post_excerpt);
    461             }
     462            $attributes = $item_meta->meta ? $item_meta->display( true, true, '_', ', ' ) : '';
     463            $variation = $product instanceof WC_Product_Variation ? wp_strip_all_tags($product->get_variation_description()) : '';
     464            $short_descr = wp_strip_all_tags( $product->get_post_data()->post_excerpt );
     465            $template = get_option( 'woocommerce_sf_product_description', $this->product_description_template_default );
     466
     467            $item_data['description'] = strtr( $template, [
     468                '[ATTRIBUTES]' => $attributes,
     469                '[VARIATION]' => $variation,
     470                '[SHORT_DESCR]' => $short_descr,
     471                '[SKU]' => $product->get_sku(), // this may be different SKU that that above (in case of variable product)
     472            ] );
    462473
    463474            if ( $product->is_on_sale() )
     
    889900           array(
    890901                'title' => __('Product Description', 'wc-superfaktura'),
    891                 'id' => 'woocommerce_sf_product_description_visibility',
    892                 'type' => 'checkbox',
    893                 'desc' => 'Display a product description.',
    894                 'default' => 'yes'
     902                'desc' => sprintf(__('Available Tags: %s'), '[ATTRIBUTES], [VARIATION], [SHORT_DESCR], [SKU]'),
     903                'id' => 'woocommerce_sf_product_description',
     904                'css'   => 'width:50%; height: 75px;',
     905                'default' => $this->product_description_template_default,
     906                'type' => 'textarea',
    895907            ),
    896908            array(
  • woocommerce-superfaktura/trunk/wc-superfaktura.php

    r1424201 r1431417  
    1111 * Plugin URI:  http://www.platobnebrany.sk/
    1212 * Description: WooCommerce integrácia služby <a href="http://www.superfaktura.sk/api/">SuperFaktúra.sk</a> Máte s modulom technický problém? Napíšte nám na <a href="mailto:[email protected]">[email protected]</a>
    13  * Version:     1.5.5
     13 * Version:     1.5.6
    1414 * Author:      Webikon (Ján Bočínec)
    1515 * Author URI:  http://www.webikon.sk
Note: See TracChangeset for help on using the changeset viewer.