Files
torebki-fabiola.pl/wp-content/plugins/woocommerce-dhl/classes/class-flexible-shipping-manifest.php
2026-03-05 13:07:40 +01:00

36 lines
1.0 KiB
PHP

<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( class_exists( 'WPDesk_Flexible_Shipping_Manifest' ) ) {
class WPDesk_Flexible_Shipping_Manifest_dhl extends WPDesk_Flexible_Shipping_Manifest implements WPDesk_Flexible_Shipping_Manifest_Interface {
public function __construct( $manifest ) {
parent::__construct( $manifest );
}
public function get_number() {
return $this->get_meta( '_number' );
}
public function get_manifest() {
$manifest = array(
'file_name' => 'inpost_manifest_' . $this->get_number() . '.pdf',
'content' => file_get_contents( ABSPATH . '/wp-content/plugins/woocommerce-paczkomaty-inpost/class/manifest.pdf' )
);
return $manifest;
}
public function generate() {
$this->set_meta( '_number', rand(1,10000000) );
}
public function cancel() {
$this->delete_meta( '_number' );
}
}
}