What's new
Xen Factory

Register today to become a member! Once signed in, you'll be able to start purchasing our products, ask questions, request support and suggest new ideas!

Bug Fixed Can't Add Multiple Child Resources to Cart

VisEntities

Active Member
There's an error showing up in the server logs related to cart plugin

Code:
Server error log
ErrorException: [E_WARNING] Attempt to read property "CartItems" on null src/addons/XFA/RMMarketplaceCart/Listener.php:89
Generated by: RKid Apr 19, 2025 at 9:35 PM
Stack trace
#0 src/addons/XFA/RMMarketplaceCart/Listener.php(89): XF::handlePhpError(2, '[E_WARNING] Att...', 's...', 89)
#1 src/XF/Extension.php(86): XFA\RMMarketplaceCart\Listener::appPubRenderPage(Object(XF\Pub\App), Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#2 src/XF/App.php(3368): XF\Extension->fire('app_pub_render_...', Array, NULL)
#3 src/XF/Pub/App.php(619): XF\App->fire('app_pub_render_...', Array)
#4 src/XF/App.php(2573): XF\Pub\App->renderPageHtml('

...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#5 src/XF/Mvc/Dispatcher.php(414): XF\App->renderPage('

...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#6 src/XF/Mvc/Dispatcher.php(66): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#7 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#8 src/XF.php(806): XF\App->run()
#9 index.php(23): XF::runApp('XF\\Pub\\App')
#10 {main}
Request state
array(4) {
  ["url"] => string(9) "/plugins/"
  ["referrer"] => string(47) "https://game4freak.io/plugins/gamemode-ffa.140/"
  ["_GET"] => array(1) {
    ["/plugins/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
Last edited:
I did some testing and found the root of the issue:
  • There’s a parent resource: Gamemode Core
  • And two child resources: Gamemode Gun Game and Gamemode Aim Train
The user already owns the parent (Gamemode Core) as a standalone purchase. Now, when they try to add the child resources to their cart:
  • They can add one child plugin just fine
  • But when they try to add a second child plugin, it fails (It doesn't even show the 'Add to Cart' button), they can only have one child in the cart at a time

This seems to happen only when the parent was purchased separately before the children were available (I guess)

23444.PNG767776.PNG

EDIT The issue seems to be that the 'Add to Cart' button doesn’t necessarily disappear after adding one child resource, it disappears after adding any resource with parent or not
 
Last edited:
I'm planning to run a sale later today, so if we can get this resolved beforehand, that’d be appreciated. If not, no worries I’ll just delay the sale a bit
 
EDIT The issue seems to be that the 'Add to Cart' button doesn’t necessarily disappear after adding one child resource, it disappears after adding any resource with parent or not
There must be something else because I just tried and was able to add 2 resources to the cart.
Is it true for all child resources that you can't add them to the cart or any resource child or parent ?
 
There's an error showing up in the server logs related to cart plugin

Code:
Server error log
ErrorException: [E_WARNING] Attempt to read property "CartItems" on null src/addons/XFA/RMMarketplaceCart/Listener.php:89
Generated by: RKid Apr 19, 2025 at 9:35 PM
Stack trace
#0 src/addons/XFA/RMMarketplaceCart/Listener.php(89): XF::handlePhpError(2, '[E_WARNING] Att...', 's...', 89)
#1 src/XF/Extension.php(86): XFA\RMMarketplaceCart\Listener::appPubRenderPage(Object(XF\Pub\App), Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#2 src/XF/App.php(3368): XF\Extension->fire('app_pub_render_...', Array, NULL)
#3 src/XF/Pub/App.php(619): XF\App->fire('app_pub_render_...', Array)
#4 src/XF/App.php(2573): XF\Pub\App->renderPageHtml('

...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#5 src/XF/Mvc/Dispatcher.php(414): XF\App->renderPage('

...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#6 src/XF/Mvc/Dispatcher.php(66): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#7 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#8 src/XF.php(806): XF\App->run()
#9 index.php(23): XF::runApp('XF\\Pub\\App')
#10 {main}
Request state
array(4) {
  ["url"] => string(9) "/plugins/"
  ["referrer"] => string(47) "https://game4freak.io/plugins/gamemode-ffa.140/"
  ["_GET"] => array(1) {
    ["/plugins/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
I think why this error pops-out but it's not related to the other one.
 
That does not necessarily clarify, I don't know what you already bought or not.
Does the user already bought the parent ?
 
Ok so what I should understand is the first message, you can't add two child resources from the same parent.
 

From bespoke add-on development to complex integrations and specialized enhancements, we offer a range of XenForo development services designed to help your community thrive.

Start discussing your needs
Back
Top
Cart