API: General

$padloper->getShippingCountries()

Get list of all shipping countries for this shop. This will take into account if shop has a Rest of the World (ROW) shipping zone. If true, this will return all list of all countries that have been added to the shop. Otherwise, it will return only the countries saved in the shop's shipping zones.

// get shipping countries for this shop
/** @var array $shippingCountries */
$shippingCountries = $padloper->getShippingCountries();

foreach ($shippingCountries as $shippingCountry) {
    echo $shippingCountry['id'] . '<br>';// e.g. 1235
    echo $shippingCountry['code'] . '<br>';// e.g. CA
    echo $shippingCountry['name'] . '<br>';// e.g. Canada
}
1
2
3
4
5
6
7
8
9

WARNING

The value of this method might change in the future.

$padloper->isProductTrackInventory()

Returns true if a given product tracks inventory, otherwise false.

// check if given product tracks inventory
/** @var bool $isTrackInventory */
$isTrackInventory = $padloper->isProductTrackInventory($product);
$out = !empty($isTrackInventory) ? "Product tracks inventory" : "Product does not track inventory";
echo $out;
1
2
3
4
5

output: Product tracks inventory

INFO

This method is not meant for public use.