Changeset 3425031
- Timestamp:
- 12/22/2025 04:53:47 AM (3 months ago)
- Location:
- mlm-soft-integration/trunk
- Files:
-
- 4 added
- 5 edited
-
CHANGELOG.md (modified) (1 diff)
-
integrations/woocommerce/interfaces (added)
-
integrations/woocommerce/interfaces/MLMSoftProductInterface.php (added)
-
integrations/woocommerce/models/order/MLMSoftWCOrder.php (modified) (6 diffs)
-
integrations/woocommerce/models/product/MLMSoftWCProduct.php (modified) (1 diff)
-
integrations/woocommerce/models/product/MLMSoftWCProductVariation.php (added)
-
integrations/woocommerce/paymentGateways/eWallet/modules/EWalletCouponModule.php (modified) (1 diff)
-
mlm-soft-integration.php (modified) (1 diff)
-
traits/ProductTrait.php (added)
Legend:
- Unmodified
- Added
- Removed
-
mlm-soft-integration/trunk/CHANGELOG.md
r3417136 r3425031 2 2 3 3 ## Changelog ## 4 5 ## 2025-12-17 - version 3.15.11 6 * Check the result of the `cancelOrder` function before proceeding. [EWalletCouponModule.php] 7 8 ## 2025-12-15 - version 3.15.10 9 * New feature: Added the ability to use product variations. 10 * Added `ProductTrait` class. [ProductTrait.php] 11 * Added `MLMSoftWCProductVariation` class. [MLMSoftWCProductVariation.php] 12 * Added `MLMSoftProductInterface` class. [MLMSoftProductInterface.php] 13 * Updated `MLMSoftWCProduct` class. [MLMSoftWCProduct.php] 14 * Updated `MLMSoftWCOrder` class. [MLMSoftWCOrder.php] 4 15 5 16 ## 2025-12-10 - version 3.15.9 -
mlm-soft-integration/trunk/integrations/woocommerce/models/order/MLMSoftWCOrder.php
r3390122 r3425031 3 3 namespace MLMSoft\integrations\woocommerce\models\order; 4 4 5 use Automattic\WooCommerce\Enums\ProductType; 5 6 use MLMSoft\core\MLMSoftPlugin; 6 7 use MLMSoft\core\models\user\MLMSoftLocalUser; … … 8 9 use MLMSoft\core\models\user\MLMSoftRemoteUser; 9 10 use MLMSoft\integrations\woocommerce\models\product\MLMSoftWCProduct; 11 use MLMSoft\integrations\woocommerce\models\product\MLMSoftWCProductVariation; 10 12 use MLMSoft\integrations\woocommerce\WCIntegration; 11 13 use MLMSoft\integrations\woocommerce\WCIntegrationOptions; … … 91 93 } 92 94 $mlmsoftPlugin = MLMSoftPlugin::getInstance(); 95 /** @disregard */ 93 96 $mlmsoftPlugin->api3->createDocument($documentName, $payload); 94 97 } … … 143 146 $documentPayload = apply_filters_ref_array(self::VOLUMES_DOCUMENT_PAYLOAD_FILTER, [$documentPayload, $this]); 144 147 148 /** @disregard */ 145 149 $mlmsoftPlugin->api3->createDocument($documentName, $documentPayload); 146 150 … … 262 266 foreach ($orderItems as $orderItem) { 263 267 $orderItemData = $orderItem->get_data(); 264 /** @var MLMSoftWCProduct $product */ 265 $product = new MLMSoftWCProduct(wc_get_product($orderItemData['product_id'])); 268 269 /** 270 * Usage product variations. 271 * 272 * @since 3.15.10 273 */ 274 if ( (int) $orderItemData['variation_id'] > 0 ) { 275 /** @var MLMSoftWCProductVariation $product */ 276 $product = new MLMSoftWCProductVariation( wc_get_product_object(ProductType::VARIATION, $orderItemData['variation_id']) ); 277 } else { 278 /** @var MLMSoftWCProduct $product */ 279 $product = new MLMSoftWCProduct(wc_get_product($orderItemData['product_id'])); 280 } 281 266 282 $quantity = $orderItem->get_quantity(); 267 283 $price = $product->get_price(null); … … 462 478 // 463 479 foreach( $this->get_items('line_item') as $orderItem ) { 464 /** @disregard */ 465 $product = new MLMSoftWCProduct($orderItem->get_product_id()); 480 $orderItemData = $orderItem->get_data(); 481 482 /** 483 * Usage product variations. 484 * 485 * @since 3.15.10 486 */ 487 if ( (int) $orderItemData['variation_id'] > 0 ) { 488 /** @var MLMSoftWCProductVariation $product */ 489 $product = new MLMSoftWCProductVariation( wc_get_product_object(ProductType::VARIATION, $orderItemData['variation_id']) ); 490 } else { 491 /** @var MLMSoftWCProduct $product */ 492 $product = new MLMSoftWCProduct(wc_get_product($orderItemData['product_id'])); 493 } 494 466 495 $volumeSum += (float) $product->getVolume($alias) * $orderItem->get_quantity(); 467 496 } -
mlm-soft-integration/trunk/integrations/woocommerce/models/product/MLMSoftWCProduct.php
r2973671 r3425031 3 3 namespace MLMSoft\integrations\woocommerce\models\product; 4 4 5 // Exit if accessed directly 6 if ( ! defined( 'ABSPATH' ) ) { 7 exit; 8 } 9 10 use WC_Product; 11 use MLMSoft\traits\ProductTrait; 5 12 use MLMSoft\integrations\woocommerce\WCIntegration; 6 use MLMSoft\integrations\woocommerce\WCIntegrationOptions; 7 use WC_Product; 13 use MLMSoft\integrations\woocommerce\interfaces\MLMSoftProductInterface; 8 14 9 class MLMSoftWCProduct extends WC_Product 15 /** 16 * @since 3.15.10 17 */ 18 class MLMSoftWCProduct extends WC_Product implements MLMSoftProductInterface 10 19 { 11 public function getVolumes() 20 use ProductTrait; 21 22 /** 23 * Constructor. 24 */ 25 public function __construct( $product = 0 ) 12 26 { 13 $productVolumeFields = WCIntegrationOptions::getInstance()->volumeProductFields; 14 $result = []; 15 16 foreach ($productVolumeFields as $field) { 17 $propertyAlias = $field['volumeProperty']; 18 $value = $this->getVolume($propertyAlias); 19 $result[$propertyAlias] = $value; 27 parent::__construct( $product ); 28 if ( $product instanceof WC_Product ) { 29 $this->originType = $product->get_type(); 20 30 } 21 22 return $result;23 31 } 24 32 25 33 public function getVolume($alias) 26 34 { -
mlm-soft-integration/trunk/integrations/woocommerce/paymentGateways/eWallet/modules/EWalletCouponModule.php
r3417136 r3425031 128 128 * 129 129 * @since 3.11.0 130 * @since 3.15.10 Check the result of the `cancelOrder` function before proceeding. 130 131 */ 131 $this->cancelOrder($code); 132 return; 132 if ( $this->cancelOrder($code) ) { 133 return; 134 } 133 135 } 134 136 -
mlm-soft-integration/trunk/mlm-soft-integration.php
r3417136 r3425031 4 4 Plugin Name: MLM Soft Integration 5 5 Description: WP integration with mlm-soft.com cloud platform 6 Version: 3.15. 96 Version: 3.15.11 7 7 Author: MLM Soft Ltd. 8 8 Author URI: https://mlm-soft.com
Note: See TracChangeset
for help on using the changeset viewer.