addon_name; } /** * Returns the human name of addon to show somewhere * * @return string */ public function get_slug() { return $this->addon_slug; } /** * Get the main file of addon * * @return string */ public function get_main_file() { return $this->main_file; } /** * Returns the website URL, useful on frontend to link the user to the plugin website * * @return string */ public function get_website_url() { return $this->website_url; } /** * Returns the URI of logo image to show on admin UI * * @return string */ public function get_logo_img() { return PixelCaffeine()->plugin_url() . '/' . self::LOGO_IMG_PATH . $this->addon_slug . '.png'; } /** * Dynamic Ads methods */ /** * Check if the add on supports the event name passed in parameter, useful when the code should know what events * must fire * * @param string $event_name The event name. * * @return bool */ public function supports_event( $event_name ) { return in_array( $event_name, $this->events_support, true ); } /** * Get the events supported by this addon * * @return array */ public function get_event_supported() { return $this->events_support; } /** * Check if an event is enabled * * @param string $event The event name for which check is status. * * @return bool */ public function is_event_enabled( $event ) { return isset( $this->events_enabled[ $event ] ) ? $this->events_enabled[ $event ] : false; } /** * Set the status of an event (enabled or disabled) * * @param string $event The event name. * @param bool $status The status (true = enabled, false = disabled). * * @return void */ public function set_event_status( $event, $status ) { $this->events_enabled[ $event ] = $status; } /** * Set an event as enabled * * @param string $event The name of event to be enabled. * * @return void */ public function enable_event( $event ) { $this->set_event_status( $event, true ); } /** * Set an event as disabled * * @param string $event The name of event to be disabled. * * @return void */ public function disable_event( $event ) { $this->set_event_status( $event, false ); } /** * Get the parameters to send with one of standard event * * @param string $event One of standard events by facebook, such 'ViewContent', 'AddToCart', so on. * @param array $args The arguments to pass for the parameters callback. * * @return array */ public function get_parameters_for( $event, $args = array() ) { $sanitized_event = strtolower( preg_replace( '/(?can_fire( $event ) ) { $params = $this->get_parameters_for( $event, $args ); $user_data = null; if ( ! empty( $params['user_data'] ) ) { $user_data = $params['user_data']; unset( $params['user_data'] ); } if ( null !== $unique ) { $params['unique'] = $unique; } AEPC_Track::track( $event, $params, array(), $user_data ); } } /** * Check if we are in a place to fire the event passed in parameter * * @param string $event One of standard events by facebook, such 'ViewContent', 'AddToCart', so on. * * @return bool */ public function can_fire( $event ) { if ( ! $this->is_event_enabled( $event ) || ! $this->supports_event( $event ) ) { return false; } $event = strtolower( preg_replace( '/(?name for all categories of the shop * * @return array */ public function get_product_categories() { return array(); } /** * Returns the array of all term objects id=>name for all tags of the shop * * @return array */ public function get_product_tags() { return array(); } /** * Return the array with all AEPC_Addon_Product_Item instances for the products to include inside the XML feed * * @param ProductCatalogManager $product_catalog The product catalog entity manager. * @param Metaboxes $metaboxes The metaboxes manager instance. * * @return AEPC_Addon_Product_Item[] */ public function get_feed_entries( ProductCatalogManager $product_catalog, Metaboxes $metaboxes ) { return array(); } /** * Get the feed entries to save into the feed * * @param ProductCatalogManager $product_catalog The product catalog entity manager. * @param Metaboxes $metaboxes The metaboxes manager instance. * * @return AEPC_Addon_Product_Item[] */ public function get_feed_entries_to_save( ProductCatalogManager $product_catalog, Metaboxes $metaboxes ) { return $this->get_feed_entries( $product_catalog, $metaboxes ); } /** * Get the feed entries to edit in the feed * * @param ProductCatalogManager $product_catalog The product catalog entity manager. * @param Metaboxes $metaboxes The metaboxes manager instance. * * @return AEPC_Addon_Product_Item[] */ public function get_feed_entries_to_edit( ProductCatalogManager $product_catalog, Metaboxes $metaboxes ) { return $this->get_feed_entries( $product_catalog, $metaboxes ); } /** * Save a meta in the product post that set the product as saved in the product feed * * @param ProductCatalogManager $product_catalog The product catalog entity manager. * @param \AEPC_Addon_Product_Item $item The add-on product item entity. * * @return void */ public function set_product_saved_in_feed( ProductCatalogManager $product_catalog, \AEPC_Addon_Product_Item $item ) { } /** * Save the meta in the product post that set the product as edited in the product feed * * @param ProductCatalogManager $product_catalog The product catalog entity manager. * @param \AEPC_Addon_Product_Item $item The add-on product item entity. * * @return void */ public function set_product_edited_in_feed( ProductCatalogManager $product_catalog, \AEPC_Addon_Product_Item $item ) { } /** * Delete the meta in the product post that set the product as saved in the product feed * * @param ProductCatalogManager $product_catalog The product catalog entity manager. * @param \AEPC_Addon_Product_Item $item The add-on product item entity. * * @return void */ public function set_product_not_saved_in_feed( ProductCatalogManager $product_catalog, \AEPC_Addon_Product_Item $item ) { } /** * Perform a global delete in one query ideally for all feed status associated to the product catalog * * @param ProductCatalogManager $product_catalog The product catalog entity manager. * * @return void */ public function remove_all_feed_status( ProductCatalogManager $product_catalog ) { } /** * Detect if there are items to save yet or not * * @param ProductCatalogManager $product_catalog The product catalog entity manager. * * @return bool */ public function there_are_items_to_save( ProductCatalogManager $product_catalog ) { return false; } }