Skip to content

[Issue] [Wishlist] Giving the possibility to set/update item description on item update #28261

Closed
@ghost

Description

This issue is automatically created based on existing pull request: #28222: [Wishlist] Giving the possibility to set/update item description on item update


Preconditions (*)

This PR improves the wishlist item update, by allowing to update the description while updating the wishlist item.

The problem occurs, when we want to set/update the item description in the same time when we update item's quantity, which doesn't seem to be supported for now.

Related Pull Requests

Fixed Issues (if relevant)

N/A

Steps to reproduce:

  1. Create a simple product;
  2. Log in on the storefront
  3. Add the simple product to wishlist
  4. Now, programmatically, try to update the quantity and the description for this item.
$wishlistId = 1;
$wishlistItemId = 1;

/** @var \Magento\Wishlist\Model\Wishlist $wishlist */
$wishlist = $objectManager->create(\Magento\Wishlist\Model\Wishlist::class);
$wishlistItemFactory = $objectManager->create(\Magento\Wishlist\Model\ItemFactory::class);
$wishlistItemResource = $objectManager->create(\Magento\Wishlist\Model\ResourceModel\Item::class);
$wishlist->load($wishlistId);

/** @var WishlistItem $wishlistItem */
$wishlistItem = $wishlistItemFactory->create();
$wishlistItemResource->load($wishlistItem, $wishlistItemId);
$wishlistItem->setDescription('My new description');
$wishlist->updateItem($wishlistItem, new \Magento\Framework\DataObject(['qty' => 777]));

Actual Result: ✖️ Quantity updated, but no description

screenshot_12

Expected Result: ✔️ Quantity and description updated

screenshot_13

Questions or comments

Looks like the description, is only used in case there is a new wishlist item created, which only happens if we're trying to update the item with some different options(custom options/super_attribute, etc) that are already added to wishlist.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

Labels

Component: CatalogComponent: WishlistFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions