Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $objectManager = MagentoFrameworkAppObjectManager::getInstance();
- $resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
- $connection = $resource->getConnection();
- $sqlx = "SELECT * FROM sales_order ORDER BY entity_id DESC LIMIT 1";
- $connection->query($sqlx);
- $resultx = $connection->fetchAll($sqlx);
- foreach($resultx as $resulx)
- {
- $entityid = $resulx['entity_id'];
- }
- $sql = "SELECT * FROM sales_order_item WHERE order_id='$entityid'";
- $connection->query($sql);
- $results = $connection->fetchAll($sql);
- foreach($results as $result)
- {
- $item_id = $result['item_id'];
- /* DO WHATEVER YOU WANT HERE */
- $upsql = "UPDATE sales_order_item SET product_options='$finalque' WHERE item_id='$item_id'";
- $connection->query($upsql);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement