Huidige code
WooCommerce_MyParcel()->admin->get_tracktrace_links
Wat moet ik nu wijzigen?
-
This reply was modified 5 years, 8 months ago by
darkallman.
Beste @darkallman ,
Je zou de volgende method kunnen gebruiken WCMP_Frontend::getTrackTraceLinks($order_id);
Zo ziet de method eruit:
/**
* @param $order_id
*
* @return array|bool
* @throws Exception
*/
public static function getTrackTraceLinks($order_id): array
{
$track_trace_links = [];
$consignments = self::getTrackTraceShipments($order_id);
foreach ($consignments as $key => $consignment) {
$track_trace_links[] = [
"link" => $consignment["track_trace_link"],
"url" => $consignment["track_trace_url"],
];
}
return $track_trace_links;
}
Dank Richard,
Ik kom er echter nog niet aan uit. Ik blijf een error houden.
PHP message: PHP Fatal error: Uncaught Error: Call to undefined method WCMP_Admin::get_tracktrace_links() in /httpdocs/wp-content/plugins/lieve-labels-tweaks-2/public/class-content.php:851
Stack trace:
#0 /httpdocs/wp-includes/class-wp-hook.php(287): Content->track_trace_email()
#1 /httpdocs/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters()
#2 /httpdocs/wp-includes/plugin.php(478): WP_Hook->do_action()
#3 /httpdocs/wp-content/plugins/woocommerce/templates/emails/email-order-details.php(22): do_action()
#4 /httpdocs/wp-content/plugins/woocommerce/includes/wc-core-functions.php(344): include('/var/www/vhosts...')
#5 /httpdocs/wp-content/plugins/woocommerce/includes/class-wc-emails.php(421): wc_get_template()
#6 /httpdocs/wp-includes/class-wp-hook.php(2...', referer: https://www.lievelabels.nl/wp-admin/edit.php?post_type=shop_order&paged=1&bulk_action=marked_processing-inv&changed=1&ids=91450
Beste @darkallman ,
Ik denk dat je boven in jouw bestand nog het volgend moet zetten:
use WCMP_Frontend;
Via de error lijkt ht alsof er niks is aangepast, wellicht kan dat te maken hebben met cache?
Ik denk dat idd de OP_Cache dwars lag.
Tevens USE WCMP_Frontend toegevoegd. Nu lijkt het in orde!