Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable additional order-total discounts and/or surcharges #43

Closed
lat9 opened this issue Apr 27, 2023 · 0 comments
Closed

Enable additional order-total discounts and/or surcharges #43

lat9 opened this issue Apr 27, 2023 · 0 comments

Comments

@lat9
Copy link
Owner

lat9 commented Apr 27, 2023

A site- (or plugin-) specific /admin/includes/extra_datafiles can be used to 'register' additional discounts or surcharges provided by other order-total modules. Note that since the extra_datafiles are loaded in file-system order, there's no guarantee of ordering!

Usage:

<?php
// -----
// Register additional order-totals that provide discounts.  Start by initializing to an empty
// array if the variable's not already present.
//
$stats_sales_reports_discounts = $stats_sales_reports_discounts ?? [];
$stats_sales_reports_discounts[] = 'ot_loyalty_discount';

// -----
// Register additional order-totals that provide surcharges.  Start by initializing to an empty
// array if the variable's not already present.
//
$stats_sales_reports_surcharges = $stats_sales_reports_surcharges ?? [];
$stats_sales_reports_surcharges[] = 'ot_insurance';

This usage will enable additional discount/surcharge modules to be added without affecting the base plugin.

@lat9 lat9 added the change label Apr 27, 2023
@lat9 lat9 added this to the v4.0.0 milestone Apr 27, 2023
@lat9 lat9 closed this as completed Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant