geodesicsolutions-community / geocore-community

GeoCore Community, open source classifieds and auctions software
MIT License
9 stars 6 forks source link

Storefront Addon #228

Open iBeleave opened 5 months ago

iBeleave commented 5 months ago

Several errors in the storefront addon, with solutions that worked for me:

  1. \addons\storefront\admin.php ~341 (array needs quotes in brackets) remove:

    $display_values[$count] = $subscription_details[display_value];
    $numberofdays[$count] = $subscription_details[value];
    $value_plural[$count] = ($subscription_details[value] == 1) ?  "" : "s";
    $amount[$count] = sprintf("%0.2f", $subscription_details[amount]);
    $trial[$count] = (($subscription_details['trial'] == 1) ? true : false);
    $period_ids[$count] = $subscription_details[period_id];

    replace with:

    $display_values[$count] = $subscription_details['display_value'];
    $numberofdays[$count] = $subscription_details['value'];
    $value_plural[$count] = ($subscription_details['value'] == 1) ?  "" : "s";
    $amount[$count] = sprintf("%0.2f", $subscription_details['amount']);
    $trial[$count] = (($subscription_details['trial'] == 1) ? true : false);
    $period_ids[$count] = $subscription_details['period_id'];
  2. \addons\storefront\order_items\storefront_subscription.php:40 (count on nonarray)

remove:

$tpl->assign('periods', $planItem_periods);
$tpl->assign('periodCheck', (bool)($planItem->get('free_storefronts') || count($planItem->get('periods')) > 0));

replace with:

$planItem_periods = $planItem->get('periods');
$tpl->assign('periods', $planItem_periods);
$tpl->assign('periodCheck', (bool)($planItem->get('free_storefronts') || (is_countable($planItem_periods) && count($planItem_periods) > 0)));

3. Error: Non-static method Admin_site::getConfigurationData() cannot be called statically \addons\storefront\admin.php:570

remove:

$this->configuration_data = Admin_site::getConfigurationData();

replace with:

$this->admin_site = Singleton::getInstance('Admin_site');
$this->configuration_data = $this->admin_site->getConfigurationData();