Dodaj obsługę punktów Orlen w zamówieniach oraz popraw styl i logikę w szablonach

This commit is contained in:
2024-11-16 10:56:46 +01:00
parent 3cbf8842ab
commit 6c09a26b0d
24 changed files with 917 additions and 413 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 )