Skip to content

Commit 3e22dd0

Browse files
Merge branch '2.4-develop' into ACPT-1751
2 parents 28d3e02 + 84e4b7b commit 3e22dd0

File tree

18 files changed

+130
-28
lines changed

18 files changed

+130
-28
lines changed

app/code/Magento/ConfigurableProductGraphQl/Model/Wishlist/ChildSku.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,17 @@ public function resolve(
3636

3737
/** @var Product $product */
3838
$product = $value['model'];
39-
$optionProduct = $product->getCustomOption('simple_product')->getProduct();
4039

41-
return $optionProduct->getSku();
40+
/** to handle no child sku selected at add to wishlist time */
41+
$optionsArray = json_decode($product->getCustomOption('info_buyRequest')->getValue(), true);
42+
$superAttribute = $optionsArray['super_attribute'];
43+
$totalSelected = array_filter($superAttribute);
44+
45+
if (count($totalSelected) > 0) {
46+
$optionProduct = $product->getCustomOption('simple_product')->getProduct();
47+
return $optionProduct->getSku();
48+
} else {
49+
return "";
50+
}
4251
}
4352
}

app/code/Magento/CustomerGraphQl/etc/di.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
<item name="Magento\Customer\Model\Address" xsi:type="object">
3131
Magento\CustomerGraphQl\Model\Resolver\Cache\Customer\Address\TagsStrategy
3232
</item>
33-
<item name="Magento\Newsletter\Model\Subscriber" xsi:type="object">
34-
Magento\CustomerGraphQl\Model\Resolver\Cache\Subscriber\TagsStrategy
35-
</item>
3633
</argument>
3734
</arguments>
3835
</type>

app/code/Magento/CustomerGraphQl/etc/graphql/di.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,6 @@
176176
<item name="Magento\CustomerGraphQl\Model\Resolver\Customer" xsi:type="string">
177177
Magento\CustomerGraphQl\Model\Resolver\Cache\Customer\ResolverCacheIdentity
178178
</item>
179-
<item name="Magento\CustomerGraphQl\Model\Resolver\IsSubscribed" xsi:type="string">
180-
Magento\CustomerGraphQl\Model\Resolver\Cache\Subscriber\ResolverCacheIdentity
181-
</item>
182179
</argument>
183180
</arguments>
184181
</type>
@@ -208,9 +205,6 @@
208205
<item name="Magento\CustomerGraphQl\Model\Resolver\Customer" xsi:type="array">
209206
<item name="current_customer_id" xsi:type="string">Magento\CustomerGraphQl\Model\Resolver\CacheKey\FactorProvider\CurrentCustomerId</item>
210207
</item>
211-
<item name="Magento\CustomerGraphQl\Model\Resolver\IsSubscribed" xsi:type="array">
212-
<item name="parent_customer_entity_id" xsi:type="string">Magento\CustomerGraphQl\Model\Resolver\CacheKey\FactorProvider\ParentCustomerEntityId</item>
213-
</item>
214208
</argument>
215209
</arguments>
216210
</type>

app/code/Magento/CustomerGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ type Customer @doc(description: "Defines the customer name, addresses, and other
136136
date_of_birth: String @doc(description: "The customer's date of birth.")
137137
taxvat: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers).")
138138
id: Int @doc(description: "The ID assigned to the customer.") @deprecated(reason: "`id` is not needed as part of `Customer`, because on the server side, it can be identified based on the customer token used for authentication. There is no need to know customer ID on the client side.")
139-
is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter.") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\IsSubscribed")
139+
is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter.") @resolver(class: "\\Magento\\NewsletterGraphQl\\Model\\Resolver\\IsSubscribed")
140140
addresses: [CustomerAddress] @doc(description: "An array containing the customer's shipping and billing addresses.") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CustomerAddresses")
141141
gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2).")
142142
custom_attributes(attributeCodes: [ID!]): [AttributeValueInterface] @doc(description: "Customer's custom attributes.") @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\CustomAttributeFilter")

app/code/Magento/CustomerGraphQl/Model/Resolver/Cache/Subscriber/ResolverCacheIdentity.php renamed to app/code/Magento/NewsletterGraphQl/Model/Resolver/Cache/Subscriber/ResolverCacheIdentity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\CustomerGraphQl\Model\Resolver\Cache\Subscriber;
8+
namespace Magento\NewsletterGraphQl\Model\Resolver\Cache\Subscriber;
99

1010
use Magento\GraphQlResolverCache\Model\Resolver\Result\Cache\IdentityInterface;
1111

app/code/Magento/CustomerGraphQl/Model/Resolver/Cache/Subscriber/TagsStrategy.php renamed to app/code/Magento/NewsletterGraphQl/Model/Resolver/Cache/Subscriber/TagsStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\CustomerGraphQl\Model\Resolver\Cache\Subscriber;
8+
namespace Magento\NewsletterGraphQl\Model\Resolver\Cache\Subscriber;
99

1010
use Magento\Customer\Model\Customer;
1111
use Magento\Framework\App\Cache\Tag\StrategyInterface;

app/code/Magento/CustomerGraphQl/Model/Resolver/CacheKey/FactorProvider/ParentCustomerEntityId.php renamed to app/code/Magento/NewsletterGraphQl/Model/Resolver/CacheKey/FactorProvider/ParentCustomerEntityId.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\CustomerGraphQl\Model\Resolver\CacheKey\FactorProvider;
8+
namespace Magento\NewsletterGraphQl\Model\Resolver\CacheKey\FactorProvider;
99

1010
use Magento\Customer\Api\Data\CustomerInterface;
1111
use Magento\GraphQl\Model\Query\ContextInterface;

app/code/Magento/CustomerGraphQl/Model/Resolver/IsSubscribed.php renamed to app/code/Magento/NewsletterGraphQl/Model/Resolver/IsSubscribed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\CustomerGraphQl\Model\Resolver;
8+
namespace Magento\NewsletterGraphQl\Model\Resolver;
99

1010
use Magento\Customer\Api\Data\CustomerInterface;
1111
use Magento\Framework\App\ObjectManager;

app/code/Magento/CustomerGraphQl/Test/Unit/Model/Resolver/IsSubscribedTest.php renamed to app/code/Magento/NewsletterGraphQl/Test/Unit/Model/Resolver/IsSubscribedTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
declare(strict_types=1);
88

9-
namespace Magento\CustomerGraphQl\Test\Unit\Model\Resolver;
9+
namespace Magento\NewsletterGraphQl\Test\Unit\Model\Resolver;
1010

1111
use Magento\Customer\Api\Data\CustomerInterface;
12-
use Magento\CustomerGraphQl\Model\Resolver\IsSubscribed;
12+
use Magento\NewsletterGraphQl\Model\Resolver\IsSubscribed;
1313
use Magento\Framework\GraphQl\Config\Element\Field;
1414
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1515
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;

app/code/Magento/NewsletterGraphQl/composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
"magento/framework": "*",
1111
"magento/module-customer": "*",
1212
"magento/module-newsletter": "*",
13-
"magento/module-store": "*"
14-
},
15-
"suggest": {
16-
"magento/module-graph-ql": "*"
13+
"magento/module-store": "*",
14+
"magento/module-graph-ql": "*",
15+
"magento/module-graph-ql-resolver-cache": "*"
1716
},
1817
"license": [
1918
"OSL-3.0",

0 commit comments

Comments
 (0)