Backend Initialization
Core Offer Templates and Sections are initialized and stored in global values, $nx_offers_sections_config and $nx_offers_template_config, though the nx_init_offers_configs() function hooked on the init action. These variables contain multiarrays of data which map out the fields and type of contents each Offer /Section template has.
Core Section fields initialization
$nx_offers_sections_config = [ 'promotional_banner' => [ 'name' => 'Promotional Banner', 'type' => 'promotional_banner', 'allowed' => nx_check_offer_template_is_active(['promotional_banner']), 'core' => true, ], 'home_top_slider' => [ 'name' => 'Top Slider Αρχικής', 'type' => 'slider', 'allowed' => nx_check_offer_template_is_active(['banner_slide']), 'core' => true, ], 'active_offers_widget' => [ 'name' => 'Ενεργές Προσφορές Widget', 'type' => 'listing', 'allowed' => nx_check_offer_template_is_active(['banner']), 'core' => true, ], 'coupon_banners' => [ 'name' => 'Banners Κουπονιού', 'type' => 'coupon', 'allowed' => nx_check_offer_template_is_active(['text_link']), 'core' => true, ], 'sticky_banner' => [ 'name' => 'Sticky Banner', 'type' => 'sticky_banner', 'allowed' => nx_check_offer_template_is_active(['text_link']), 'core' => true, ], 'mystery_gifts' => [ 'name' => 'Mystery Προσφορές', 'type' => 'mystery_gifts', 'allowed' => [], 'core' => true, ], 'league_offers' => [ 'name' => 'Προσφορές πρωταθλημάτων', 'type' => 'league_slider', 'allowed' => nx_check_offer_template_is_active(['img_slide']), 'core' => true, ], 'ads_for_affiliates' => [ 'name' => 'Ads For Affiliates', 'type' => 'listing', 'allowed' => nx_check_offer_template_is_active(['ad_for_affiliates']), 'core' => true, ], 'affiliates_offers' => [ 'name' => 'Προσφορές εταιριών', 'type' => 'term_slider', 'term' => 'stoiximatikes-etairies', 'allowed' => nx_check_offer_template_is_active(['img_slide']), 'core' => true, ], 'casino_offers' => [ 'name' => 'Προσφορές casino', 'type' => 'term_slider', 'term' => 'casino', 'allowed' => nx_check_offer_template_is_active(['img_slide', 'casino_slide']), 'core' => true, ], 'gift_feed' => [ 'name' => 'Gift Feed Προσφορών', 'type' => 'listing', 'allowed' => nx_check_offer_template_is_active(['img_slide', 'casino_slide']), 'core' => true, ], 'latest_offers_slider' => [ 'name' => 'Latest Offers Slider', 'type' => 'slider', 'allowed' => nx_check_offer_template_is_active(['text_over_image']), 'core' => true, ], ];
The key of each section is the section ID which is later used in the React App to store and display offers connected to these sections (e.x section shortcodes use this ID as argument section_id).
- Name: The name displayed for each section.
- Type: Type of section, slider/term_slider/listing. More info here.
- Allowed: Offer templates allowed to be displayed in these sections, core sections allow only specific core templates but this is configurable through each section’s settings, allowing you to toggle through any Offer Template. Function nx_check_offer_template_is_active() checks if the Offer Template is enabled first.
Core Templates initialization
$nx_offers_template_config = [ 'banner' => [ 'name' => 'Banner', 'preview_image' => NX_OFFERS_URL . 'includes/app/src/assets/bannerType2.jpg', 'fields' => array_merge($common_offers_fields, [ 'old_shortcode' => [ 'label' => 'OLD SHORTCODE ID:', 'type' => 'text', 'setting_type' => 'toggle', 'description' => 'ID παλιών προσφορών (legacy offers για ορισμένα site με παλιές προσφορές στο παρελθόν)', ], ]), 'features' => $common_offers_features, ], 'text_link' => [ 'name' => 'Text Link', 'preview_image' => NX_OFFERS_URL . 'includes/app/src/assets/bannerType3.jpg', 'fields' => array_merge( $common_offers_fields, [ 'old_shortcode' => [ 'label' => 'OLD SHORTCODE ID:', 'type' => 'text', 'setting_type' => 'toggle', 'description' => 'ID παλιών προσφορών (legacy offers για ορισμένα site με παλιές προσφορές στο παρελθόν)', ] ] ), 'features' => $common_offers_features ], 'banner_slide' => [ 'name' => 'Slide Banner', 'preview_image' => NX_OFFERS_URL . 'includes/app/src/assets/bannerType1.jpg', 'fields' => array_merge($common_offers_fields, [ 'affiliate_name' => [ 'label' => 'Όνομα Εταιρίας', 'type' => 'text', 'setting_type' => 'toggle', 'description' => 'Εμφάνιση Ονόματος Εταιρίας.' ], ] ), 'features' => $common_offers_features, ], 'img_slide' => [ 'name' => 'Slide Image Banner', 'preview_image' => NX_OFFERS_URL . 'includes/app/src/assets/bannerType5.jpg', 'fields' => array_merge($common_offers_fields,[ 'no_deposit' => [ 'label' => 'Χωρίς Κατάθεση', 'type' => 'checkbox', 'setting_type' => 'toggle', 'description' => 'Πληροφορία για το αν η προσφορά χρειάζεται κατάθεση (τοποθετείται extra κλάσης για δυνατότητα διαχείρισης εμφάνισης μέσω φίλτρων).' ] ]), 'features' => array_merge($common_offers_features, [ 'expire_time' => [ 'label' => 'Countdown λήξης:', 'type' => 'checkbox', 'setting_type' => 'toggle', 'description' => 'Countdown ωρών μέχρι την λήξη.' ], 'affiliate_label' => [ 'label' => 'Εμφάνιση affiliate label', 'type' => 'checkbox', 'setting_type' => 'toggle', 'description' => 'Εμφάνιση ενός label με λεκτικό το όνομα του Affiliate κάτω από το banner.' ] ]) ], 'casino_slide' => [ 'name' => 'Slide Casino Banner', 'preview_image' => NX_OFFERS_URL . 'includes/app/src/assets/bannerType4.jpg', 'fields' => array_merge($common_offers_fields, [ 'casino_type' => [ 'label' => 'Επιλογή τύπου κάρτας', 'type' => 'dropdown', 'content' => 'casino_types', 'setting_type' => 'toggle', 'description' => 'Τύπος κάρτας Casino, η κάθε κάρτα έχει διαφορετικά assets με animation.' ] ]), 'features' => $common_offers_features ], 'promotional_banner' => [ 'name' => 'Promotional Banner', 'preview_image' => NX_OFFERS_URL . 'includes/app/src/assets/bannerType6.jpg', 'fields' => $common_offers_fields, 'features' => array_merge($common_offers_features, [ 'show_modal' => [ 'label' => 'Εμφάνιση Modal:', 'type' => 'checkbox', 'setting_type' => 'toggle', 'description' => 'Εμφάνιση Modal στο click του banner, αν είναι απενεργοποιημένο τότε με το κλικ σε πηγαίνει κατευθείαν στην προσφορά.' ] ]), ], 'ad_for_affiliates' => [ 'name' => 'Ad for Affiliates', 'preview_image' => NX_OFFERS_URL . 'includes/app/src/assets/bannerType7.jpg', 'fields' => $common_offers_fields, 'features' => $common_offers_features ], 'notification_offer' => [ 'name' => 'Notification Offer', 'preview_image' => NX_OFFERS_URL . 'includes/app/src/assets/bannerType8.jpg', 'fields' => array_merge($common_offers_fields, [ 'button_text' => [ 'label' => 'CTA text', 'type' => 'text', 'setting_type' => 'toggle', 'description' => 'Κείμενο CTA προσφοράς.', ] ]), 'features' => $common_offers_features ], 'text_over_image' => [ 'name' => 'Text Over Image Slide', 'preview_image' => NX_OFFERS_URL . 'includes/app/src/assets/bannerType9.jpg', 'fields' => $common_offers_fields, 'features' => $common_offers_features ], ];
The key of each template is the template ID which is later used in the React App to display the corresponding template.
- name: The name displayed for each section.
- preview_image: Preview Image of the Offer Template.
- fields: All the fields that exist and can be used in the Offer Templates. The $common_offers_fields array contains all the common fields among the templates, any extra fields are merged with the $common_offers_fields.
- features: Specific features that can be used in the Offer Templates. The $common_offers_features array contains all the common features among the templates, any extra features are merged with the $common_offers_features .