magento2.2 – JavaScript error (Uncaught TypeError: $.initNamespaceStorage is not a function)

we are running a Magento multi site and on ONE site only, I get this error
Uncaught TypeError: $.initNamespaceStorage is not a function

All sites use the same theme (juste some differences between them…), any clues ?

Thank you for helping me
Here is the script

require.config({
deps: (
‘jquery’,
‘mage/translate’,
‘jquery/jquery-storageapi’
),
callback: function ($) {
‘use strict’;

var dependencies = (),
versionObj;

$.initNamespaceStorage(‘mage-translation-storage’);
$.initNamespaceStorage(‘mage-translation-file-version’);
versionObj = $.localStorage.get(‘mage-translation-file-version’);

if (versionObj.version !== ‘92817ddfc8670bafd7f41084a570359ae57c4623’) {
dependencies.push(
‘text!js-translation.json’
);

}

require.config({
deps: dependencies,
callback: function (string) {
if (typeof string === ‘string’) {
$.mage.translate.add(JSON.parse(string));
$.localStorage.set(‘mage-translation-storage’, string);
$.localStorage.set(
‘mage-translation-file-version’,
{
version: ‘92817ddfc8670bafd7f41084a570359ae57c4623’
}
);
} else {
$.mage.translate.add($.localStorage.get(‘mage-translation-storage’));
}
}
});
}
});

{
    "*": {
        "mage/cookies": {
            "expires": null,
            "path": "/",
            "domain": ".www.punch-power.com",
            "secure": false,
            "lifetime": "3600"
        }
    }
}</script> 

magento2.2 – Magento 2 – Order Hold from frontend

From the Magento admin panel, user can update the status of an order to On Hold. Is there a way out for authorized admins to mark the order
as hold from frontend.

if ($order->canHold()) {
    $order->setState("holded")->setStatus("holded");
    $order->save();
}

Reference

protected $orderManagement;
public  function __construct(
    MagentoSalesApiOrderManagementInterface $orderManagement
)
{
    $this->orderManagement = $orderManagement;
}
public function canChangetoHold()
{

    try {
        $this->orderManagement->hold(10); //10 is order id

    } catch (MagentoFrameworkExceptionLocalizedException $e) {
        // some error
        $e->getMessage();
    } catch (Exception $e) {
        //You have not put the order on hold
    }
}

For example – An authorized admin could login as customer and mark orders as on hold so that it can’t be stopped for further processing.

magento2.2 – Why Google can no longer find my homepage when I do a google search but in Google search console finds the URL and reports no issues

My website which is on a Magento 2.3 platform has ranked on the 1st page of Google around the number 4 position for several years so I know it functions well and is properly optimised. A week ago a 3rd party added 250 new products using a feed from a spreadsheet and FDP for the pictures. I also removed some categories from the homepage as the associated products were no longer being sold.

Google can no longer find my homepage when I do a google search although it lists many other pages from the website but not the actual homepage.. I have performed a Google search on the actual Homepage URL and it doesn’t find it. Google search console however finds the URL and reports no issues.
Any ideas how to fix this issue.
Thanks

magento2.2 – M2.2 | Button that can add multiple individual products to the cart all at once?

In short, we are looking for the ability to have a customizable button (be it through js, small module or whatever) to where we can have a button that would infact add multiple individual products to the customers cart via one click of the button, i.e. adding Product A, Product B and Product C with one click, rather than clicking each Add to Cart button individually.

After some googling, we can’t find this exact functionality anywhere and wonder if this is possible be it a basic js entry or via its own little module.

magento2.2 – Global Payments Realex 511 Redirect Issue Magento 2.2.2 HPP

I am using this module for Global Payments / Realex Payments for Magento 2.2.2 store form Magento Marketplace

"name" : "realexpayments/hpp",
"description" : "A Magento 2 module for Global Payments HPP payments",
"type" : "magento2-module",
"version" : "2.0.0",

Using Hosted Payment Page in One Step Checkout – Embedded HPP

After user completes a successful transaction they are not being correctly redirected to the correct url page and the order is not showing in my admin emails – been having this problem for months now with no help from Global Payments at all – very frustrated they not answering calls or emails!

I am unable to process the order and complete it. And get confused as to payed orders and failed already sent out several orders when they were no payed for by mistake because of this problem

If we select other payment options such as Bank Transfer the order and emails goes through fine and it redirects user to success page

https://www.mydomain.co.uk/checkout/onepage/success/

I get instead emails see below

wirelessbridges / 511 Alerts

Please be advised the following alert(s) appeared on our system as we were unable to connect to your response page.
Time Account Order ID URL / IP
https://www.mydomain.co.uk/realexpayments_hpp/process/result

Explanation of this alert in more detail:
As you are using the Hosted Payments Page, this means that your customer is redirected to a secure payment page hosted on the Global Payments servers to enter their card details.
Once the transaction is processed, we return the transaction response – and your customer – to a nominated response page on your servers.
In this instance we could not connect with your response page to notify you of the transaction response, and so this alert was generated.
What do you need to do?
This particular transaction may have been successfully authorised but as we could not connect to your response page, it is important that you check the status of this transaction to ensure no orders are missed. The RealControl reporting tool can be used to check the status of this transaction.
Why does this happen?
As all communication with your response page happens via the open channels of the internet, connections can be dropped from time to time which will result in a 511 alert.
A high incidence of 511 alerts may indicate an issue with your response page and may warrant further investigation.
If this occurs, Global Payments can enable logging on your transactions, which will allow us to get more information around the response received from your particular server, which may help determine the source of the problem.
Additional Configuration Information:
We recommend you set Success and Failure text which will be displayed to the customer in the event we can’t connect back to your response page by navigating to the Client Settings section of RealControl.
Kind regards,
Global Payments ECOM Support

I am unable to upgrade to Magento 2.3 or higher because the site has many extensions and personalisation which is not yet compatible – and the extension version HPP 2.0.0 is the only one we can install on Magento 2.2.2 Please help this is nightmare

magento2.2 – Upgrading from 2.2.5 to 2.2.6: Fatal error: Interface ‘LaminasServiceManagerAbstractFactoryInterface’ not found

Im trying to upgrade a Magento 2 site from 2.2.2 to the latest 2.3. I’ve got up to 2.2.5 so far without issues.

When moving from 2.2.5 to 2.2.6 I am getting a fatal error when running php bin/magento setup:di:compile

Fatal error:  Interface 'LaminasServiceManagerAbstractFactoryInterface' not found in /var/www/html/setup/src/Zend/Mvc/Controller/LazyControllerAbstractFactory.php

I’ve added the Zend\Mvc\Controller line to the autoload PSR-4 section in the composer.json file as suggested elsewhere on the internet.

Here’s the steps I follow to update (from a working 2.2.5):

php bin/magento maintenance:enable
composer require magento/product-community-edition 2.2.6 --no-update
composer update
composer dumpautoload
rm -rf var/cache/* var/page_cache/* generated/code/*
php bin/magento setup:upgrade
composer dumpautoload
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento maintenance:disable

Its at the php bin/magento setup:di:compile step where I get the fatal error.

AFAICT the Laminas ServiceManager AbstractFactoryInterface isn’t anywhere in the Vendor dir.

Can anyone shed any light on this?

magento2.2 – M2.2: Using REST API, Can Clear Cart but Mini-Cart Not Clearing

We are currently integrating another checkout portal to go on top of our existing Magento 2 platform. They are using the REST API to do most of their calls to Magento 2, including that of clearing the cart. When clearing the cart on the portal, it will clear it fully, and when coming back to the Magento 2 side, the cart will be empty, however the Mini-Cart will still be populated with all the items that we’re previously there before being cleared.

They are using the specific endpoint:

DELETE method : rest/V1/carts/mine/items/#ITEM_ID#

However they have not found any other means of clearing the cart, and using the above results in the mentioned issue of the mini cart still being populated.

I have done a little research and found that it appears the mini-cart information stays due to being stored in local storage. It is mentioned to try using;

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$cartObject = $objectManager->create('MagentoCheckoutModelCart')->truncate();
$cartObject->saveQuote();

or

$cart->truncate()->save();
Where $cart is an instance of MagentoCheckoutModelCart.

However I wouldn’t know where to make those above changes, nor aware if that will achieve the result of having both carts emptied when they use the DELETE method endpoint. Is there a different method I should have them use to clear both the cart and mini-cart while just having access to the REST API endpoints? Or something I can change on my end that will clear it for them when the endpoint is called, like hooking into the above API method and truncate the mini-cart from the Magento 2 code?

magento2.2 – M2.2: Using REST API, Can Clear Cart but Mini-Cart Not Clearing

We are currently integrating another checkout portal to go on top of our existing Magento 2 platform. They are using the REST API to do most of their calls to Magento 2, including that of clearing the cart. When clearing the cart on the portal, it will clear it fully, and when coming back to the Magento 2 side, the cart will be empty, however the Mini-Cart will still be populated with all the items that we’re previously there before being cleared.

They are using the specific endpoint:

DELETE method : rest/V1/carts/mine/items/#ITEM_ID#

However they have not found any other means of clearing the cart, and using the above results in the mentioned issue of the mini cart still being populated.

I have done a little research and found that it appears the mini-cart information stays due to being stored in local storage. It is mentioned to try using;

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$cartObject = $objectManager->create('MagentoCheckoutModelCart')->truncate();
$cartObject->saveQuote();

or

$cart->truncate()->save();
Where $cart is an instance of MagentoCheckoutModelCart.

However I wouldn’t know where to make those above changes, nor aware if that will achieve the result of having both carts emptied when they use the DELETE method endpoint. Is there a different method I should have them use to clear both the cart and mini-cart while just having access to the REST API endpoints? Or something I can change on my end that will clear it for them when the endpoint is called, like hooking into the above API method and truncate the mini-cart from the Magento 2 code?

magento2.2 – Magento2 Authorize.net Module Issue

In magento 2.2.7, Authorize.net payment throwing below error while clicking place order,

in live mode – Error getting valid response from api. Check log file for error details and in sandbox mode – User authentication failed due to invalid authentication values. (I have verified the sandbox credentials).

on further debug, I found below error is throwing on live mode
the input data of type “boolean” did not convert to an array, but got a result of type “boolean”

We are using https://marketplace.magento.com/authorizenet-magento-module-authorizenet.html module.

Can anyone help me on this. Thanks.

magento2.2 – Shipping Method – Hide on frontend

I have an option on a web store to order a sample of a product/s and it is shipped for free. To call this method, free shipping needs to be enabled as this was what is programmed:

if ($onlySample === true && $carrierCode == ‘freeshipping’) {
if (false !== $result) {
foreach ($result->getAllRates() as $resultMethod) {
if ($carrierCode == $resultMethod->getMethod() && $carrierCode == ‘freeshipping’) {
$resultMethod->setMethodTitle(‘Free Shipping’);
$resultMethod->setCarrierTitle(‘Free Shipping’);
$resultMethod->setTitle(‘Free Shipping’);
}
}
} else {
return $this;
}
}
if ($onlySample === true && $carrierCode != ‘freeshipping’) {
return $this;
}
$this->getResult()->append($result);
}
return $this;
}

When Free Shipping is NOT enabled, this function doesn’t work at all. When it is enabled, this function works but then it also shows the Free Shipping method on frontend regardless of the order type.

What is best practice to fix this?