Title: PHP error
Last modified: November 20, 2023

---

# PHP error

 *  [Daniele](https://wordpress.org/support/users/dabesa/)
 * (@dabesa)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/php-error-618/)
 * Hello guys,
 * I built my first box, when I add the selected products to the checkout I get 
   the message:
 * **Please wait a moment while we prepare your custom gift box!**
 * But admin-ajax is failing with error 500 and this PHP error is generated:
 *     ```wp-block-code
       Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, WC_Product_Attribute given in /var/www/html/site/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart.php:993
       Stack trace:
       #0 /var/www/html/site/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart.php(993): trim(Object(WC_Product_Attribute))
       #1 /var/www/html/site/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart.php(1148): WC_Cart->generate_cart_id(227452, 0, Array, Array)
       #2 /var/www/html/site/public_html/wp-content/plugins/doko-box-builder/public/class-hs-doko-public.php(524): WC_Cart->add_to_cart(227452, '1', 0, Array, Array)
       #3 /var/www/html/site/public_html/wp-includes/class-wp-hook.php(324): Hs_Doko_Public->add_to_cart('')
       #4 /var/www/html/site/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
       #5 /var/www/html/site/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
       #6 /var/www/html/site/public_html/wp-admin/admin-ajax.php(188): do_action('wp_ajax_doko_wc...')
       #7 {main}
         thrown
       ```
   
 * Is this plugin still working on latest WC versions?
 * Thanks
   Daniele

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Daniele](https://wordpress.org/support/users/dabesa/)
 * (@dabesa)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/php-error-618/#post-17222183)
 * Dear support,
 * It turn out that this happens when one of the products in out-of-stock.
 * I think is a bug, it should not be possible for a customer to add out-of-stock
   products in the box.
 * Thanks
 *  Plugin Author [UltiWP](https://wordpress.org/support/users/homescript/)
 * (@homescript)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/php-error-618/#post-17223891)
 * Hello [@daniele](https://wordpress.org/support/users/daniele/),
 * Thank you for highlighting and sharing details about this issue. We are currently
   working on a patch to address it. We will provide further updates in our support
   panel.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP error’ is closed to new replies.

 * ![](https://ps.w.org/doko-box-builder/assets/icon-256x256.png?rev=2776783)
 * [Doko Bundle Builder : The Ultimate dynamic bundle builder for WooCommerce](https://wordpress.org/plugins/doko-box-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/doko-box-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/doko-box-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/doko-box-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/doko-box-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/doko-box-builder/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [UltiWP](https://wordpress.org/support/users/homescript/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/php-error-618/#post-17223891)
 * Status: not resolved