API: Addons
Padloper addons API allows you to retrieve your addon Class or saved configurations for use in the frontend of your shop
- $padloper->getAddonClassByName($addonName)
- $padloper->getAddonClassByClassName($addonClassName)
- $padloper->getAddonClassByTitle($addonTitle)
- $padloper->getAddonClassByPageID($addonPageID)
- $padloper->getAddonConfigurationsByName($addonName)
- $padloper->getAddonConfigurationsByClassName($addonClassName)
- $padloper->getAddonConfigurationsByTitle($addonTitle)
- $padloper->getAddonConfigurationsByPageID($addonPageID)
- $padloper->getAddonPage($titleOrNameorID)
- $padloper->getAddonsSettings()
Padloper gives you a number of methods to retrieve an addon Class and/or its saved configurations in the frontend. These are outlined below.
$padloper->getAddonClassByName($addonName)
Get the Class
of a given addon by its name.
$addonName = 'my-awesome-addon';
/** @var object $addonClass */
$addonClass = $padloper->getAddonClassByName($addonName);
2
3
$padloper->getAddonClassByClassName($addonClassName)
Get the Class
of a given addon by its Class name.
$addonClassName = 'MyAwesomeAddon';
/** @var object $addonClass */
$addonClass = $padloper->getAddonClassByClassName($addonClassName);
2
3
$padloper->getAddonClassByTitle($addonTitle)
Get the Class
of a given addon by its title.
$addonTitle = 'My Awesome Addon';
/** @var object $addonClass */
$addonClass = $padloper->getAddonClassByTitle($addonTitle);
2
3
$padloper->getAddonClassByPageID($addonPageID)
Get the Class
of a given addon by its page ID.
$addonPageID = 3065;
/** @var object $addonClass */
$addonClass = $padloper->getAddonClassByPageID($addonPageID);
2
3
$padloper->getAddonConfigurationsByName($addonName)
Get the configurations for a given addon by its name.
$addonName = 'my-awesome-addon';
/** @var array $addonConfigurations */
$addonConfigurations = $padloper->getAddonConfigurationsByName($addonName);
2
3
$padloper->getAddonConfigurationsByClassName($addonClassName)
Get the configurations for a given addon by its Class name.
$addonClassName = 'MyAwesomeAddon';
/** @var array $addonConfigurations */
$addonConfigurations = $padloper->getAddonConfigurationsByClassName($addonClassName);
2
3
$padloper->getAddonConfigurationsByTitle($addonTitle)
Get the configurations for a given addon by its title.
$addonTitle = 'My Awesome Addon';
/** @var array $addonConfigurations */
$addonConfigurations = $padloper->getAddonConfigurationsByTitle($addonTitle);
2
3
$padloper->getAddonConfigurationsByPageID($addonPageID)
Get the configurations for a given addon by its page ID.
$addonPageID = 3065;
/** @var array $addonConfigurations */
$addonConfigurations = $padloper->getAddonConfigurationsByPageID($addonPageID);
2
3
$padloper->getAddonPage($titleOrNameorID)
Get the page
for a given addon by its title, name or page ID.
$titleOrNameorID = 'My Awesome Addon';
/** @var Page|NullPage $addonPage */
$addonPage = $padloper->getAddonPage($titleOrNameorID);
# OR
$titleOrNameorID = 3065;
/** @var Page|NullPage $addonPage */
$addonPage = $padloper->getAddonPage($titleOrNameorID);
2
3
4
5
6
7
$padloper->getAddonsSettings()
Get the settings for all addons installed in the shop.
/** @var array $addonsSettings */
$addonsSettings = $padloper->getAddonsSettings();
2