Dodanie obsługi punktów Orlen w zamówieniach oraz poprawa logiki i formatowania w różnych plikach

This commit is contained in:
2024-11-16 10:54:33 +01:00
parent a91d37736d
commit 49f8a3f8a0
25 changed files with 946 additions and 422 deletions

View File

@@ -20,16 +20,25 @@ class ProductCustomField implements \ArrayAccess
try
{
$redis = \RedisConnection::getInstance() -> getConnection();
$objectData = $redis -> get( "shop\ProductCustomField:$custom_field_id" );
if ( !$objectData )
if ( $redis )
{
$object = new self( $custom_field_id );
$redis -> setex( "shop\ProductCustomField:$custom_field_id", 60 * 60 * 24, serialize( $object ) );
$objectData = $redis -> get( "shop\ProductCustomField:$custom_field_id" );
if ( !$objectData )
{
$object = new self( $custom_field_id );
$redis -> setex( "shop\ProductCustomField:$custom_field_id", 60 * 60 * 24, serialize( $object ) );
}
else
{
$object = unserialize( $objectData );
}
}
else
{
$object = unserialize( $objectData );
// Log the error if needed
$object = new self( $custom_field_id );
}
}
catch ( \Exception $e )