Adapt Your Add-ons and Themes to CS-Cart 4.10.3

Hook Changes

New Hooks

  1. This hook is executed when a supplier’s shipping methods are updated, before the shipping methods links are removed. The hook allows you to modify the list of shipping methods that would be removed:

    fn_set_hook('suppliers_update_supplier_shippings_before_delete_shippings', $supplier_id, $shippings, $current_supplier_data, $deleted_shippings);
    
  2. This hook is executed before a product feature is updated, right before feature values are removed from products that aren’t present in the new categories of the feature. The hook allows you to prevent product feature values removal, or to modify the feature data stored in the database:

    fn_set_hook('update_product_feature', $feature_data, $feature_id, $lang_code, $old_feature_data, $old_categories, $new_categories);
    

Core Functions

New Classes

  1. \Tygh\Enum\VendorStatuses—enumeration of vendor statuses.
  2. \Tygh\Addons\InstallerWithDemoInterface—interface InstallerWithDemoInterface describes installer for an add-on that has demo data.

New Functions

  1. Fill empty location fields in the specified section by copying them from the secondary profile fields section:

    \Tygh\Location\Manager::fillEmptyLocationFields(array $array, $primary_section)
    
  2. Take the first payment from vendor according to the vendor plan:

    \Tygh\Models\Company::initialPayment()
    
  3. Filter the list of source entities by their availability for the shared entity’s companies:

    fn_suppliers_filter_objects_by_sharing(array $objects_list, $source_type, $source_id_field, $shared_type, $shared_object_id)
    
  4. Find categories and their data by given category path:

    fn_get_categories_from_path(array $category_names, $company_id, $lang_code)
    
  5. Get unique block ID for WYSIWYG prelaoder:

    \Tygh\BlockManager\Block::getUniqueIdByData(array $block_data)
    
  6. Gets unique block ID for WYSIWYG prelaoder:

    \Tygh\BlockManager\Block::getUniqueId($block_id, $snapping_id)
    

Changed Functions

// Old:
\Tygh\Location\Manager::getLocationField($array, $field, $default_value = null)

// New:
\Tygh\Location\Manager::getLocationField(($array, $field, $default_value = null, $primary_section = SHIPPING_ADDRESS_PREFIX)