Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Shipping Methods page in admin goes blank after installing #20

@VkyAtWork

Description

@VkyAtWork

I installed this module but after installing my shipping method(Store->Configuration->Sales->Shipping Methods) page showing the blank page. If I disable this module page shows all shipping method setting as it should.

Using Magento ver. 2.2.1

and if I check system.log there is an error like this
[2017-11-30 07:23:47] main.CRITICAL: Class Meanbee\MagentoRoyalmail\Model\Config\Source\Methods does not exist [] []

File Methods.php is here on this path Meanbee/Royalmail/Model/Config/Source/Methods.php
And it contains

<?php

namespace Meanbee\MagentoRoyalmail\Model\Config\Source;

use \Magento\Framework\Option\ArrayInterface;
use Meanbee\MagentoRoyalmail\Model\Carrier;

/**
 * Class Methods Backend system config field renderer
 */
class Methods implements ArrayInterface
{

    /**
     * @var Carrier $carrier
     */
    protected $carrier;

    public function __construct(Carrier $carrier)
    {
        $this->carrier = $carrier;
    }

    /**
     * Sets the option array for the small and medium
     * parcel option in admin section of the extension
     *
     * @return array
     */
    public function toOptionArray()
    {
        $methods = $this->carrier->getMethods();

        $options = [];
        foreach ($methods as $value => $label) {
            $options[] = ['value' => $value, 'label' => $label];
        }

        return $options;
    }

    /**
     * Get options in "key-value" format
     *
     * @return array
     */
    public function toArray()
    {
        return array_map(function ($array) {
            return [$array['value'] => $array['label']];
        }, $this->toOptionArray());
    }
}
```
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions