Tygh::$app['server.env']
was implemented to store the information about the environment the product runs in.This hook is executed after the calculation of shipping rates, allowing you to modify them:
fn_set_hook('shippings_calculate_rates_post', $shippings, $rates);
This hook is executed before the reward points are applied:
fn_set_hook('set_point_payment', $cart, $cart_products, $auth, $user_info, $cost_covered_by_applied_points, $point_exchange_rate, $user_points);
This hook is executed before the reward point data is gathered:
fn_set_hook('gather_reward_points_data_pre', $product, $auth, $get_point_info);
This hook is executes after removing the usage of deleted and disabled languages:
fn_set_hook('save_languages_integrity_post', $default_lang, $settings_changed);
This hook is executed before merging the payment processor response with the order payment info in the store, allowing you to modify the processor response:
fn_set_hook('update_order_payment_info_before_processing_response', $order_id, $pp_response, $payment_info);
This hook is executed right before putting the order payment info in the database, allowing you to modify the SQL query:
fn_set_hook('update_order_payment_info', $order_id, $pp_response, $payment_info, $data);
This hook is executed before changing the order’s child order status, allowing you to modify the child order status or prevent the status from being changed:
fn_set_hook('change_order_status_child_order', $order_id, $status_to, $status_from, $force_notification, $place_order, $child_order_id, $child_status_to, $change_child_status);
This hook modifies filters:
fn_set_hook('get_filters_products_count_post', $params, $lang_code, $filters);
// old:
fn_set_hook('update_image', $image_data, $image_id, $image_type, $images_path, $_data, $mime_type)
// new:
fn_set_hook('update_image', $image_data, $image_id, $image_type, $images_path, $_data, $mime_type, $is_clone)
// old:
fn_set_hook('image_zoom_check_image_post', $file_path, $image_data, $images);
// new:
fn_set_hook('image_zoom_check_image_post', $file_path, $image_data, $images, $use_original_image_format);
// old:
fn_set_hook('update_destination_pre', $data, $destination_id);
// new:
fn_set_hook('update_destination_pre', $data, $destination_id, $lang_code);
Fill empty/missing fields of location data:
fn_fill_location_fields($location = array(), $prefix = '')
Return image subdirectory:
fn_get_image_subdir($image_id = 0)
Decode the hostname from Punycode:
\Tygh\Tools\Url::punyDecode()
Encode the hostname to Punycode:
\Tygh\Tools\Url::punyEncode()
Get URL port if it exists, return null otherwise:
\Tygh\Tools\Url::getPort()
Set URL port:
\Tygh\Tools\Url::setPort()
Remove a location by identifier:
fn_delete_destinations($destination_ids)
Add or update a location:
fn_update_destination($data, $destination_id, $lang_code = DESCR_SL)
Get the states and countries of locations:
fn_destination_get_states($lang_code)
Get the parameters of the features page:
fn_get_paginated_product_features($request, $auth, $product_data = array(), $lang_code = DESCR_SL)
puny_decode
—it decodes the hostname from Punycode and returns the URL. Usage:
{$url|puny_decode}
// old:
function fn_update_image_pairs($icons, $detailed, $pairs_data, $object_id = 0, $object_type = 'product_lists', $object_ids = array (), $update_alt_desc = true, $lang_code = CART_LANGUAGE)
// new:
function fn_update_image_pairs($icons, $detailed, $pairs_data, $object_id = 0, $object_type = 'product_lists', $object_ids = array (), $update_alt_desc = true, $lang_code = CART_LANGUAGE, $from_exist_pairs = false)
// old:
function fn_update_image($image_data, $image_id = 0, $image_type = 'product', $lang_code = CART_LANGUAGE)
// new:
function fn_update_image($image_data, $image_id = 0, $image_type = 'product', $lang_code = CART_LANGUAGE, $is_clone = false)
// old:
\Tygh\Tools\Url::decode($url)
// new:
\Tygh\Tools\Url::decode($url, $return_url = false)
// old:
fn_image_zoom_check_image(&$image_data, &$images);
// new:
fn_image_zoom_check_image(&$image_data, &$images, $use_original_image_format = false);
Questions & Feedback
Have any questions that weren't answered here? Need help with solving a problem in your online store? Want to report a bug in our software? Find out how to contact us.