Answers.Body: <p><code>carbonBalanceAdjuster.php</code> should be <code>CarbonBalanceAdjuster.php</code> since the name of the class is <code>CarbonBalanceAdjuster</code> and you're probably on a case-sensitive file system, which is why auto-loading can't find it.</p>
  
  <p>The same goes for your other plugin files as well.  You can use <a href="https://pluginfactory.io" rel="nofollow noreferrer">https://pluginfactory.io</a> to generate boilerplate plugin code to help avoid case-sensitivity issues like this.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-13T09:41:56.633Z
Answers.Text: I'll give that a go, thanks. In the meantine, changing the registerOrderAdjusters method to use new \Commerce\Adjusters\CarbonBalanceAdjuster  sorted it out.
Answers.UserDisplayName: foamcow
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-12T18:31:11.910Z
Answers.LastActivityDate: 2017-09-12T18:31:11.910Z
Answers.UserDisplayName: Brad Bell
Body: <p>I'm basically having this problem <a href="https://craftcms.stackexchange.com/questions/19754/getting-started-with-order-adjuster-plugin">Getting started with Order Adjuster plugin</a></p>
  
  <p>I have the file plugins/carbonbalance/carbonBalancePlugin.php containing;</p>
  
  <pre><code>&lt;?php
  
  namespace Craft;
  Craft::import('plugins.carbonbalance.adjusters.carbonBalanceAdjuster');
  
  class CarbonBalancePlugin extends BasePlugin {
  
      ... usual standard plugin methods ...
  
      public function init()
      {       
      }
  
      public function commerce_registerOrderAdjusters()
      {
          return [
              new CarbonBalanceAdjuster
          ];
      }
  
  }
  </code></pre>
  
  <p>and then in plugins/carbonbalance/adjusters/carbonBalanceAdjuster.php I have</p>
  
  <pre><code>&lt;?php
  
  namespace Commerce\Adjusters;
  use Craft\Commerce_LineItemModel;
  use Craft\Commerce_OrderAdjustmentModel;
  use Craft\Commerce_OrderModel;
  
  class CarbonBalanceAdjuster implements Commerce_AdjusterInterface {
  
      public function adjust(Commerce_OrderModel &amp;$order, array $lineItems = []){
  
      $myAdjuster = new Commerce_OrderAdjustmentModel();
  
      return [$myAdjuster];
  
     }
  
  }
  </code></pre>
  
  <p>But I get the following error message</p>
  
  <p><code>Class 'Craft\CarbonBalanceAdjuster' not found</code></p>
  
  <p>I understand this is most likely a naming issue, but I cannot see where I'm going wrong in that respect.</p>
  
  <p><strong>Update</strong>
  I think I have got past this problem by using;</p>
  
  <pre><code>public function init()
      {       
          //Craft::import('plugins.carbonbalance.adjusters.carbonBalanceAdjuster');
          require_once('adjusters/carbonBalanceAdjuster.php');
  
      }
  
  public function commerce_registerOrderAdjusters()
      {
          return [
              new \Commerce\Adjusters\CarbonBalanceAdjuster
          ];
      }
  </code></pre>
  
  <p>This appears to load the Adjuster, but shows other errors because I haven't yet completed the adjust method.</p>
  
Tags: <plugins><adjusters>
Title: Problem with Adjuster plugin Class not found
ThreadText: # Problem with Adjuster plugin Class not found
  
  (Asked by: username_0 on 2017-09-12)
  
  I'm basically having this problem [Getting started with Order Adjuster plugin](https://craftcms.stackexchange.com/questions/19754/getting-started-with-order-adjuster-plugin)
  
  I have the file plugins/carbonbalance/carbonBalancePlugin.php containing;
  
  ```
  <?php
  
  namespace Craft;
  Craft::import('plugins.carbonbalance.adjusters.carbonBalanceAdjuster');
  
  class CarbonBalancePlugin extends BasePlugin {
  
      ... usual standard plugin methods ...
  
      public function init()
      {       
      }
  
      public function commerce_registerOrderAdjusters()
      {
          return [
              new CarbonBalanceAdjuster
          ];
      }
  
  }
  
  ```
  
  and then in plugins/carbonbalance/adjusters/carbonBalanceAdjuster.php I have
  
  ```
  <?php
  
  namespace Commerce\Adjusters;
  use Craft\Commerce_LineItemModel;
  use Craft\Commerce_OrderAdjustmentModel;
  use Craft\Commerce_OrderModel;
  
  class CarbonBalanceAdjuster implements Commerce_AdjusterInterface {
  
      public function adjust(Commerce_OrderModel &$order, array $lineItems = []){
  
      $myAdjuster = new Commerce_OrderAdjustmentModel();
  
      return [$myAdjuster];
  
     }
  
  }
  
  ```
  
  But I get the following error message
  
  `Class 'Craft\CarbonBalanceAdjuster' not found`
  
  I understand this is most likely a naming issue, but I cannot see where I'm going wrong in that respect.
  
  **Update**
  I think I have got past this problem by using;
  
  ```
  public function init()
      {       
          //Craft::import('plugins.carbonbalance.adjusters.carbonBalanceAdjuster');
          require_once('adjusters/carbonBalanceAdjuster.php');
  
      }
  
  public function commerce_registerOrderAdjusters()
      {
          return [
              new \Commerce\Adjusters\CarbonBalanceAdjuster
          ];
      }
  
  ```
  
  This appears to load the Adjuster, but shows other errors because I haven't yet completed the adjust method.
  
  **Tags:** plugins, adjusters
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-09-12. Score: 1
  
  `carbonBalanceAdjuster.php` should be `CarbonBalanceAdjuster.php` since the name of the class is `CarbonBalanceAdjuster` and you're probably on a case-sensitive file system, which is why auto-loading can't find it.
  
  The same goes for your other plugin files as well. You can use <https://pluginfactory.io> to generate boilerplate plugin code to help avoid case-sensitivity issues like this.
  
  > **Comments:**
  > **username_0**: I'll give that a go, thanks. In the meantine, changing the registerOrderAdjusters method to use new \Commerce\Adjusters\CarbonBalanceAdjuster  sorted it out.  
  
  ---
  
  