FUNCTION mandall_sklep.pl_calculateProductVariantPriceForUser does not exist
SELECT `ot`.`iProductVariant`, `ot`.`iQuantity`, pl_calculateProductVariantPriceForUser( NULL, `ot`.`iProductVariant`, 1 ) AS `fPrice`, `p`.`iProduct`, IFNULL( `pv`.`fPriceTimeValue`, `p`.`fPriceTimeValue` ) AS `fPriceTimeValue`, `p`.`iPriceTimeFrom`, `p`.`iPriceTimeTo`, `p`.`iPriceTimeMaxCount`, `p`.`iPriceTimeCount`, IF( `sq`.`sAttributes` IS NULL, `p`.`sName`, CONCAT( `p`.`sName`, ', ', `sq`.`sAttributes` ) ) AS `sName`, `p`.`sWeight`, `v`.`fVatValue` AS `fVat`, `pa`.`sText` AS `sAvailability` FROM `orders_temp` AS `ot` LEFT JOIN `pl_products_variants` AS `pv` USING( `iProductVariant` ) LEFT JOIN `pl_products` AS `p` USING( `iProduct` ) LEFT JOIN `vat` AS `v` ON( IFNULL( `pv`.`iVat`, `p`.`iVat` ) = `v`.`iVat` ) LEFT JOIN (SELECT IF( ( `products_variants`.`iStock`-`orders_temp`.`iQuantity` >= 0 ), IFNULL( `products_variants`.`iAvailableOnStock`, `products`.`iAvailableOnStock` ), IFNULL( `products_variants`.`iAvailableOutOfStock`, `products`.`iAvailableOutOfStock` ) ) AS `iAvailable`, `iProductVariant` FROM `pl_products_variants` AS `products_variants` INNER JOIN `pl_products` AS `products` USING( `iProduct` ) INNER JOIN `orders_temp` AS `orders_temp` USING( `iProductVariant` ) WHERE `orders_temp`.`iCustomer` = '1496090556455' AND `products_variants`.`iStatus` >= 1) AS `pag` USING( `iProductVariant` ) LEFT JOIN `pl_products_available` AS `pa` USING( `iAvailable` ) LEFT JOIN ( SELECT GROUP_CONCAT( CONCAT( `sName`, ': ', `sValue` ) SEPARATOR ', ' ) AS `sAttributes`, `iProductVariant` FROM `pl_products_attributes` LEFT JOIN `pl_attributes_values` USING( `iAttributeValue` ) LEFT JOIN `pl_attributes` USING( `iAttribute` ) GROUP BY `iProductVariant` ) AS `sq` USING( `iProductVariant` ) WHERE `iCustomer` = '1496090556455' AND `pv`.`iStatus` >= 1