Plugin Directory

Changeset 2237696


Ignore:
Timestamp:
02/03/2020 02:22:09 PM (6 years ago)
Author:
aplazame
Message:

tagging version 2.0.4

Location:
aplazame
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • aplazame/tags/2.0.4/README.txt

    r2227211 r2237696  
    55Tested up to: 5.3.2
    66Requires PHP: 5.3.0
    7 Stable tag: 2.0.3
     7Stable tag: 2.0.4
    88License: BSD-3-Clause
    99License URI: https://github.com/aplazame/woocommerce/blob/master/LICENSE
     
    7777
    7878== Changelog ==
     79
     80#### [v2.0.4](https://github.com/aplazame/woocommerce/tree/v2.0.4) (2020-02-03)
     81
     82* [FIX] Minor fixes.
    7983
    8084#### [v2.0.3](https://github.com/aplazame/woocommerce/tree/v2.0.3) (2020-01-14)
  • aplazame/tags/2.0.4/aplazame.php

    r2227211 r2237696  
    33 * Plugin Name: Aplazame
    44 * Plugin URI: https://github.com/aplazame/woocommerce
    5  * Version: 2.0.3
     5 * Version: 2.0.4
    66 * Description: Aplazame offers a payment method to receive funding for the purchases.
    77 * Author: Aplazame
     
    2626
    2727class WC_Aplazame {
    28     const VERSION      = '2.0.3';
     28    const VERSION      = '2.0.4';
    2929    const METHOD_ID    = 'aplazame';
    3030    const METHOD_TITLE = 'Aplazame';
  • aplazame/tags/2.0.4/i18n/languages/aplazame.pot

    r2227211 r2237696  
    77msgid ""
    88msgstr ""
    9 "Project-Id-Version: Aplazame v2.0.3\n"
     9"Project-Id-Version: Aplazame v2.0.4\n"
    1010"Report-Msgid-Bugs-To: https://github.com/aplazame/woocommerce\n"
    11 "POT-Creation-Date: 2020-01-14 15:17+0000\n"
     11"POT-Creation-Date: 2020-02-03 14:18+0000\n"
    1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  • aplazame/tags/2.0.4/lib/Aplazame/Aplazame/BusinessModel/Article.php

    r2057573 r2237696  
    1515
    1616    public static function createFromOrderItemArray( array $values ) {
    17         $productId = $values['product_id'];
    18         $product   = new WC_Product( $values['product_id'] );
    19 
     17        $product  = new WC_Product( $values['product_id'] );
     18        $quantity = (int) $values['qty'];
     19        $price    = $values['line_subtotal'] / $values['qty'];
    2020        $tax_rate = 100 * ( $values['line_tax'] / $values['line_total'] );
    2121
    22         $aArticle           = new self();
    23         $aArticle->id       = $productId;
    24         $aArticle->sku      = $product->get_sku();
    25         $aArticle->name     = $product->get_title();
    26         $aArticle->url      = $product->get_permalink();
    27         $aArticle->quantity = (int) $values['qty'];
    28         $aArticle->price    = Aplazame_Sdk_Serializer_Decimal::fromFloat( $values['line_subtotal'] / $values['qty'] );
    29         $aArticle->tax_rate = Aplazame_Sdk_Serializer_Decimal::fromFloat( $tax_rate );
    30 
    31         $description = WC_Aplazame::_m_or_m( $product, 'get_post', 'get_post_data' )->post_content;
    32         if ( ! empty( $description ) ) {
    33             $aArticle->description = $description;
    34         }
    35 
    36         $imageUrl = wp_get_attachment_url( get_post_thumbnail_id( $productId ) );
    37         if ( ! empty( $imageUrl ) ) {
    38             $aArticle->image_url = $imageUrl;
    39         }
    40 
    41         return $aArticle;
     22        return self::createArticle( $product, $quantity, $price, $tax_rate );
    4223    }
    4324
    4425    public static function createFromOrderItemProduct( WC_Order_Item_Product $item_product ) {
    45         $product  = $item_product->get_product();
     26        $product  = new WC_Product( $item_product->get_product_id() );
     27        $quantity = (int) $item_product->get_quantity();
     28        $price    = $item_product->get_subtotal() / $item_product->get_quantity();
    4629        $tax_rate = 100 * ( $item_product->get_total_tax() / $item_product->get_total() );
    4730
    48         $aArticle           = new self();
    49         $aArticle->id       = $product->get_id();
    50         $aArticle->sku      = $product->get_sku();
    51         $aArticle->name     = $product->get_title();
    52         $aArticle->url      = $product->get_permalink();
    53         $aArticle->quantity = (int) $item_product->get_quantity();
    54         $aArticle->price    = Aplazame_Sdk_Serializer_Decimal::fromFloat( $item_product->get_subtotal() / $item_product->get_quantity() );
     31        return self::createArticle( $product, $quantity, $price, $tax_rate );
     32    }
     33
     34    private static function createArticle( WC_Product $product, $quantity, $price, $tax_rate ) {
     35        $aArticle     = new self();
     36        $aArticle->id = $product->get_id() ? $product->get_id() : null;
     37
     38        $sku = $product->get_sku();
     39        if ( ! empty( $sku ) ) {
     40            $aArticle->sku = $sku;
     41        }
     42
     43        $aArticle->name     = $product->get_title() ? $product->get_title() : null;
     44        $aArticle->url      = $product->get_permalink() ? $product->get_permalink() : null;
     45        $aArticle->quantity = $quantity;
     46        $aArticle->price    = Aplazame_Sdk_Serializer_Decimal::fromFloat( $price );
    5547        $aArticle->tax_rate = Aplazame_Sdk_Serializer_Decimal::fromFloat( $tax_rate );
    5648
  • aplazame/trunk/README.txt

    r2227211 r2237696  
    55Tested up to: 5.3.2
    66Requires PHP: 5.3.0
    7 Stable tag: 2.0.3
     7Stable tag: 2.0.4
    88License: BSD-3-Clause
    99License URI: https://github.com/aplazame/woocommerce/blob/master/LICENSE
     
    7777
    7878== Changelog ==
     79
     80#### [v2.0.4](https://github.com/aplazame/woocommerce/tree/v2.0.4) (2020-02-03)
     81
     82* [FIX] Minor fixes.
    7983
    8084#### [v2.0.3](https://github.com/aplazame/woocommerce/tree/v2.0.3) (2020-01-14)
  • aplazame/trunk/aplazame.php

    r2227211 r2237696  
    33 * Plugin Name: Aplazame
    44 * Plugin URI: https://github.com/aplazame/woocommerce
    5  * Version: 2.0.3
     5 * Version: 2.0.4
    66 * Description: Aplazame offers a payment method to receive funding for the purchases.
    77 * Author: Aplazame
     
    2626
    2727class WC_Aplazame {
    28     const VERSION      = '2.0.3';
     28    const VERSION      = '2.0.4';
    2929    const METHOD_ID    = 'aplazame';
    3030    const METHOD_TITLE = 'Aplazame';
  • aplazame/trunk/i18n/languages/aplazame.pot

    r2227211 r2237696  
    77msgid ""
    88msgstr ""
    9 "Project-Id-Version: Aplazame v2.0.3\n"
     9"Project-Id-Version: Aplazame v2.0.4\n"
    1010"Report-Msgid-Bugs-To: https://github.com/aplazame/woocommerce\n"
    11 "POT-Creation-Date: 2020-01-14 15:17+0000\n"
     11"POT-Creation-Date: 2020-02-03 14:18+0000\n"
    1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  • aplazame/trunk/lib/Aplazame/Aplazame/BusinessModel/Article.php

    r2057573 r2237696  
    1515
    1616    public static function createFromOrderItemArray( array $values ) {
    17         $productId = $values['product_id'];
    18         $product   = new WC_Product( $values['product_id'] );
    19 
     17        $product  = new WC_Product( $values['product_id'] );
     18        $quantity = (int) $values['qty'];
     19        $price    = $values['line_subtotal'] / $values['qty'];
    2020        $tax_rate = 100 * ( $values['line_tax'] / $values['line_total'] );
    2121
    22         $aArticle           = new self();
    23         $aArticle->id       = $productId;
    24         $aArticle->sku      = $product->get_sku();
    25         $aArticle->name     = $product->get_title();
    26         $aArticle->url      = $product->get_permalink();
    27         $aArticle->quantity = (int) $values['qty'];
    28         $aArticle->price    = Aplazame_Sdk_Serializer_Decimal::fromFloat( $values['line_subtotal'] / $values['qty'] );
    29         $aArticle->tax_rate = Aplazame_Sdk_Serializer_Decimal::fromFloat( $tax_rate );
    30 
    31         $description = WC_Aplazame::_m_or_m( $product, 'get_post', 'get_post_data' )->post_content;
    32         if ( ! empty( $description ) ) {
    33             $aArticle->description = $description;
    34         }
    35 
    36         $imageUrl = wp_get_attachment_url( get_post_thumbnail_id( $productId ) );
    37         if ( ! empty( $imageUrl ) ) {
    38             $aArticle->image_url = $imageUrl;
    39         }
    40 
    41         return $aArticle;
     22        return self::createArticle( $product, $quantity, $price, $tax_rate );
    4223    }
    4324
    4425    public static function createFromOrderItemProduct( WC_Order_Item_Product $item_product ) {
    45         $product  = $item_product->get_product();
     26        $product  = new WC_Product( $item_product->get_product_id() );
     27        $quantity = (int) $item_product->get_quantity();
     28        $price    = $item_product->get_subtotal() / $item_product->get_quantity();
    4629        $tax_rate = 100 * ( $item_product->get_total_tax() / $item_product->get_total() );
    4730
    48         $aArticle           = new self();
    49         $aArticle->id       = $product->get_id();
    50         $aArticle->sku      = $product->get_sku();
    51         $aArticle->name     = $product->get_title();
    52         $aArticle->url      = $product->get_permalink();
    53         $aArticle->quantity = (int) $item_product->get_quantity();
    54         $aArticle->price    = Aplazame_Sdk_Serializer_Decimal::fromFloat( $item_product->get_subtotal() / $item_product->get_quantity() );
     31        return self::createArticle( $product, $quantity, $price, $tax_rate );
     32    }
     33
     34    private static function createArticle( WC_Product $product, $quantity, $price, $tax_rate ) {
     35        $aArticle     = new self();
     36        $aArticle->id = $product->get_id() ? $product->get_id() : null;
     37
     38        $sku = $product->get_sku();
     39        if ( ! empty( $sku ) ) {
     40            $aArticle->sku = $sku;
     41        }
     42
     43        $aArticle->name     = $product->get_title() ? $product->get_title() : null;
     44        $aArticle->url      = $product->get_permalink() ? $product->get_permalink() : null;
     45        $aArticle->quantity = $quantity;
     46        $aArticle->price    = Aplazame_Sdk_Serializer_Decimal::fromFloat( $price );
    5547        $aArticle->tax_rate = Aplazame_Sdk_Serializer_Decimal::fromFloat( $tax_rate );
    5648
Note: See TracChangeset for help on using the changeset viewer.