Jump to content

PS 1.6.1.8 | Impossible to get order_id


spirit_infernal

Recommended Posts

Hello everyone. 
I want to get id_order for further usage, but after few attempts have no luck with it. 

public static function getIdOrder($id_cart)
    {
        return Db::getInstance()->executeS(
            'SELECT id_order FROM '._DB_PREFIX_.'orders WHERE id_cart = '.$id_cart
        );
    }

this function return bool(true), if I set executeS($sql, false, false) it return only string like 'SELECT id_order FROM ps_orders, WHERE id_cart = 4701', not id_order.

Different apporoaches found across internet give same results. For example, using 

$order_object = new OrderCore();
$idOrder = $order_object->getOrderByCartId((int)($mycart->id));;

return same bool(true), but not ID. All theese actions are doing for programmatically update order_detail, which oesn't accept sql update injections without id_order.

Hope someone help me. Thanks in advance

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...