Documentation

ShopMagic core hooks

shopmagic/core/action/config/before#

shopmagic/core/action/sendmail/raw_message#

Raw email content with processed placeholders. The filter is used in all actions that send mail.
Parameters:

  • string $content

shopmagic/core/action/sendmail/unsubscribe_url#

shopmagic/core/actions#

shopmagic/core/automation/cleanup#

shopmagic/core/automation/setup#

shopmagic/core/automation/should_execute_action#

shopmagic/core/communication_type/account_page_show#

shopmagic/core/communication_type/account_page_slug#

shopmagic/core/communication_type/account_page_title#

The expiration time for a customer tracking cookie.
Parameters:

  • int $cookie_expiry Current cookie expiration. 365 by default.

Returns: int New expiration time.

Cookie name for customer tracking. Used to properly identify the same guest users.
Parameters:

  • string $cookie_name Current cookie name. shopmagic_visitor_HASH by default.

Returns: string New cookie name.

shopmagic/core/customer_interceptor/cookies_enabled#

shopmagic/core/events#

shopmagic/core/factory/action#

You can use this filter to override the main Action factory. Action factory is
a class that is responsible for creating every Action in the ShopMagic.
Through this filter, you can completely change how and when an Action is created.
Parameters:

  • $factory Action\ActionFactoryCore Default ShopMagic action factory.

Returns: \ActionFactory2
Hook available since version: 2.0
Warning - only for advanced users: This filter requires knowledge about a Factory pattern and an Action interface. If you simply want to add/change available Action please use shopmagic/core/actions.
This hook is deprecated: 2.37 Factory cannot be overwritten through the filter.

shopmagic/core/factory/event#

You can use this filter to override the main Event factory. Event factory is
a class that is responsible for creating every Event in the ShopMagic.
Through this filter, you can completely change how and when an event is created.
Parameters:

  • $factory Event\EventFactoryCore Default ShopMagic events factory.

Returns: \EventFactory2
Hook available since version: 2.0
Warning - only for advanced users: This filter requires knowledge about a Factory pattern and an Event interface. If you simply want to add/change available events please use shopmagic/core/events.
This hook is deprecated: 2.37 Factory cannot be overwritten through the filter.

shopmagic/core/factory/filter#

You can use this filter to override the main Filter factory. Filter factory is
a class that is responsible for creating every Filter in the ShopMagic.
Through this filter, you can completely change how and when a Filter is created.
Parameters:

  • $factory Filter\FilterFactoryCore Default ShopMagic filter factory.

Returns: \FilterFactory2
Hook available since version: 2.0
Warning - only for advanced users: This filter requires knowledge about a Factory pattern, a ChainOfResponsibility pattern and a Filter interface. If you simply want to add/change available Filters please use shopmagic/core/filters.
This hook is deprecated: 2.37 Factory cannot be overwritten through the filter.

shopmagic/core/factory/placeholder#

ou can use this filter to override the main placeholder factory. Placeholder factory is
a class that is responsible for creating every placeholder in the ShopMagic.
Through this filter, you can completely change how and when a placeholder will be created.
Parameters:

  • $factory Placeholder\PlaceholderFactoryCore Default ShopMagic placeholder factory.

Returns: \PlaceholderFactory2
Hook available since version: 2.0
Warning - only for advanced users: This filter requires knowledge about a Factory pattern and a Placeholder interface. If you simply want to add/change available placeholders please use shopmagic/core/placeholders filter.
This hook is deprecated: 2.37 Factory cannot be overwritten through the filter.

shopmagic/core/filters#

shopmagic/core/groups#

shopmagic/core/guest/timestamp_format#

shopmagic/core/initialized#

If you want to write an integration with ShopMagic you should use this action.
This action is executed when the ShopMagic core is ready to be used.
Parameters:

  • string $version Version

Hook available since version: 2.7.0
This hook is deprecated: Use shopmagic/core/initialized/v2

shopmagic/core/initialized/v2#

If you want to write an integration with ShopMagic you should use this action.
This action is executed when the ShopMagic core is ready to be used and provides an ExternalPluginsAccess object to facilitate integration.

Please make sure that your integration is checking $plugin_access->get_version() to ensure that your integration is compatible with the current ShopMagic version.
Remember that we use semantic versioning so can be sure that every time we make a breaking change we also increase a major version of the plugin.
Parameters:

  • \ExternalPluginsAccess $plugin_access Object with various tools that can be used for integration.

Hook available since version: 2.17.0

shopmagic/core/outcomes/timestamp_format#

shopmagic/core/placeholder/products_ordered/templates#

shopmagic/core/placeholder/template_resolver#

Use when you want to change how templates are rendered in in ShopMagic settings.
Parameters:

  • \ShopMagicVendor\WPDesk\View\Resolver\Resolver[] $ List of default resolvers. Order is important as the first found will be used.

Returns: \ShopMagicVendor\WPDesk\View\Resolver\Resolver[] List of resolvers.
Warning - only for advanced users: Every template resolver must implement Resolver interface.

shopmagic/core/placeholders#

shopmagic/core/placeholders/legacy#

shopmagic/core/presubmit/checkout_capture_fields#

shopmagic/core/presubmit/guest_capture_fields#

shopmagic/core/settings/ready#

Fires when ShopMagic settings can be accessed using GeneralSettings::get_option.
Hook available since version: 2.15

shopmagic/core/settings/tabs#

shopmagic/core/settings/tabs/saved#

shopmagic/core/settings/template_resolvers#

Use when you want to change how fields are rendered in in ShopMagic settings.
Parameters:

  • \ShopMagicVendor\WPDesk\View\Resolver\Resolver[] $ List of default resolvers. Order is important as the first found will be used.

Returns: \ShopMagicVendor\WPDesk\View\Resolver\Resolver[] List of resolvers.
Warning - only for advanced users: Every template resolver must implement Resolver interface.

shopmagic/core/single_action#

shopmagic/core/single_event#

shopmagic/core/single_filter#

shopmagic/core/test_data_provider/data#

shopmagic/core/test_data_provider/domains#

Not the solution you are looking for?

Please check other articles or open a support ticket.

Cookies preferences

Others

Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.

Necessary

Necessary
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.

Advertisement

Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.

Analytics

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.

Functional

Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.

Performance

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.