Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
HeadStand Posted February 9, 2022 Posted February 9, 2022 This was a fun one! I have a client who uses Custom Packages fairly often. Today they created an invoice for a client with a custom package, same way they always do. The client received a notification, logged in to pay the invoice, and when they hit "Pay Now", they received the following error message: "Custom Enterprise License is not available for your account". Error code is 000/B. It seems that as of version 4.6.9, there was a new check introduced to \IPS\nexus\modules\front\checkout\checkout::_pay(), which verifies that the user has permission to purchase the items in the invoice. \IPS\nexus\Package\Product::memberCanPurchase if ( ! ( $this->member_groups == "*" or !empty( ( array_intersect( explode( ",", $this->member_groups ), $member->groups ) ) ) ) ) { throw new \DomainException( $member->language()->addToStack( 'err_group_cant_purchase', FALSE, array( 'sprintf' => array( $member->language()->addToStack( "nexus_package_{$this->id}" ) ) ) ) ); } The above check always fails for custom packages, because nexus_packages.p_member_groups is empty - not null, not *, just empty. Therefore, when the user goes to pay the invoice, it tells them that they're not allowed to do so. I would suggest an override for the memberCanPurchase method in \IPS\nexus\extensions\nexus\Item\CustomPackage to verify that the member purchasing matches the value in nexus_packages.p_custom.
Solution Stuart Silvester Posted February 24, 2022 Solution Posted February 24, 2022 Thank you for you report, a fix will be included in our upcoming release. HeadStand and IPCommerceFan 1 1
Recommended Posts