Changeset 2237696
- Timestamp:
- 02/03/2020 02:22:09 PM (6 years ago)
- Location:
- aplazame
- Files:
-
- 8 edited
- 1 copied
-
tags/2.0.4 (copied) (copied from aplazame/trunk)
-
tags/2.0.4/README.txt (modified) (2 diffs)
-
tags/2.0.4/aplazame.php (modified) (2 diffs)
-
tags/2.0.4/i18n/languages/aplazame.pot (modified) (1 diff)
-
tags/2.0.4/lib/Aplazame/Aplazame/BusinessModel/Article.php (modified) (1 diff)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/aplazame.php (modified) (2 diffs)
-
trunk/i18n/languages/aplazame.pot (modified) (1 diff)
-
trunk/lib/Aplazame/Aplazame/BusinessModel/Article.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
aplazame/tags/2.0.4/README.txt
r2227211 r2237696 5 5 Tested up to: 5.3.2 6 6 Requires PHP: 5.3.0 7 Stable tag: 2.0. 37 Stable tag: 2.0.4 8 8 License: BSD-3-Clause 9 9 License URI: https://github.com/aplazame/woocommerce/blob/master/LICENSE … … 77 77 78 78 == Changelog == 79 80 #### [v2.0.4](https://github.com/aplazame/woocommerce/tree/v2.0.4) (2020-02-03) 81 82 * [FIX] Minor fixes. 79 83 80 84 #### [v2.0.3](https://github.com/aplazame/woocommerce/tree/v2.0.3) (2020-01-14) -
aplazame/tags/2.0.4/aplazame.php
r2227211 r2237696 3 3 * Plugin Name: Aplazame 4 4 * Plugin URI: https://github.com/aplazame/woocommerce 5 * Version: 2.0. 35 * Version: 2.0.4 6 6 * Description: Aplazame offers a payment method to receive funding for the purchases. 7 7 * Author: Aplazame … … 26 26 27 27 class WC_Aplazame { 28 const VERSION = '2.0. 3';28 const VERSION = '2.0.4'; 29 29 const METHOD_ID = 'aplazame'; 30 30 const METHOD_TITLE = 'Aplazame'; -
aplazame/tags/2.0.4/i18n/languages/aplazame.pot
r2227211 r2237696 7 7 msgid "" 8 8 msgstr "" 9 "Project-Id-Version: Aplazame v2.0. 3\n"9 "Project-Id-Version: Aplazame v2.0.4\n" 10 10 "Report-Msgid-Bugs-To: https://github.com/aplazame/woocommerce\n" 11 "POT-Creation-Date: 2020-0 1-14 15:17+0000\n"11 "POT-Creation-Date: 2020-02-03 14:18+0000\n" 12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -
aplazame/tags/2.0.4/lib/Aplazame/Aplazame/BusinessModel/Article.php
r2057573 r2237696 15 15 16 16 public static function createFromOrderItemArray( array $values ) { 17 $product Id = $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']; 20 20 $tax_rate = 100 * ( $values['line_tax'] / $values['line_total'] ); 21 21 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 ); 42 23 } 43 24 44 25 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(); 46 29 $tax_rate = 100 * ( $item_product->get_total_tax() / $item_product->get_total() ); 47 30 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 ); 55 47 $aArticle->tax_rate = Aplazame_Sdk_Serializer_Decimal::fromFloat( $tax_rate ); 56 48 -
aplazame/trunk/README.txt
r2227211 r2237696 5 5 Tested up to: 5.3.2 6 6 Requires PHP: 5.3.0 7 Stable tag: 2.0. 37 Stable tag: 2.0.4 8 8 License: BSD-3-Clause 9 9 License URI: https://github.com/aplazame/woocommerce/blob/master/LICENSE … … 77 77 78 78 == Changelog == 79 80 #### [v2.0.4](https://github.com/aplazame/woocommerce/tree/v2.0.4) (2020-02-03) 81 82 * [FIX] Minor fixes. 79 83 80 84 #### [v2.0.3](https://github.com/aplazame/woocommerce/tree/v2.0.3) (2020-01-14) -
aplazame/trunk/aplazame.php
r2227211 r2237696 3 3 * Plugin Name: Aplazame 4 4 * Plugin URI: https://github.com/aplazame/woocommerce 5 * Version: 2.0. 35 * Version: 2.0.4 6 6 * Description: Aplazame offers a payment method to receive funding for the purchases. 7 7 * Author: Aplazame … … 26 26 27 27 class WC_Aplazame { 28 const VERSION = '2.0. 3';28 const VERSION = '2.0.4'; 29 29 const METHOD_ID = 'aplazame'; 30 30 const METHOD_TITLE = 'Aplazame'; -
aplazame/trunk/i18n/languages/aplazame.pot
r2227211 r2237696 7 7 msgid "" 8 8 msgstr "" 9 "Project-Id-Version: Aplazame v2.0. 3\n"9 "Project-Id-Version: Aplazame v2.0.4\n" 10 10 "Report-Msgid-Bugs-To: https://github.com/aplazame/woocommerce\n" 11 "POT-Creation-Date: 2020-0 1-14 15:17+0000\n"11 "POT-Creation-Date: 2020-02-03 14:18+0000\n" 12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -
aplazame/trunk/lib/Aplazame/Aplazame/BusinessModel/Article.php
r2057573 r2237696 15 15 16 16 public static function createFromOrderItemArray( array $values ) { 17 $product Id = $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']; 20 20 $tax_rate = 100 * ( $values['line_tax'] / $values['line_total'] ); 21 21 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 ); 42 23 } 43 24 44 25 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(); 46 29 $tax_rate = 100 * ( $item_product->get_total_tax() / $item_product->get_total() ); 47 30 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 ); 55 47 $aArticle->tax_rate = Aplazame_Sdk_Serializer_Decimal::fromFloat( $tax_rate ); 56 48
Note: See TracChangeset
for help on using the changeset viewer.