Dodanie obsługi punktów Orlen w zamówieniach oraz poprawa logiki i formatowania w różnych plikach
This commit is contained in:
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user