We plan to raise the minimal supported PHP version in upcoming releases:
A new interface, TyghShippingsIPickupPointsService, has been introduced. You can implement it in your shipping service if you want to normalize pickup point data into the unified format defined by the TyghShippingsPickupPointsDtoPickupPoint class.
Previously, shipping services supporting pickup point selection had to implement the TyghShippingsIPickupService interface. As changing its methods would break existing integrations, the new interface has been introduced alongside the old one.
Why? There is a need to standardize pickup point data, which allows:
For these reasons, the new TyghShippingsIPickupPointsService interface was introduced, while the old interface remains available for backward compatibility.
By implementing a method that returns pickup points in a standardized format, you enable the core to use shared templates for displaying and working with the pickup point list. For example, if a unified map displaying pickup points for all available shipping methods is introduced in the future, your pickup points will automatically be included. Otherwise, they will not.
The TyghShippingsPickupPointsDtoPickupPoint class contains the basic fields for pickup point information required for display, such as the city, address, coordinates, business hours, and similar properties. To store all additional data returned by the shipping provider’s API, the class also includes a dedicated $shipping_extra field, to which all the data should be passed as an array.
Pickup points are cached in the shipping_pickup_points table. Its columns correspond to the fields of the PickupPoint class. At the moment, each shipping service is responsible for implementing its own caching logic within its loader class.
Functions to work with the cache tables are available in TyghShippingsPickupPointsRepository.
fn_get_storefront_theme_manifest_features — Theme manifest “features” for the active storefront theme (cached per request).fn_is_storefront_theme_manifest_feature_enabled($feature) — Whether a boolean feature under theme manifest.json “features” is enabled (strict JSON true).fn_set_hook('get_pickup_points_for_checkout_pre', $cart, $pickup_points); — Executes before fetching pickup points for checkout. Allows preventing following script by setting your own list of pickup points.fn_set_hook('get_pickup_points_for_checkout_post', $cart, $pickup_points); — Executes after fetching pickup points for checkout. Allows changing data in pickup points list.fn_set_hook('get_checkout_pickup_points_loader_pre', $cart, $loader); — Executes before getting pickup points loader for checkout. Allows setting your own loader.fn_set_hook('get_checkout_pickup_points_loader_post', $cart, $loader); — Executes after getting pickup points loader for checkout. Allows changing loader data.fn_set_hook('get_pickup_points_for_order_management_pre', $cart, $pickup_points); — Executes before fetching pickup points for order management. Allows preventing following script by setting your own list of pickup points.fn_set_hook('get_pickup_points_for_order_management_post', $cart, $pickup_points); — Executes after fetching pickup points for order management. Allows changing data in pickup points list.fn_set_hook('get_order_management_pickup_points_loader_pre', $cart, $loader); — Executes before getting pickup points loader for order management. Allows setting your own loader.fn_set_hook('get_order_management_pickup_points_loader_post', $cart, $loader); — Executes after getting pickup points loader for order management. Allows changing loader data.fn_set_hook('get_pickup_points_for_order_pre', $order_info, $pickup_points); — Executes before fetching pickup points for order. Allows preventing following script by setting your own list of pickup points.fn_set_hook('get_pickup_points_for_order_post', $order_info, $pickup_points); — Executes after fetching pickup points for order. Allows changing data in pickup points list.fn_set_hook('get_order_pickup_points_loader_pre', $order_info, $loader); — Executes before getting pickup points loader for order. Allows setting your own loader.fn_set_hook('get_order_pickup_points_loader_post', $order_info, $loader); — Executes after getting pickup points loader for order. Allows changing loader data.fn_set_hook('get_storefront_theme_manifest_features_post', $features); — Executes after manifest “features” are loaded for the active storefront theme.- fn_set_hook('get_store_locations_for_shipping_before_select', $destination_id, $fields, $joins, $conditions, \Tygh\Shippings\Services\StoreLocator $this);
+ fn_set_hook('get_store_locations_for_shipping_before_select', $destination_id, $fields, $joins, $conditions, \Tygh\Shippings\PickupPoints\StoreLocatorPickupPointsByLocationLoader $this);
- function fn_set_storage_data($key, $data = '', $allow_empty = false)
+ function fn_set_storage_data($key, $data = '', $allow_empty = false, $expires_at = null)
fn_set_hook('seo_get_schema_org_organization_markup_post', $storefront, $extra, $organization); — Executes when building Organization Schema.org JSON-LD for the storefront homepage, before filtering in the caller.fn_set_hook('seo_get_schema_org_breadcrumb_list_markup_post', $breadcrumbs, $markup); — Executes when building BreadcrumbList JSON-LD from storefront breadcrumbs, before filtering and output.A new Image Panel component is available for placing buttons and other elements on top of a product image. These buttons are now displayed in the top-right corner of the product image by default. Use the Image Panel when you need to add your own buttons or controls on a product image.
Image Panel uses a data-driven API: you describe elements as items in a Smarty array instead of writing overlay HTML by hand. The component handles layout, positioning, sorting, and rendering.
common/product_data.tpl captures Image Panel output when show_image_panel is enabled.views/products/components/image_panel_data.tpl builds the $image_panel_items array and exposes the products:image_panel hook for extensions.views/products/components/image_panel_process.tpl sorts items within each corner.views/products/components/image_panel.tpl renders the panel.Each item is placed in one of four corners:
top_lefttop_rightbottom_leftbottom_rightAdd items to $image_panel_items in the products:image_panel template hook.
Example
design/themes/responsive/templates/addons/wishlist/hooks/products/image_panel.post.tpl
{strip}
{if !$hide_wishlist_button && $show_wishlist_button_on_image_panel}
{$image_panel_items.top_right.add_to_wishlist = [
type => "a",
insert_before_id => "add_to_compare",
id => "button_wishlist_`$obj_prefix``$product.product_id`",
class => "ty-btn ty-btn__tertiary ty-btn-icon ty-add-to-wish cm-submit",
title => __("add_to_wishlist"),
icon => "ty-icon-heart",
element_attrs => [
"data-ca-dispatch" => "dispatch[wishlist.add..`$product.product_id`]"
]
]}
{/if}
{$image_panel_items = $image_panel_items scope=parent}
{/strip}
Important
{$image_panel_items = $image_panel_items scope=parent}.add_to_wishlist). This key is used for ordering and CSS class generation.$show_wishlist_button_on_image_panel and $hide_wishlist_button before adding an item.Add items to $image_panel_items using corner keys. Each corner contains an associative array of items.
Common fields
| Field | Description |
|---|---|
type |
Element type: button, a, or div. If omitted, a is used when href is set; otherwise div is used. |
id |
HTML id attribute. |
name |
HTML name attribute. |
title |
HTML title attribute. |
href |
Link URL. Processed through fn_url. |
class |
CSS classes for the element. |
text |
Text content inside the element. |
icon |
Icon name passed to common/icon.tpl. |
icon_class |
Additional icon CSS classes. |
icon_id |
Icon id attribute. |
icon_title |
Icon title attribute. |
icon_text |
Icon text content. |
icon_data |
Additional icon data array. |
ajax |
When true, adds the cm-ajax class. |
full_render |
When true, adds the cm-ajax-full-render class. |
element_attrs |
Associative array of extra HTML attributes (rel, data-ca-target-id, etc.). |
wrapper_attrs |
Associative array of attributes for the item wrapper. |
content |
HTML content. |
insert_before_id |
Item key to insert this item before. |
insert_after_id |
Item key to insert this item after. |
file |
Custom template file path. When set, the component includes this file instead of rendering the item automatically. |
Custom template rendering
If an item needs non-standard markup, set the file parameter and create a template that receives $item and $item_id:
{$image_panel_items.top_left.my_addon_button = [
file => "addons/my_addon/views/products/components/my_image_panel_button.tpl"
]}
design/themes/responsive/templates/addons/my_addon/views/products/components/my_image_panel_button.tpl
{* $item and $item_id are provided by Image Panel *}
<div class="my-addon-image-panel-button">
{* custom markup *}
</div>
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.