NVision-Commerce-Solutions / module-customer-price

Commerce 365 for Magento - Magento 2 Extension - Customer Price Module
https://n.vision/products/commerce-365-for-magento-b2b/
2 stars 4 forks source link

Cache hours doesn't have a default value #27

Closed edwinbos closed 7 months ago

edwinbos commented 12 months ago

Error

Exception #0 (Zend_Db_Statement_Exception): 
SQLSTATE[42000]: Syntax error or access violation: 1064 
You have an error in your SQL syntax; 
check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1, 

query was: 
SELECT `commerce365_cached_price`.`price_data`, `commerce365_cached_price`.`product_id` 
FROM `commerce365_cached_price` 
WHERE (product_id  IN('2', '3', '4', '5', '6')) 
    AND (customer_id = '') 
    AND (last_updated >= NOW() - INTERVAL  HOUR)

This occurs when Cache hours is not filled in, in the configuration. When B2B pricing is not enabled you can't see the configuration field for cache hours.

The code where it's going wrong: vendor/commerce365/module-customer-price/Model/Command/GetCachedPriceData.php Line: 34 & 41

soloma88 commented 11 months ago

Hi @edwinbos is this query running somewhere when B2B pricing disabled?

soloma88 commented 7 months ago

Fixed in latest versions