OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums OroCommerce Shipping Freight Class

This topic contains 1 reply, has 1 voice, and was last updated by  marius.negoescu 4 months, 1 week ago.

  • Creator
  • #40100


    Hi, guys

    I have added an extra freight class: pallet.

    I had no problem in adding the data to the database, but I am struggling with creating the FreightClassesExtension class which implements the FreightClassesExtensionInterface.

    I have followed this guide:


    I have created the class in my bundle:

    namespace Oro\Bundle\ShippingDemoBundle\Extension\Shipping;

    use Oro\Bundle\ShippingBundle\Entity\FreightClassInterface;
    use Oro\Bundle\ShippingBundle\Entity\ProductShippingOptionsInterface;
    use Oro\Bundle\ShippingBundle\Extension\FreightClassesExtensionInterface;

    class FreightClassesExtension implements FreightClassesExtensionInterface
    * {@inheritdoc}
    public function isApplicable(FreightClassInterface $class, ProductShippingOptionsInterface $options)
    if ($class->getCode() === ‘demo_class50’) {
    return $this->checkClass50($options);
    } elseif ($class->getCode() === ‘demo_class55’) {
    return $this->checkClass55($options);

    return false;

    //Other protected methods that implement logic to verify given options against given freight class

    and added it to the services.yml like this:

    class: ‘Oro\Bundle\ShippingDemoBundle\Extension\Shipping\FreightClassesExtension’
    – { name: oro_shipping.extension.freight_classes }

    but when I go to a product it keeps saying:

    Attempted to load class “FreightClassesExtension” from namespace “Oro\Bundle\ShippingDemoBundle\Extension\Shipping”.
    Did you forget a “use” statement for another namespace?

    Any ideas ?

    Cheers, Marius

Viewing 1 replies (of 1 total)
  • Author
  • #40102


    If you ever do

    composer dump-autoload,

    make sure you do composer install in dev mode to load the classes properly.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No