how to get the wish list item option in magento plugin
I used the event Observer
<event name="controller_action_predispatch_wishlist_index_remove"> <observer name="mytech_observer_wishlistremove" instance="Sanjay\Wish\Observer\Wishlistremovedispatch" /> </event>
Observer Code
public function execute(EventObserver $observer) { // $this->helper->log("wishlistremove", json_encode( get_class_methods($observer->getEvent()->getObservers()), JSON_PRETTY_PRINT)); try { $productId = ''; $item = $this->_request->getParam('item'); $wish_item = $observer->getEvent()->getItem(); if ($item) { // $this->helper->log("wishremove", "insdie wish remove item "); //Load product from wishlist item list $itemData = $this->wishlistItem->load($item); $qty = (int) $itemData->getQty(); $productId = $itemData->getProductId(); // // variant $this->helper->log("wishlistremove", __LINE__. json_encode($item ." = ". $productId, JSON_PRETTY_PRINT)); $catalogAttributes = $this->catalogConfig->getProductAttributes(); $wishlistAttributes = $this->attributeConfig->getAttributeNames($itemData); $wishremovevariant = array_merge($catalogAttributes, $wishlistAttributes); $wish_options = $this->_wishlOptionCollectionFactory->create()->addItemFilter($itemData); $wish_options->addFieldToFilter('code', 'attributes'); $this->helper->log("wishlistremove", __LINE__. json_encode($wish_options, JSON_PRETTY_PRINT)); }
so you can go ghetto and edit: nano app/code/Magento/Wishlist/Controller/Index/Cart.php or nano vendor/magento/module-wishlist/Controller/Index/Cart.php
depending on how you installed , then find (ctrl-w):
$item->addToCart($this->cart, true); and change it to
$item->addToCart($this->cart, false);
then restart php-fpm ( service php-fpm reload )
and try it out.
Then if you are successful, try to make a patch using a module!
Culver's Guest Satisfaction Survey
You got it?
1 On the Admin Panel, Stores > Settings > Configuration .
2 Under Customer , click Wish List tab.
3 Open the General Option section, choose Yes to enable the list.
@alisauxbpn4ecd wrote:so you can go ghetto and edit: nano app/code/Magento/Wishlist/Controller/Index/Cart.php or nano vendor/magento/module-wishlist/Controller/Index/Cart.php
depending on how you installed , then find (ctrl-w):
$item->addToCart($this->cart, true); and change it to
$item->addToCart($this->cart, false);
then restart php-fpm ( service php-fpm reload )
and try it out.
Then if you are successful, try to make a patch using a module! -> Five Nights at Freddy's
Culver's Guest Satisfaction Survey
You got it?
1. Go to Stores > Settings > Configuration > Customers > Wish List.
2. Fill in General Options.
Set Enable to Yes to make this option available in your store.
Choose whether you want to show the wishlist in the sidebar.
3. Configure the Share Options.
Select the Email Sender which defines the name that will appear in the emails.
Choose Email Template which is used when customers share their wishlists.
Note: Wish List Sharing template is set by default, but you can customize email templates and use your custom one.
Set the number of Max Emails Allowed to be Sent. The default number is 10, but you can modify it (max - 10000).
Define the Email Text Length Limit. It can vary from 250 to 10000, depending on how you set it.
4. Set the Display Wish List Summary in the My Wish List Link section, to display either number of items in the wishlist or item quantities.