Adapt Your Add-Ons & Themes To 4.3.4

Common changes

  • Smarty template cache files and directories are now created with permissions that are set to DEFAULT_DIR_PERMISSIONS and DEFAULT_FILE_PERMISSIONS constants;
  • The new global Smarty template variable "language_direction" is available. Its possible values are "rtl" and "ltr" that mean RightToLeft and LeftToRight respectively.
  • The new parameter "store_prefix" was added to configuration ($config['store_prefix']). If you use APCu/XCache/Redis cache storages, set the "store_prefix" parameter to unique value at "config.local.php" for each store that is installed on the same server.
  • We've integrated the "Select2" JavaScript library. You may find an example of usage when assigning a feature value to a product - the list of the possible variants is now rendered via "Select2". You can use the integrated library via the "cm-object-selector" JS microformat, that will be well-documented soon.

Hook changes

New hooks

  • fn_set_hook('get_banner_data', $banner_id, $lang_code, $fields, $joins, $condition); - prepare params for banner data SQL query
  • fn_set_hook('get_banner_data_post', $banner_id, $lang_code, $banner); - post processing of banner data
  • fn_set_hook('get_tags_pre', $params, $items_per_page, $default_params); - change parameters for getting tags
  • fn_set_hook('get_tags', $params, $items_per_page, $fields, $joins, $conditions, $group, $sorting); - gets tags
  • fn_set_hook('get_tags_post', $params, $items_per_page, $tags); - change tags
  • fn_set_hook('format_price_by_currency_post', $price, $currency_from, $currency_to, $result); - update converted value
  • fn_set_hook('get_shipping_info_post', $shipping_id, $lang_code, $shipping); - particularize shipping information
  • fn_set_hook('form_cart_pre_fill', $order_id, $cart, $auth, $order_info); - change the cart data before forming a cart.
  • fn_set_hook('get_countries_pre', $params, $items_per_page, $lang_code, $default_params); - change parameters for getting the countries list.
  • fn_set_hook('get_countries', $params, $items_per_page, $lang_code, $fields, $joins, $condition, $group, $sorting, $limit); - prepare params for getting countries SQL query
  • fn_set_hook('get_countries_post', $params, $items_per_page, $lang_code, $countries); - actions after the countries list was prepared
  • fn_set_hook('get_states_pre', $params, $items_per_page, $lang_code, $default_params); - change parameters for getting the states list
  • fn_set_hook('get_states', $params, $items_per_page, $lang_code, $fields, $joins, $condition, $group, $sorting, $limit); - prepare params for getting the states SQL query
  • fn_set_hook('get_states_post', $params, $items_per_page, $lang_code, $states); - actions after the states list was prepared
  • fn_set_hook('get_destinations', $lang_code, $fields, $joins, $condition, $group, $sorting, $limit); - prepare params for getting the destinations SQL query
  • fn_set_hook('get_destinations_post', $lang_code, $destinations); - actions after getting the destinations list
  • fn_set_hook('get_available_destination_pre', $location); - prepare params for getting the available destination
  • fn_set_hook('get_available_destination_post', $location, $result, $concur_destinations); - post processing of the available destination

Changed hooks



-fn_set_hook('repay_order', $order_info, $update_order, $payment, $payment_info); 
+fn_set_hook('repay_order', $order_info, $update_order, $payment, $payment_info, $change_order_status);

-fn_set_hook(‘get_shipping_info’, $shipping_id, $fields, $join, $conditions);
+fn_set_hook(‘get_shipping_info’, $shipping_id, $fields, $join, $conditions, $lang_code);


The "update_option_combination_pre" hook was duplicated at the beginning and at the end of the "fn_update_option_combination" function. The hook at the end of the function was renamed:

-fn_set_hook('update_option_combination_pre', $combination_data, $combination_hash, $inventory_amount);
+fn_set_hook('update_option_combination_post', $combination_data, $combination_hash, $inventory_amount);

Core functions

Changed functions




-function fn_required_products_in_cart($auth, $ids)
+function fn_required_products_in_cart($cart, $ids)

-function fn_required_products_get_existent($auth, $ids, $look_in_cart = true)
+function fn_required_products_get_existent($auth, $ids, $cart = array())

-function fn_update_product_features_value($product_id, $product_features, $add_new_variant, $lang_code)
+function fn_update_product_features_value($product_id, $product_features, $add_new_variant, $lang_code, $params = array())


Function "fn_blocks_get_vendor_info()" was moved from "app/functions/fn.companies.php" to "app/schemas/block_manager/blocks.functions.php"

New functions

  • Tygh\Tools\ImageHelper::originalProportionsFallback($original_width, $original_height, $new_width, $new_height, $high_precision = false) - if the new image width or height is empty (i.e. null or zero), this function calculates the size of empty sides based on original image proportions.
  • fn_age_verification_birthday_promo($auth) - checks if today is the birthday of the current user
  • fn_checkout_get_display_steps($profile_fields = array())
  • fn_filters_not_found_notification() - displays a notification if products were not found using the current filters combination
  • fn_get_product_timestamp($product_id, $day_begin = false) - returns a product creation timestamp
  • fn_catch_exception($func) - Allows to safely execute code that may throw an exception.
  • fn_is_rtl_language($lang_code = CART_LANGUAGE) - checks if the language is RTL
  • fn_is_valid_path($base_dir, $path) - checks if a path to directory/file is under the base directory
  • fn_get_file_perms_info($file_path) - returns file's permissions, a group and an owner in the following format: "drwxrwxrwx www-data:www-data"
  • fn_get_readable_file_perms($perms) - сonverts file permissions (fileperms() function call result) into a human-readable ("drwxrwxrwx"-like) format
  • fn_get_server_username_by_id($unix_user_id) - returns the server username by its UNIX ID
  • fn_get_server_group_name_by_id($unix_group_id) - returns the server group name by its UNIX ID
  • fn_get_process_owner_name() - returns the name of the user that owns the current PHP process
  • fn_get_parent_directory_stack($path) - allows to fetch a list of parent directories for the given path. This function doesn't check a real filesystem and operates only using the given path string.

Deprecated functions

The "fn_format_price_by_currency($price, $currency_code = CART_SECONDARY_CURRENCY)" function was renamed to "fn_format_price_by_currency_depricated($price, $currency_code = CART_SECONDARY_CURRENCY)". The "fn_format_price_by_currency()" function now has the new API:



function fn_format_price_by_currency($price, $currency_from = CART_PRIMARY_CURRENCY, $currency_to = CART_SECONDARY_CURRENCY) - this function converts the price from one currency to another

Thank you.

Directory/file permission stuff is a bit hokey but I understand why you've done it. Given that most users have to use octet notation anyway for file/dir permissions, seems more appropriate to use those rather than the dwwxwwxwwx notation. If they've never seen a unix ls listing, it may not make sense to them.

Thank you.

Directory/file permission stuff is a bit hokey but I understand why you've done it. Given that most users have to use octet notation anyway for file/dir permissions, seems more appropriate to use those rather than the dwwxwwxwwx notation. If they've never seen a unix ls listing, it may not make sense to them.

These FS functions are used at upgrade process logging, and the resulting log file is intended to be checked out by technical specialists.