Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nishapanFFF/487e3727d30ecd917e4618c8715521b7 to your computer and use it in GitHub Desktop.
Save nishapanFFF/487e3727d30ecd917e4618c8715521b7 to your computer and use it in GitHub Desktop.
////////// DB info + queries ////////////
To get active season's edit or addon campaign id & customize campaign id:
select campaign_id as addon_or_edit_sale_campaign_id, customize_campaign_id from shop_seasons where position = 1;
To get select (and in the future annual_access_select) role's addon/edit shopping window period:
select title, start_date as select_start_date, select_end_date, regular_start_date, end_date as regular_end_date from shop_addons_campaigns where id = 48;
To get regular (non select) role's shopping window period:
select title, regular_start_date, end_date as regular_end_date from shop_addons_campaigns where id = 48;
To get customize campaign name:
select title from shop_customize_campaigns where id = 17;
////////// addon/edit campaigns //////////
Admin tool url for addon/edit campaign custom content:
1. login as admin in shop
2. go to https://fff-dev.com/wp-admin/admin.php?page=addon-custom-content
3. select campaign name (need to look up the name using id from above query).
Admin tool code for addon/edit campaign custom content:
shop-container/src/shop/wp-content/plugins/woocommerce-recurly-subscriptions/templates/addon/admin/addons-custom-content.php
To add custom content for annual_access_select see similar usage of select role:
CUSTOM_CONTENT_SELECT_USERS_SELECT_EVENT_NOT_OPEN_YET / CUSTOM_CONTENT_SELECT_USERS_SELECT_EVENT_CLOSED
To support annual_access_select role as a usertype similar to select role:
ADDON_USER_SELECT
shop-container/src/shop/wp-content/plugins/woocommerce-recurly-subscriptions/models/UserSeason.php > getUserType(...)
Save custom content:
shop-container/src/shop/wp-content/plugins/woocommerce-recurly-subscriptions/models/AddonsCampaign.php
Read custom content:
getAddonSettingsTwoWindow
shop-container/src/shop/wp-content/plugins/woocommerce-recurly-subscriptions/models/AddonContent.php
////////// customize campaigns //////////
We want to prevent annual_access_select role user from seeing customize content.
Admin tool url for customize campaign:
login to shop as admin
go to https://fff-dev.com/wp-admin/admin.php?page=customize
pick campaign name (look up by id based on query above)
Admin tool code for customize campaign:
shop-container/src/shop/wp-content/plugins/woocommerce-recurly-subscriptions/templates/customize/admin/customize-campaign/content-tab.php
To add custom content for annual_access_select see similar usage of trial role:
TRIAL_CONTENT
Save custom content:
CustomizeCampaignSingle.php > save_campaign(..)
Read custom content:
CustomizeCampaignContentV2.php > getContent(..) > getContentKeyTwoWindow | getContentKeyNotTwoWindow
// here is where we return annual_access_select custom content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment