Skip to content

Commit

Permalink
PIPRES-261: Payment attribute fix (#806)
Browse files Browse the repository at this point in the history
* PIPRES-261: Payment attribute fix

* changelog

* replaced getProducts to getCartProducts and product attribute array key
  • Loading branch information
mandan2 authored Sep 11, 2023
1 parent 3839a44 commit 1171d24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

# Changelog #

## Changes in release 6.0.4 ##
+ New payment method: Billie.
+ Enabled mixed cart for subscription orders. Various products could be coupled with a single subscription product.
+ Overall improvements and bug fixes.

## Changes in release 6.0.3 ##
+ High priority bug fix impacting product add to cart pop-up.

Expand Down
6 changes: 3 additions & 3 deletions subscription/Handler/SubscriptionCreationHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public function __construct(

public function handle(Order $order, string $method)
{
$products = $order->getProducts();
$products = $order->getCartProducts();
$subscriptionProduct = [];

foreach ($products as $product) {
if (!$this->subscriptionProductValidator->validate((int) $product['product_attribute_id'])) {
if (!$this->subscriptionProductValidator->validate((int) $product['id_product_attribute'])) {
continue;
}

Expand All @@ -65,7 +65,7 @@ private function createRecurringOrdersProduct(array $product): MolRecurringOrder
{
$recurringOrdersProduct = new MolRecurringOrdersProduct();
$recurringOrdersProduct->id_product = $product['id_product'];
$recurringOrdersProduct->id_product_attribute = $product['product_attribute_id'];
$recurringOrdersProduct->id_product_attribute = $product['id_product_attribute'];
$recurringOrdersProduct->quantity = $product['product_quantity'];
$recurringOrdersProduct->unit_price = $product['unit_price_tax_excl'];
$recurringOrdersProduct->add();
Expand Down

0 comments on commit 1171d24

Please sign in to comment.