GET /api/features/:id
will also contain variant imagesTygh\PriceList\AGenerator
, Tygh\PriceList\Pdf
, Tygh\PriceList\Xlsx
classes were introduced. The add-on now uses the XLS Writer library.Perform actions before setting the session name:
fn_set_hook('session_set_name_before', $account_type, $sess_postfix);
Perform actions before processing mail content via Smarty:
fn_set_hook('smarty_display_mail', $this, $template, $to_screen, $area, $company_id, $lang_code, $original_lang_code, $result);
Configure HTMLPurifier before it purifies the given HTML:
fn_set_hook('sanitize_html', $config_instance, $raw_html);
Modify product order details:
fn_set_hook('create_order_details', $order_id, $cart, $order_details, $extra);
Modify product popularity:
fn_set_hook('create_order_details_post', $order_id, $cart, $order_details, $extra, $popularity);
Perform actions before storing cart content in a customer’s profile:
fn_set_hook('save_cart_content_pre', $cart, $user_id, $type, $user_type);
Perform actions after storing cart content in a customer’s profile:
fn_set_hook('save_cart_content_post', $cart, $user_id, $type, $user_type);
Process user session products condition:
fn_set_hook('user_session_products_condition', $params, $conditions);
Delete products from abandoned/live carts:
fn_set_hook('delete_user_cart', $user_ids, $condition, $data);
Set the parameters for getting abandoned/live carts:
fn_set_hook('get_carts', $type_restrictions, $params, $condition, $join, $fields, $group, $array_index_field);
Get abandoned/live carts:
fn_set_hook('get_carts_before_select', $params, $items_per_page, $fields, $join, $condition, $group, $sorting, $limit);
Perform actions after getting abandoned/live carts:
fn_set_hook('get_carts_post', $carts_list, $params, $user_ids, $items_per_page, $fields, $join, $condition, $group, $sorting, $limit);
Get products of a particular abandoned/live cart:
fn_set_hook('get_cart_products', $user_id, $params, $fields, $conditions);
Perform actions after getting products of a particular abandoned/live cart:
fn_set_hook('get_cart_products_post', $user_id, $params, $cart_products, $fields, $conditions);
Perform actions before getting the list of currencies:
fn_set_hook('get_currencies_list_pre', $params, $area, $lang_code);
Set the parameters for the query that gets currency list:
fn_set_hook('get_currencies_list_before_select', $params, $area, $lang_code, $join, $order_by, $cond);
Gets the list of currencies:
fn_set_hook('get_currencies_list_post', $params, $area, $lang_code, $currencies);
Perform actions before initializing currencies:
fn_set_hook('init_currency_pre', $params, $area);
Set currencies:
fn_set_hook('init_currency_post', $params, $area, $primary_currency, $secondary_currency);
Select user data:
fn_set_hook('auth_routines', $request, $auth, $field, $condition, $user_login);
fn_set_hook('save_cart', $cart, $user_id, $type);
is now deprecated and will be removed in version 5.x. Use the save_cart_content_post
hook instead.
// old:
fn_set_hook('is_cart_empty', $cart, $result);
// new:
fn_set_hook('is_cart_empty', $cart, $result, $check_excluded);
Tygh\Shippings\Shippings::hasEnabledShippings($company_id)
—checks if shippings are enabled for the company. Replaces the Registry::get('settings.General.disable_shipping')
setting, which was removed.
Tygh\Shippings\Shippings::isFreeShipping($shipping)
—checks if a shipping method can be used with the Free shipping product option;
Tygh\Tools\Math class was added
—contains methods commonly used for mathematic operations:
floorToPrecision($x, $precision)
—floors the given number to the given precisionceilToPrecision($x, $precision)
—ceils the given number to the given precisionfloor($x)
—replaces thefloor()
PHP function and doesn’t return floats like 1.999999...
Tygh\Tools\SecurityHelper::generateRandomString()
—generates a random string.
Tygh\Tools\Url::normalizeEmail($email)
—normalizes an email address and punycodes it.
fn_user_session_products_condition($params = array())
—gets an SQL condition to manipulate the ?:user_session_products table.
fn_delete_user_cart($user_ids, $data = '')
—deletes products from abandoned/live carts.
fn_get_carts($params, $items_per_page = 0)
—gets abandoned/live carts.
fn_get_cart_products($user_id, $params = array())
—gets the products of a particular abandoned/live cart.
fn_get_filter_is_numeric_slider($filter_data)
—checks if the given filter appears as a numeric slider.
fn_create_trash_category($company_id)
—creates the trash category.
fn_get_trash_category($company_id)
—returns the identifier of the trash category.
fn_is_trash_category($category_id)
—checks if the category is used for trash.
fn_add_product_to_trash($product_id, $trash_category_id)
—adds a product to the trash category.
fn_trash_orphaned_products($category_ids)
—moves products that are left without categories in their store to the trash category.
fn_empty_trash($trash_category_id)
—deletes products from the trash category.
fn_promotion_generate_bonus_coupon($bonus, $bonus_id, $cart)
—generates a bonus coupon for an order.
Tygh\Backend\Storage\ABackend::_generateName()
was renamed to Tygh\Backend\Storage\ABackend::generateName()
and became a public method.
Tygh\Tools\Url::build()
: php -public function build($encode = false) +public function build($encode = false, $puny = false)
// old:
function fn_cart_is_empty($cart)
// new:
function fn_cart_is_empty($cart, $check_excluded = true)
// old:
function fn_get_category_data($category_id = 0, $lang_code = CART_LANGUAGE, $field_list = '', $get_main_pair = true, $skip_company_condition = false, $preview = false)
// new:
function fn_get_category_data($category_id = 0, $lang_code = CART_LANGUAGE, $field_list = '', $get_main_pair = true, $skip_company_condition = false, $preview = false, $get_full_path = 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.