Shopify Orders Array Issue
I have these two arrays
$order2 = array('line_items' => array( array('title' => 'Shipping', 'price' => '10', 'quantity' => '2', ) )); $order3 =array('title' => 'Handling', 'price' => '5', 'quantity' => '1', );
I've used array_merge and array_push in this instance but both don't give me my desired output. I'm trying to get it to show like this.
array('line_items' => array( array('title' => 'Shipping', 'price' => '10', 'quantity' => '2', ), array('title' => 'Handling', 'price' => '5', 'quantity' => '1', ) ));
The output i get is
Array ( [line_items] => Array (  => Array ( [title] => Shipping [price] => 10 [quantity] => 2 ) ) [title] => Handling [price] => 5 [quantity] => 1 )
How can i achieve my desired output so i can use this as a shopify order?
You don't need any functions to do that, just a simple array assignment on top of the existing one:
$order2['line_items'] = $order3;
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?