Giter VIP home page Giter VIP logo

dpdconnect's People

Contributors

remcotolsma avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

dpdconnect's Issues

Fatal error: Uncaught Error: Call to undefined method `WP_Post::get_id()` in `classes/Handlers/DownloadLabelBox.php:32`

I just tested version 1.4.5 on WordPress 6.3.2:

Fatal error: Uncaught Error: Call to undefined method WP_Post::get_id() in public_html/wp-content/plugins/dpdconnect/classes/Handlers/DownloadLabelBox.php:32
Stack trace:
#0 public_html/wp-admin/includes/template.php(1443): DpdConnect\classes\Handlers\DownloadLabelBox::render()
#1 public_html/wp-admin/edit-form-advanced.php(681): do_meta_boxes()
#2 public_html/wp-admin/post.php(206): require('/home/moosefarg...')
#3 {main}
thrown in public_html/wp-content/plugins/dpdconnect/classes/Handlers/DownloadLabelBox.php on line 32

/**
* @param \WC_Order $order
* @return void
*/
public static function render($order)
{
$labelRepo = new Label();
$shippingLabels = $labelRepo->getByOrderId($order->get_id(), ParcelType::TYPEREGULAR, true);
$returnLabels = $labelRepo->getByOrderId($order->get_id(), ParcelType::TYPERETURN, true);
echo '<table>';
if (!$shippingLabels && !$returnLabels) {
echo '<tr><td>' . __('No labels available.') . '</a></td></tr>';
}
if ($shippingLabels) {
foreach ($shippingLabels as $shippingLabel) {
$shippingId = $shippingLabel['id'];
$shippingUrl = add_query_arg(['plugin' => 'dpdconnect', 'file' => 'shipping_label', 'id' => $shippingId], admin_url());
echo '<tr><td><a href="' . $shippingUrl . '">' . __('Shipping label', 'dpdconnect') . '</a></td>';
echo '<td>' . $shippingLabel['created_at'] . '</td></tr>';
}
}
if ($returnLabels) {
foreach ($returnLabels as $returnLabel) {
$returnId = $returnLabel['id'];
$returnUrl = add_query_arg(['plugin' => 'dpdconnect', 'file' => 'shipping_label', 'id' => $returnId], admin_url());
echo '<tr><td><a href="' . $returnUrl . '">' . __('Return label', 'dpdconnect') . '</a></td>';
echo '<td>' . $returnLabel['created_at'] . '</td></tr>';
}
}
echo '</table>';
}

☚ī¸

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.