Answers.Body: <p><code>Commerce::getInstance()-&gt;getShippingMethods()-&gt;getAllShippingMethods();</code> would be the functional equivilant of Commerce 1's<code>commerce_shippingMethods-&gt;getAllCoreShippingMethods()</code> since it returns the the shipping methods defined in the database.</p>
  
  <p><code>Commerce::getInstance()-&gt;getShippingMethods()-&gt;getAvailableShippingMethods();</code> will return the shipping methods in the database as well as any 3rd party defined shipping methods.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-28T00:06:32.433Z
Answers.LastActivityDate: 2019-01-28T00:06:32.433Z
Answers.UserDisplayName: Brad Bell
Body: <p>Is there an equivalent function to <code>commerce_shippingMethods-&gt;getAllCoreShippingMethods()</code> in Commerce 2?</p>
  
  <p>I can only find <code>Commerce::getInstance()-&gt;getShippingMethods()-&gt;getAllShippingMethods();</code></p>
  
  <p>I also cant find an equivalent to <code>craft()-&gt;commerce_orders-&gt;saveOrder($order)</code> anywhere.</p>
  
Tags: <plugin-development><migration><plugin-craftcommerce2>
Title: How to get core shipping methods in Commerce 2? How to save an order?
ThreadText: # How to get core shipping methods in Commerce 2? How to save an order?
  
  (Asked by: username_0 on 2019-01-18)
  
  Is there an equivalent function to `commerce_shippingMethods->getAllCoreShippingMethods()` in Commerce 2?
  
  I can only find `Commerce::getInstance()->getShippingMethods()->getAllShippingMethods();`
  
  I also cant find an equivalent to `craft()->commerce_orders->saveOrder($order)` anywhere.
  
  **Tags:** plugin-development, migration, plugin-craftcommerce2
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-01-28. Score: 1
  
  `Commerce::getInstance()->getShippingMethods()->getAllShippingMethods();` would be the functional equivilant of Commerce 1's`commerce_shippingMethods->getAllCoreShippingMethods()` since it returns the the shipping methods defined in the database.
  
  `Commerce::getInstance()->getShippingMethods()->getAvailableShippingMethods();` will return the shipping methods in the database as well as any 3rd party defined shipping methods.
  
  
  ---
  
  