0

How can I obtaine sales information using the objectmanager and $ _POST.

I attached my code to tell me if it is correct ?

public function tomval(){
        #fucnion que se encarga de hacer la conexion 
        $objectmanager = \Magento\Framework\App\ObjectManager::getInstance();
        $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
        $connection = $resource->getConnection();
        $day = date(Y,m,d);
        $DeliveryType=  $_POST['DeliveryType'];
        $Address=       $_POST['Address'];
        $Province=  $_POST['Province'];
        $City=  $_POST['City'];
        $PostalCode= $_POST['PostalCode'];
        $Email= $_POST['Email'];

        $Phone= $_POST['Phone'];
        $FirstName= $_POST['FirstName'];
        $LastName=  $_POST['LastName'];
        $PaymentMethod= $_POST['PaymentMethod'];
        $Amount=    $_POST['Amount'];
       /* $Order=   $_POST['']
        $nota=      
*/
Msquare
  • 9,063
  • 7
  • 25
  • 63

1 Answers1

0

I am not sure about what your question.

$objectmanager = \Magento\Framework\App\ObjectManager::getInstance();
$request = $objectManager->get(\Magento\Framework\App\RequestInterface::class);
$post = $request->getPostValue();

Here $post is same as Php $_POST

Amit Bera
  • 77,456
  • 20
  • 123
  • 237