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

Core Changes

  • New theme Nova Theme introduced. It is selected in new CS-Cart installations by default, and currently has Responsive Theme as its parent.
  • Packages fzaninotto/faker, twig/extensions are no longer used.
  • Minimum required version of PHP increased to 7.4.
  • Smarty version updated from v4.3.0.2 to v5.4.1.
    • To adapt your add-ons and themes, use the v4 to v5 migration guide: https://github.com/smarty-php/smarty/blob/v5.4.1/docs/upgrading.md
    • Smarty core plugins: blocks and functions have been moved from app/functions/smarty_plugins/ to \Tygh\SmartyEngine\Extensions\TyghExtension.
    • To use your own Smarty plugins, write your own Smarty extension and add it using the method \Tygh\SmartyEngine\Core::addExtension(ExtensionInterface $extension). Example in call_requests add-on.
    • To use your own “component” block elements, add the path to them using the method \Tygh\SmartyEngine\Core::addComponentDir(string $dir).
  • Package symfony/lock updated to version 5.4.21.
    • Since the structure of interfaces for stores has changed in the core library, the StoreInterface interface has also changed. It no longer has the waitAndSave() method. If your store used this method, additionally implement the BlockingStoreInterface interface in the store.
    • If your store used the waitAndSave() method, to continue its work in the new version, replace class YourStore implements StoreInterface with class YourStore implements StoreInterface, BlockingStoreInterface.

Deleted Functions

  • \Tygh\SmartyEngine\Core::__($var, $params = array())

Deprecated Functions

  • \Tygh\SmartyEngine\Core::loadPlugin()
  • \Tygh\SmartyEngine\Core::setPluginsDir()
  • \Tygh\SmartyEngine\Core::registerFilter()

Changed Functions

// Old:
function fn_attach_image_pairs($name, $object_type, $object_id = 0, $lang_code = CART_LANGUAGE, array $object_ids = [])

// New:
function fn_attach_image_pairs($name, $object_type, $object_id = 0, $lang_code = CART_LANGUAGE, array $object_ids = [], $allowed_file_size_bytes = null)

New Functions

  • \Tygh\SmartyEngine\Core::addComponentDir(string $dir)
  • \Tygh\SmartyEngine\Core::getComponentDirs()

New Hooks

  1. This hook is executed before checking the category update permissions. The hook allows you to change the parameters of the check:

    fn_set_hook('is_category_update_allowed_pre', $category_data, $category_id, $lang_code, $auth, $result);
    
  2. This hook is executed after checking the category update permissions check. The hook allows you to change the result of the check:

    fn_set_hook('is_category_update_allowed_post', $category_data, $category_id, $lang_code, $auth, $result);
    
  3. This hook is executed after fetching the data of the chosen payment method. The hook allows you to restrict order placement:

    fn_set_hook('allow_place_order_check_payment', $cart, $auth, $parent_order_id, $payment_method_data, $total, $result);
    
  4. This hook is executed after loading the request data for payment buttons. The hook allows you to modify the payment request data:

    fn_set_hook('stripe_data_loader_load_payment_request_data_post', $payment_buttons, $product_id, $product_options, $user_data, $shipping_id, $cart, $product, $shippings);
    
  5. This hook is executed before the rules that restrict access to updating a store location. The hook allows yout to change the current result or runtime params before the rules are applied:

    fn_set_hook('check_store_location_update_allowed_pre', $store_location_id, $result);
    
  6. This hook is executed after the rules that restrict access to updating a store location. The hook allows you to change the result:

    fn_set_hook('check_store_location_update_allowed_post', $store_location_id, $result);
    
  7. This hook is executed before the rules that restrict access to updating a shipment. The hook allows yout to change the current result or runtime params before the rules are applied:

    fn_set_hook('check_shipment_update_allowed_pre', $shipment_id, $result);
    
  8. This hook is executed after the rules that restrict access to updating a shipment. The hook allows you to change the result:

    fn_set_hook('check_shipment_update_allowed_post', $shipment_id, $result);
    
  9. This hook is executed before the rules that restrict access to updating a product bundle. The hook allows you to change the current result or runtime params, before the rules are applied:

    fn_set_hook('check_product_bundle_update_allowed_pre', $bundle_id, $result);
    
  10. This hook is executed after the rules that restrict access to updating a product bundle. The hook allows you to change the result:

    fn_set_hook('check_product_bundle_update_allowed_post', $bundle_id, $result);
    

Add-on Changes

Stripe Connect Payments

The Commission includes setting of the Stripe Connect Payments add-on has been removed. Previously, it allowed makreptlace owners to collect not only order commission, but also past debts of sellers to the marketplace. That was neither transparent, nor consistent with other multiparty payment methods in CS-Cart, and could lead to issues. Starting with version 4.19.1, Stripe Connect will only collect what the seller owes the marketplace from this particular transaction. For past debts, we recommend the standard Vendor-to-Admin Payments add-on.

Deleted functions:

  • \Tygh\Addons\StripeConnect\PayoutsManager::acceptPayouts()
  • \Tygh\Addons\StripeConnect\PayoutsManager::getPendingPayouts()
  • \Tygh\Addons\StripeConnect\PayoutsManager::getPendingPayoutsFee()