[Magento 1] Plugin tries to show delivery options on products without delivery option, breaking the sale page
Closed this issue · 6 comments
Make sure you are using the latest version: https://tig.nl/postnl-magento-extensies/
Issues with outdated version will be rejected.
- I've verified and I assure that I'm running the latest version of the TIG PostNL Magento extension.
$ modman update postnl-magento1
Already up to date.
Magento version 1.9.3.6, cache and compilation disabled.
What is the purpose of your issue?
- Bug report (encountered problems with the TIG PostNL Magento extension)
- Site support request (request for adding support for a new site)
- Feature request (request for a new functionality)
- Question
- Other
Description of your issue, suggested solution and other information
PostNL tries to erroneously show a delivery option/gekozen bezorgoptie on products that don't have any on the Sales details page of a product, thus breaking the rendering of the entire page:
A look at the HTML shows the page abruptly ending at:
<script type="text/javascript">
sales_order_view_tabsJsTabs = new varienTabs('sales_order_view_tabs', 'sales_order_view', 'sales_order_view_tabs_order_info', []);
</script>
</div>
<div class="main-col" id="content">
<div class="main-col-inner">
<div id="messages"></div>
<div class="hor-scroll" id="postnl_delivery_option_info">
<table cellspacing="0" class="form-list">
<tr>
<td class="label"><label>Gekozen bezorgoptie</label></td>
<td class="value">
<strong>
The product doesn't have any shipping options as it is a digital subscription (through Adyen Subscriptions).
I've enabled PHP error reporting and it shows:
Fatal error: Call to a member function getCountryId() on boolean in (...)/public_html/.modman/postnl-magento1/app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/View/DeliveryOptions.php on line 115
Said line contains:
$countryId = $order->getShippingAddress()->getCountryId();
As there is no shipping address as this is a virtual order, this makes sense.
So it seems the root of the problem lies in the PostNL module handling virtual orders that don't have shipping enabled at all.
For now I've worked around the issue by adding:
$order = $this->getOrder();
if(!$order->getShippingAddress()) return;
to app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/view/delivery_options.phtml
, but this is a rather nasty "fix" of course.
Hey @SharkWipf,
We'll be investigating your issue further because virtual orders should never contain a PostNL order. I've created a backlog item for you and I'll inform you right away once we know more.
Kind Regards,
Jeffrey Peeters
TIG
Hey @SharkWipf,
I'm terribly sorry for the late reply, I lost track of your issue and only just noticed I hadn't replied to you yet.
We've tried to reproduce your issue but we couldn't do it on our end. We'd like to investigate this further so could you contact us via servicedesk@tig.nl? If you'd be able to provide us with the required credentials for your envrionment we can take a look at the problem with you.
Kind Regards,
Jeffrey Peeters
TIG
Hi @SharkWipf,
Did you figure out a solution for this or send us a mail about this? i'm currently cleaning up our Github and i'm curious if this has been solved or if you need support on this issue. You can still mail us on servicedesk@tig.nl.
Kind regards,
Jasper Smits
TIG
Apologies, I've been terribly busy and haven't gotten around to replying to this yet.
We still have the issue, but considering it doesn't seem to happen on a clean installation this bug report can probably be closed.
Right now it isn't too much of an issue for us, but if it becomes a problem we'll be in touch through the service desk.