From version 6 you are able to add extra fields to coupons, products, stores, categories, etc. For a better understanding we’ll start with a small example of extra field added to stores: $extra_fields = array(); $extra_fields[‘owner’] = array( ‘type’ => ‘text’, ‘title’ => ‘Store Owner’, ‘default’ => ” ); add( ‘store-fields’, array( ‘position’ => […]
To add an action for a filter, you should use: add( ‘filters’, ‘filter name’, ‘callback’ ); such as in the following example: function test_filter( $content ) { $new_content = ucwords( $content ); $new_content .= ‘ … and now with a filter applied’; return $new_content; } add( ‘filters’, ‘content’, ‘test_filter’ ); or the same thing […]
Here is the list with all the filters used used by default: store_single – filter on store description when information is for a single store stores_list – filter on store description in a list store_name – filter on store name when information is for a single store stores_name_list – filter on store name in a […]
To add a place for an action (hook) you should use this function: do_action( ‘this_is_a_place_for_a_future_added_action’ ); * it can be used anywhere in your theme To add a callback for an existing place (hook), you should use: add( ‘action’, ‘action or hook’, ‘callback’ ); such as in the following example: function hook_test() { $markup […]
Here is the list with all the hooks used in “Default” theme: before_coupon_outside before_coupon_inside after_coupon_inside after_coupon_outside before_product_outside before_product_inside after_product_inside after_product_outside before_store_outside before_store_inside after_store_inside after_store_outside before_review_outside before_review_inside after_review_inside after_review_outside before_widgets_featured_top after_widgets_featured_top before_widgets_featured_bottom after_widgets_featured_bottom before_widgets_right after_widgets_right store_before_info store_after_info store_before_items store_after_items coupon_before_info coupon_after_info coupon_before_items coupon_after_items product_before_info product_after_info product_before_items product_after_items index_before_search index_after_search user_before_nav user_after_nav user_account_before user_account_after To understand […]
Links to any template page from a Coupons CMS theme can generated by this function: tlink( $type, optional $query_string ); Valid values for parameter $type: index – generate URL to homepage page – generate URL to website address and use query string stores – generate URL to stores template search – generate URL to […]
The following files are mandatory and should be included in any Coupons CMS theme: index.php search.php single.php store.php stores.php category.php page.php site_header.php site_footer.php style.css 404.php The following files are not mandatory but it’s recommended to be included: info.txt – the script is looking into this file for theme information like version, publishder name and website, […]