magento2 – Magento 2 USPS throws error on frontend

I have a Magento 2.3.4 site running. UPS Shipping calculates shipping costs correctly on front-end checkout, however, USPS returns an error. I have set debug to “on” and the error logs say that my user name and password are incorrect but this is not the case. I can log into usps.com fine with these creds and they also worked on on my old Magento 1.9.3 site.

I’ve found this question posted online in various places but haven’t found an answer other than review the logs. But these are inconclusive so far.

Does anyone know any tips to get this working? My customers used USPS 9/10 on my Mage1.9 site so Id like to get it running.

Below is the latest entry to the shipping error log.

(2020-06-02 01:04:54) main.ERROR: '401 Unauthorized' () ()
(2020-06-02 01:04:54) main.DEBUG: array (
  'request' => '<?xml version="1.0" encoding="UTF-8"?>
<RateV4Request USERID="****"><Revision>2</Revision><Package ID="0"><Service>ALL</Service><ZipOrigination>94707</ZipOrigination><ZipDestination>94544</ZipDestination><Pounds>2</Pounds><Ounces>0.0000000000</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Machinable>true</Machinable></Package></RateV4Request>
',
  'result' => '<?xml version="1.0" encoding="UTF-8"?>
<Error><Number>80040B1A</Number><Description>Authorization failure.  Perhaps username and/or password is incorrect.</Description><Source>USPSCOM::DoAuth</Source></Error>',
) () ()
(2020-06-02 01:14:03) main.ERROR: '401 Unauthorized' () ()
(2020-06-02 01:14:03) main.DEBUG: array (
  'request' => '<?xml version="1.0" encoding="UTF-8"?>
<RateV4Request USERID="****"><Revision>2</Revision><Package ID="0"><Service>ALL</Service><ZipOrigination>94707</ZipOrigination><ZipDestination>94544</ZipDestination><Pounds>2</Pounds><Ounces>0.0000000000</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Machinable>true</Machinable></Package></RateV4Request>
',
  'result' => '<?xml version="1.0" encoding="UTF-8"?>
<Error><Number>80040B1A</Number><Description>Authorization failure.  Perhaps username and/or password is incorrect.</Description><Source>USPSCOM::DoAuth</Source></Error>',
) () ()
(2020-06-02 01:14:57) main.ERROR: '401 Unauthorized' () ()
(2020-06-02 01:14:57) main.DEBUG: array (
  'request' => '<?xml version="1.0" encoding="UTF-8"?>
<RateV4Request USERID="****"><Revision>2</Revision><Package ID="0"><Service>Priority</Service><ZipOrigination>94707</ZipOrigination><ZipDestination>94544</ZipDestination><Pounds>2</Pounds><Ounces>0.0000000000</Ounces><Container>PADDED FLAT RATE ENVELOPE</Container><Size>REGULAR</Size><Machinable>true</Machinable></Package></RateV4Request>
',
  'result' => '<?xml version="1.0" encoding="UTF-8"?>
<Error><Number>80040B1A</Number><Description>Authorization failure.  Perhaps username and/or password is incorrect.</Description><Source>USPSCOM::DoAuth</Source></Error>',
) () ()
(2020-06-02 01:16:43) main.ERROR: '401 Unauthorized' () ()
(2020-06-02 01:16:43) main.DEBUG: array (
  'request' => '<?xml version="1.0" encoding="UTF-8"?>
<RateV4Request USERID="****"><Revision>2</Revision><Package ID="0"><Service>ALL</Service><ZipOrigination>94707</ZipOrigination><ZipDestination>94544</ZipDestination><Pounds>2</Pounds><Ounces>0.0000000000</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Machinable>false</Machinable></Package></RateV4Request>
',
  'result' => '<?xml version="1.0" encoding="UTF-8"?>
<Error><Number>80040B1A</Number><Description>Authorization failure.  Perhaps username and/or password is incorrect.</Description><Source>USPSCOM::DoAuth</Source></Error>',
) () ()

Thanks

Here is a screenshot of my backend confs

How can I add prefix in magento 2 Category/Product ur?

This is development url : http://www.neplyn.in/mage2/

http://www.neplyn.in/mage2/best-sellers

I want to add prefix ‘collection’ just before the best-sellers .

I need to the same things in the product url too.

How can i do this ?

magento 1.9 – Creating XML RPC method in customer module

I am creating a rpc method in the local customer module. But I am getting invalid path error. After hours of debugging also I am not able to figure out the missing portion. I was able to create in my local sales module but somehow its failing here.

In local/Mycompany/Customer/etc/api.xml :

<config>
<api>
    <resources>
        <customer translate="title" module="mycompany_customer">
            <model>mycompany_customer/customer_api</model>
            <title>Customer API</title>
            <acl>customer</acl>
            <methods>
                <setCustomerWhatsappStatus translate="title" module="customer">
                    <title>Set whatsapp status for customer</title>
                    <acl>customer/setCustomerWhatsappStatus</acl>
                </setCustomerWhatsappStatus> 
            </methods>
            <faults module="mycompany_sales">
                <data_invalid>
                    <code>103</code>
                    <message>Invalid data given. Details in error message.</message>
                </data_invalid>
            </faults>
        </customer>
    </resources>
    <acl>
        <resources>
            <customer translate="title" module="mycompany_customer">
                <title>Customer</title>
                <sort_order>1</sort_order>
                <setCustomerWhatsappStatus translate="title" module="mycompany_customer">
                    <title>Set whatsapp status for customer</title>
                 </setCustomerWhatsappStatus>
            </customer>
        </resources>
    </acl>
</api>

And in my local/Mycompany/Customer/Model/Customer/Api.php :

<?php

class Mycompany_Customer_Model_Customer_Api extends Mage_Customer_Model_Customer_Api
{
    public function setMethod($phone) {
       Mage::log($phone);
    }
}

And I am calling this method with dbaux_customer_customer.setCustomerWhatsappStatus but get Invalid Path error meaning that its not able to reach the method mentioned.

Please let me know if I missed something.

Getting a TypeError: this.addressValidator.message is undefined after updating to Magento 2.3.5-p1

I just updated to Magento 2.3.5-p1 and when I try to checkout, I get the following error:

TypeError when trying to checkout

It seems to be caused by the Vertex Address validation but it’s not even active. How do I fix this error?

Thanks

Magento 1 – how to check if product page is opened from search page results?

I’ve working on analytics.
I am having some difficulty to have an idea
if product is opened from search page or not.
How can i determine it ?

Thoughts are appreciated.

Magento 2.3 Layered Navigation change subcategory url

can I change subnavigation subcategory urls to SEO friendly?

if so how?

ie:

existing = store.com/apparel.html?cat=4

desired = store.com/apparel/shirts.html

Any help would be appreciated.

Thanks.

magento2 – Does magento 2 have built in timing component like symfony stopwatch?

Does magento 2 have a built in timer component like Symfony Stopwatch?

https://symfony.com/doc/current/components/stopwatch.html

Would be useful for console commands / cron tasks.

I’m aware that I can load things in but wondered if something already exists and I try not to reinvent the wheel.

I’ve had a quick scan of the codebase and can’t find anything obvious.

magento2 – Magento 2 Custom Data Provider Listing

I’m trying to use the model in magento to show a listing of a custom table within my module. The model works and shows the listing table in the model. I can see that the get request is getting data, but it appears to be in an incorrect format. I have tested first with an example from the Magento documentation that set the data in the file UI/Component/CustomDataProvider.php as follows.

/**
 * Get data
 *
 * @return array
 */
public function getData()
{
    return (
        'items' => (
            (
                'id' => 1,
                'name' => 'First Item'
            ),
            (
                'id' => 2,
                'name' => 'Second Item'
            ),
            (
                'id' => 3,
                'name' => 'Third Item'
            )
        ),
        'totalRecords' => 3
    );
}

This populates the form as expected. After this I have tried to manipulate the file to show data from my custom table. The code is as follow:

<?php

declare(strict_types=1);

namespace DsssolutionsManagementUiComponentListing;

use DssSolutionsManagementModelResourceModelVendorProductsCollectionFactory;
use MagentoFrameworkAppRequestDataPersistorInterface;
use MagentoFrameworkViewElementUiComponentDataProviderDataProvider;

/**
 * Class CustomDataProvider
 */
class CustomDataProvider extends MagentoUiDataProviderAbstractDataProvider
//class CustomDataProvider extends DataProvider
{
protected $dataPersistor;

protected $collection;

protected $loadedData;

/**
 * Constructor
 *
 * @param string $name
 * @param string $primaryFieldName
 * @param string $requestFieldName
 * @param CollectionFactory $collectionFactory
 * @param DataPersistorInterface $dataPersistor
 * @param array $meta
 * @param array $data
 */
public function __construct(
    $name,
    $primaryFieldName,
    $requestFieldName,
    CollectionFactory $collectionFactory,
    DataPersistorInterface $dataPersistor,
    array $meta = (),
    array $data = ()
) {
    $this->collection = $collectionFactory->create();
    $this->dataPersistor = $dataPersistor;
    parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
}

/**
 * Get data
 *
 * @return array
 */
public function getData()
{
    if (isset($this->loadedData)) {
        return $this->loadedData;
    }

    $items = $this->collection->getItems();
    foreach ($items as $model) {
        $this->loadedData($model->getId()) = $model->getData();
    }

    $data = $this->dataPersistor->get('dsssolutions_management_vendorproducts');

    if (!empty($data)) {
        $model = $this->collection->getNewEmptyItem();
        $model->setData($data);
        $this->loadedData($model->getId()) = $model->getData();
        $this->dataPersistor->clear('dsssolutions_management_vendorproducts');
    }

    //return $this->loadedData;
    return array('totalRecords' => $this->collection->count(), 'items' => $this->loadedData);
}
}

This does not populate the form and give the message “No data found” while I do see data in the request. The difference I see between the Magento 2 example and the data from my script is that the items in the get is in my example an object. I believe that this is the root cause, but do not understand how to change this.

Outcome get with preset data
Example outcome

Outcome with my script
My outcome

Hopefully somebody can help me to understand what I need to change to get the products displaying in the listing.

PS I noticed that when I filter on name I also don’t get results, but when I disable the filter again I do get 2221 lines in the table, but all with the same name.

Thanks in advance.

Magento 1.9 Custom extension not displaying block in product view

I have been trying to display a custom template in the product view page in a simple extension but it only works for some references: product.info.additional, product.info.extrahint, product.tooltip and product.info.addtocart.

My app/design/frontend/base/default/layout/productest.xml looks like this. I m trying to display a simple text now but to no success:

<?xml version="1.0"?>
<layout version="0.1.0">
  <catalog_product_view>
    <reference name="product.info">
        <block type="core/text" name="core-text"><action method="setText"><text><!(CDATA(<div>Souh</div>))></text></action></block>
    </reference>

  </catalog_product_view>
</layout>

I have also echoed the block names that are used in the product page:

Array
(
    (0) => product.info.media
    (1) => alert.urls
    (2) => product.info.upsell
    (3) => product.info.additional
    (4) => product.description
    (5) => product.attributes
    (6) => catalog.product.related
    (7) => product.info.addto
    (8) => product.info.sharing
    (9) => product.info.addtocart
    (10) => product.info.extrahint
    (11) => product.info.options.wrapper
    (12) => product.info.options.wrapper.bottom
    (13) => product.info.container1
    (15) => product.info.additional.recurring.schedule
    (16) => product.reviews
    (17) => product.info.simple
    (18) => product.info.availability
)

I don’t understand why not all of them can be extended/referenced when they all appear to be called in the product page.

Thank you in advance for your help.