I want to enable captcha on guest checkout in Magento 2.3.1. I am using one step checkout

I want to enable captcha on guest checkout in Magento 2.3.1. I am using the one-step checkout.

I know that it is a simple question and you can follow this nice article to do that: https://www.mageplaza.com/kb/how-to-enable-customer-login-register-captcha-magento-2.html

However, I believe that there is something wrong with my Magento installation and it is not showing me “Check out as guest” option in form section inside Captcha.

Can I enable “Check out as guest” option manually using the command line or terminal or FTP?

Magento 2 reindex error

Magento 2.2. Please can anyone help with this I am trying to run this in CLI

php bin/magento indexer:reindex catalogsearch_fulltext

Notice: getimagesize(): Read error! in /home/redjohnco/public_html/vendor/magento/module-catalog/Model/Product/Image.php on line 420 

I thought this issue would be bypass or resolved by switching from GD2 to ImageMagick

Magento 2 Create Shipping Method with Delivery Options

I created a new shipping method for home delivery and I want to be able to present options such as a building/unit/room number. My thought was when the user selected this method the options would appear with a text field for the user to enter information before moving to the payment page. Any guidance on the best way to make this happen?

This is in Model/Carrier

/**      * @param \Magento\Framework\App\Config\ScopeConfigInterface $  scopeConfig      * @param \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $  rateErrorFactory      * @param \Psr\Log\LoggerInterface $  logger      * @param \Magento\Shipping\Model\Rate\ResultFactory $  rateResultFactory      * @param \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $  rateMethodFactory      * @param array $  data      */     public function __construct(         \Magento\Framework\App\Config\ScopeConfigInterface $  scopeConfig,         \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $  rateErrorFactory,         \Psr\Log\LoggerInterface $  logger,         \Magento\Shipping\Model\Rate\ResultFactory $  rateResultFactory,         \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $  rateMethodFactory,         array $  data = []     ) {         $  this->_rateResultFactory = $  rateResultFactory;         $  this->_rateMethodFactory = $  rateMethodFactory;         $  this->_logger = $  logger;         parent::__construct($  scopeConfig, $  rateErrorFactory, $  logger, $  data);     }      /**      * @param RateRequest $  request      * @return \Magento\Shipping\Model\Rate\Result|bool      */     public function collectRates(RateRequest $  request)     {         if (!$  this->getConfigFlag('active')) {             return false;         }          /** @var \Magento\Shipping\Model\Rate\Result $  result */         $  result = $  this->_rateResultFactory->create();          $  shippingPrice = $  this->getConfigData('price');         $  method = $  this->_rateMethodFactory->create();         $  method->setCarrier($  this->_code);         $  method->setCarrierTitle($  this->getConfigData('title'));         $  method->setMethod($  this->_code);         $  method->setMethodTitle($  this->getConfigData('name'));         $  method->setPrice($  shippingPrice);         $  method->setCost($  shippingPrice);         $  result->append($  method);           return $  result;     }      /**      * @return array      */     public function getAllowedMethods()     {          return [$  this->_code=> $  this->getConfigData('name')];     } 

I tried to create checkout_index_index.xml and add a custom phtml page to it with

<script type="text/javascript">     require([         'jquery',         'Magento_Checkout/js/model/quote',     ], function (jQuery, quote) {         jQuery(document).ready(function () {             quote.shippingMethod.subscribe(function (value) {                 if (quote.shippingMethod() && quote.shippingMethod().carrier_code == 'your_custom_shipping_method_code') {                     var customBlock = "<div class ='custom-information'><input type="text" id="your_custom_id"></div>";                     if((!$  ('.custom-information').length > 0)) {                         $  ('#checkout-shipping-method-load').append(customBlock);                     }                 });             });         });     }); </script> 

And then I added in Model

namespace Magento\Checkout\Model;  class GuestShippingInformationManagement implements \Magento\Checkout\Api\GuestShippingInformationManagementInterface {     /**      * @var \Magento\Quote\Model\QuoteIdMaskFactory      */     protected $  quoteIdMaskFactory;      /**      * @var \Magento\Checkout\Api\ShippingInformationManagementInterface      */     protected $  shippingInformationManagement;      /**      * @param \Magento\Quote\Model\QuoteIdMaskFactory $  quoteIdMaskFactory      * @param \Magento\Checkout\Api\ShippingInformationManagementInterface $  shippingInformationManagement      * @codeCoverageIgnore      */     public function __construct(         \Magento\Quote\Model\QuoteIdMaskFactory $  quoteIdMaskFactory,         \Magento\Checkout\Api\ShippingInformationManagementInterface $  shippingInformationManagement     ) {         $  this->quoteIdMaskFactory = $  quoteIdMaskFactory;         $  this->shippingInformationManagement = $  shippingInformationManagement;     }      /**      * {@inheritDoc}      */     public function saveAddressInformation(         $  cartId,         \Magento\Checkout\Api\Data\ShippingInformationInterface $  addressInformation     ) {         /** @var $  quoteIdMask \Magento\Quote\Model\QuoteIdMask */         $  quoteIdMask = $  this->quoteIdMaskFactory->create()->load($  cartId, 'masked_id');         return $  this->shippingInformationManagement->saveAddressInformation(             $  quoteIdMask->getQuoteId(),             $  addressInformation         );     } } 

and started to modify it but I think I may be headed in the wrong direction,

Thoughts on the best way to accomplish this?

Thanks!

Magento 2.3.1 varnish and cloudlfare – pages not caching as expected

We have a Magento 2.3.1 store that uses CloudFlare and has Varnish enabled. If we use wget or curl to load a page, that page is cached in Varnish if we try wget or curl again on that same page.

However, if we then test that URL via a browser, the page is not cached. It is then cached after the first browser visit, and then remains cached on reloads from a browser.

We added the CF+Varnish rules as listed at: https://support.cloudflare.com/hc/en-us/articles/200169376-Can-I-use-Cloudflare-and-Varnish-together-

but that did not seem to make a difference. We’re using the recommended Magento default.vcl file that is generated.

Any ideas what could be stopping a wget/curl from loading a page into the Varnish cache such that any request from a browser would be served that cached page instead of causing Varnish to cache the page again?

Magento 2 include template with form in CMS Block

I have been struggling trying to put a template functionally working inside a CMS Block. When I put this code inside my CMS block the template is correctly implemented

{{block class="Experius\DonationProduct\Block\Donation\ListProduct" name="cms.donation.list" template="Experius_DonationProduct::donation.phtml"}} 

However , the template has a pop up window that comes up when you click a button, and that pop up has a form. The problem is that the pop up window does not comes up when its in the CMS block, its like if JS functions were not working.

The template is located in app/design/frontend/Vendor/Theme/Experius_DonationProduct/templates/donation.phtml its override from the original module. What can I do? Thank you and greetings!

Magento 2 MSI: How to set salable qty for product

When a user places an order for item A, qty 1, I want the order to ship to all the addresses in the user’s address book.

I am able to achieve all this. However, since I’m creating the shipments programmatically, I can set the qty for each shipped item, which results in the correct reduction in Qty Per Source. But the Salable qty always reduces by 1.

If there are 5 addresses in his address book, the salable qty should also reduce by 5 and not by 1.

How can I do this through code? Thanks

Magento cloud hosted M2 EE site compromised and got malware attack

Today i noticed in my client’s magento 2 cloud hosted enterprise edition site is compromised. In footer hacker added some link along with following url:

  <script src="https://write-cdn.com/mysiteurl/"></script> 

As i am maintaining their environment when i saw that link i was curious what is that. When i opened that link it first attempt it showed some JS related encrypted code so i got some doubt about it.

Did perform scan in tools like sucuri and foregenix to verify site is malware infected. Both scanner showed result clean but when i ran http://write-cdn.com/ in sucuri it gave me red alert that domain is blacklisted for malware activities.

I removed that code from mysite and performed Db scan by checking blocks, pages, core_config_data and few other tables. did check code using grep linux command to find out but didn’t find any clue.

I want to know how that code injected in site. I did check admin logs, magento logs, nginx logs. Also created magento support ticket but those guys just useless and giving zero information how someone entered that code. admin access is shared with 2 person and all have secure and 20 character special character password.

Is there any way i can track from where that malware code came?
Is there any tool or way i can quickly scan and monitor for magento?

Is there any way i check who changed into db directly like logging or something?

Any help would be appreciated.

Magento 2 grid filter(active filter) lost on page reload

I am using Webkul Marketplace ext. and they have issue on active filters.

after filtering whenever reloading the page or visiting other page and backing on the filter page then filter get losses and it opens normally(without any filter).

actually there is separate dashboard for the seller where sellers can manage orders,products etc.so these UI’s are some similarity like admin.

Snippet:-

After Filter:- it works as expected.

enter image description here

Revisiting on Filter Page:- Filter gets lossed and act as normally.

enter image description here

I R&D and they suggested to use “” used but no luck.

please help me to resolve this problem.