Error when no shippingAddress is set
This line seems to always fail, resulting in an error (Call to a member function setPid() on bool in line 156) when there is no shipping address:
https://github.com/extcode/cart/blob/8c9c6ea6079d7d892811c1c9b59d754624289e73/Classes/Controller/Cart/OrderController.php#L152
$orderItem->isShippingSameAsBilling() returns nothing, I had to change it to $this->cart->isShippingSameAsBilling() to make it work, don't know if this is the correct way to fix it, tho.
I had to make a bugfix release for this checkbox. Have you had a look at the documentation https://docs.typo3.org/p/extcode/cart/8.6/en-us/Changelog/8.5/Important-404-ChangeCheckboxValueInOrderForm.html?
Please compare the changes in https://github.com/extcode/cart/commit/f7d8505cccd79155370456ef94a3456f9ed602d8#diff-c7948006e90e97ea1ebe377bc61a15963136daf68d8cb4b6e998f8f9f8009af6L20 with the OrderForm.html used in the project.
Does this fix the problem? Otherwise, can you provide me with more information? Which version are you using? ...
Hi,
exactly same problem here, but I think I spotted it.
With settings.showCartAction.showPartials.shippingAddressForm = false the checkbox is not rendered at all due to the condition some lines above the checkbox:
https://github.com/extcode/cart/blob/f7d8505cccd79155370456ef94a3456f9ed602d8/Resources/Private/Partials/Cart/OrderForm.html#L14
thus $orderItem->isShippingSameAsBilling() in
https://github.com/extcode/cart/blob/8c9c6ea6079d7d892811c1c9b59d754624289e73/Classes/Controller/Cart/OrderController.php#L152
is false and the condition jumps to
https://github.com/extcode/cart/blob/8c9c6ea6079d7d892811c1c9b59d754624289e73/Classes/Controller/Cart/OrderController.php#L156
and fails on an empty $shippingAddress because it doesn't seem to get a value other than null in
https://github.com/extcode/cart/blob/8c9c6ea6079d7d892811c1c9b59d754624289e73/Classes/Controller/Cart/OrderController.php#L123
Workaround is to patch the createAction or place the checkbox outside the mentioned condition and make it a hidden field with value 1.
Hope that helps!?
TYPO3 10.4.37 cart 8.6.1 cart_products 4.1.0
Same error here. Shipping and billing address are the same, checkbox is checked, error occurs. Editing the partial did not help.
UPDATE:
I missed the new spelling of shipping_same_as_billing => shippingSameAsBilling in the partial.
Now it works.
@extcode The error does not occur longer as it seems, the author gave no further feedback and other confirmed that it works. Can be closed in my opinion.