ShopMagic core hooks
shopmagic/core/action/config/before
shopmagic/core/action/sendmail/raw_message
Raw email content with processed placeholders. Filter is used in all actions that sends 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
shopmagic/core/customer_interceptor/cookie_expiry
The expiration time for customer tracking cookie.
Parameters:
- int $cookie_expiry Current cookie expiration. 365 by default.
Returns: int New expiration time.
shopmagic/core/customer_interceptor/cookie_name
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 a 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 a 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 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 a 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 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 filter.
shopmagic/core/factory/placeholder
You 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 an 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 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 a 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 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 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 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.