Hi, got this from debug.log:
[26-May-2024 20:05:03 UTC] PHP Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/XXXXXXXX.cloudwaysapps.com/XXXXXXXXXX/public_html/wp-content/plugins/wc-stock-dependencies/admin.php on line 1008
just letting you know, maybe you can fix on a future update. Thank you
]]>Hi Kevin, hope you are doing well.
You think is possible to have the same plugin but instead of stock, make dependencies for prices.
Best regards.
Hi,
I have asked some needed changes on your github repository to make it compatible with batches, are you checking the repository or not at all ?
Many thanks for your feedback ??
]]>This plugin is ideal for what I need. I added the plugin and then set up 1 product to be dependent on another – it worked perfectly. However when I then tried it with another pair of products my site errored with the following:
WordPress version 6.3.2
Active theme: Thrive Theme Builder (version 3.28)
Current plugin: Stock Dependencies for WooCommerce (version 1.6)
PHP version 8.0.30
Error Details
=============
An error of type E_ERROR was caused in line 345 of the file mydomain/public_html/wp-content/plugins/wc-stock-dependencies/admin.php. Error message: Uncaught TypeError: intdiv(): Argument #2 ($num2) must be of type int, string given in mydomain/public_html/wp-content/plugins/wc-stock-dependencies/admin.php:345
Stack trace:
#0 mydomain/public_html/wp-content/plugins/wc-stock-dependencies/admin.php(345): intdiv()
#1 mydomain/public_html/wp-includes/class-wp-hook.php(310): StockDependenciesForWooCommerceAdmin\Admin->product_get_stock_quantity()
#2 mydomain/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#3 mydomain/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-data.php(884): apply_filters()
#4 mydomain/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php(364): WC_Data->get_prop()
#5 mydomain/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php(1393): WC_Product->get_stock_quantity()
#6 mydomain/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php(1414): WC_Product->validate_props()
#7 mydomain/public_html/wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-product-data.php(424): WC_Product->save()
#8 mydomain/public_html/wp-includes/class-wp-hook.php(310): WC_Meta_Box_Product_Data::save()
#9 mydomain/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#10 mydomain/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#11 mydomain/public_html/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-meta-boxes.php(273): do_action()
#12 mydomain/public_html/wp-includes/class-wp-hook.php(312): WC_Admin_Meta_Boxes->save_meta_boxes()
#13 mydomain/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#14 mydomain/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#15 mydomain/public_html/wp-includes/post.php(4753): do_action()
#16 mydomain/public_html/wp-includes/post.php(4855): wp_insert_post()
#17 mydomain/public_html/wp-admin/includes/post.php(445): wp_update_post()
#18 mydomain/public_html/wp-admin/post.php(227): edit_post()
#19 {main}
thrown
Any ideas as I’d love to use this plugin? Thanks
]]>Hello,
I use the Stocks Dependencies for WooCommerce and it works great when the childproducts have stocks in numeric values.
However, when I change it to binary (“In Stock/Out of Stock”), the father product always shows Out of Stock.
Is this a normal beahaviour?
Thank you.
]]>I was sending orders and marking them processed and halfway through when I tried to update an order status from processed to completed I got an error page. And now I get an error page for every order I try to change status. The order that the error first happened on had no products with stock dependencies.
WordPress version 6.3.2
Woocommerce version 8.2.0
Current plugin: Stock Dependencies for WooCommerce (version 1.5)
PHP version 7.4.33
Here is the stack trace from my email:
An error of type E_ERROR was caused in line 270 of the file /home/tieraf7f/public_html/wp-content/plugins/wc-stock-dependencies/admin.php. Error message: Uncaught Error: Call to a member function get_id() on bool in /home/tieraf7f/public_html/wp-content/plugins/wc-stock-dependencies/admin.php:270
Stack trace:
#0 /home/tieraf7f/public_html/wp-content/plugins/wc-stock-dependencies/admin.php(302): StockDependenciesForWooCommerceAdmin\Admin->get_stock_dependency_settings(false)
#1 /home/tieraf7f/public_html/wp-content/plugins/wc-stock-dependencies/admin.php(501): StockDependenciesForWooCommerceAdmin\Admin->has_stock_dependencies(false)
#2 /home/tieraf7f/public_html/wp-content/plugins/wc-stock-dependencies/admin.php(581): StockDependenciesForWooCommerceAdmin\Admin->reduce_order_stock(Object(Automattic\WooCommerce\Admin\Overrides\Order))
#3 /home/tieraf7f/public_html/wp-includes/class-wp-hook.php(310): StockDependenciesForWooCommerceAdmin\Admin->before_save_order_items(15519, Array)
#4 /home/tieraf7f/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(”, Array)
#5 /home/tieraf7f/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#
Hi!
I would like to know when you will make this plugin compatible with HPOS, because at the moment woocommerce doesn’t recognize it as compatible: https://prnt.sc/FB1ijQ-jOLCl
Thank you
]]><span class=”HwtZe” lang=”en”><span class=”jCAhz ChMk0b”><span class=”ryNqvb”>I love this plugin… But WordPress has now reported me a critical error for the second time as follows:</span></span></span>
Ein Fehler vom Typ E_ERROR wurde in der Zeile 270 der Datei /home/customer/www/kreta-natuerlich.de/public_html/wp-content/plugins/wc-stock-dependencies/admin.php verursacht. Fehlermeldung: Uncaught Error: Call to a member function get_id() on bool in /home/customer/www/kreta-natuerlich.de/public_html/wp-content/plugins/wc-stock-dependencies/admin.php:270 Stack trace:
#0 /home/customer/www/kreta-natuerlich.de/public_html/wp-content/plugins/wc-stock-dependencies/admin.php(302): StockDependenciesForWooCommerceAdmin\Admin->get_stock_dependency_settings(false)
#1 /home/customer/www/kreta-natuerlich.de/public_html/wp-content/plugins/wc-stock-dependencies/admin.php(501): StockDependenciesForWooCommerceAdmin\Admin->has_stock_dependencies(false)
#2 /home/customer/www/kreta-natuerlich.de/public_html/wp-content/plugins/wc-stock-dependencies/admin.php(581): StockDependenciesForWooCommerceAdmin\Admin->reduce_order_stock(Object(Automattic\WooCommerce\Admin\Overrides\Order))
#3 /home/customer/www/kreta-natuerlich.de/public_html/wp-includes/class-wp-hook.php(310): StockDependenciesForWooCommerceAdmin\Admin->before_save_order_items(230916, Array)
#4 /home/customer/www/kreta-natuerlich.de/public_html/wp-includes
Any ideas what could cause this and how I can solve?
Thanks in advance, Elke
]]>Great plugin, but I have an issue.
I have 3 variantions (“Pár” = couple; “Chlapec” = boy; “Dívka” = girl).
“Chlapec” has stock 9.
“Dívka” has stock 10.
“Pár” is on “Add stock dependency” to SKUs of “Chlapec” and “Dívka”, both qty1 (e.g., purchasing “Pár” will deduct stock for “Chlapec” and “Dívka” by 1 each].
Front-end shows correctly, also when dumping the stock variable. But upon confirming the cart, there is an error “We no longer have enough XY – Pár in stock to complete your order. Please adjust the quantity of this product in your cart.”
See images.
Can you please assist?
See images here: https://github.com/kmac420/stock-dependencies-for-woocommerce/issues/31
]]>Hi!
I’m using your plugin for a variable product discounting stock for a simple product.
This variation should discount 1 unit from the simple product and it doesn, but then resets sku tock to 0 and no more clients can buy it. Why?
Am I doing something wrong? Please help!
Hi Kevin,
great plugin, thanks for developing! I have rather something like a feature request.
I would like to use stock dependencies with Webtoffee’s subscription plugin.
I have several variable products. To allow recurring deliveries, I have set up variable subscription products, which actually consist of several variations of different variable products.
As webtoffee simply adds two product types, I think enabling stock dependencies on those sites should be not too complicated, no?
Looking forward to your reply!
]]>Hello,
we use your plugin in a store to create a stock connection between 2 products 1:1.
Short explanation: There is a product catalog for products with customization and long delivery time. Every product there has activated stock management, stock = 0 and allowed backorder. Some modifications have been made to the text and delivery times.
Now sometimes there are items in the store that are in stock with shorter delivery time. Special products that are very similar to the products of custom manufacturing. Our Customer wants them to be separate product. The goal now is to connect these stock items with the items from the product catalog. This is what we do with your plugin. So far so good.
Unfortunately, however, your plugin rubbed us after installation for each product the stock_status & the delivery_time.
The products in the catalog should be “onbackorder”, but when your plugin is installed, they are directly “instock”.
This means we no longer have the option to display a different delivery time if the products are on backorder.
Can this be fixed please? Access and website are welcome to submit privately.
]]>I created a Product A with 2 variables (#1 and #2) and their dependency stock is product B. When i go into my POS and check the 2 variables (Quanity #1: 2 and #2: 4) it shows the correct amount.
For example i’ve set the dependency stock to 100 so variable #1 is at automaticly at 50 (100/2) and variable #2 at 25 (100/4).
But Whenever we sell variable #1 or #2 it normaly should reduce the dependency stock by 1.
But it doesnt update at all.
Need some help.
]]>Hi,
Is there any possibilty (even by coding), to update the stock data instead of disable it and leave it to 0 ?
We ask you this, because we work with many marketplaces, and as you can understand, they all sync our stock data with the stock box of Woocommerce. And it’s sending 0 to them whereas we have stock
Many thanks for your feedback
]]>Hi Kevin,
I’m using your plugin for a long time and today I got an alert form a client that cant buy a kit in our store.
The product is available to add to the cart, the quantity of each product is fine but when I press the Complete Order button I get an error message that says “not enough units of error”.
I’ve uploaded the plugin, turn it off and on again, remove it from the kit and setup ip again but is still showing the error.
There is anyway to despiste the error?
Can you help me with this?
Here is the product – https://barbudos.pt/loja/kit-iniciacao-barbudo/ (please use google translate on the page)
Thanks.
]]>Hi, im using WP Lister by WP Lab, when a product is sold on ebay, the stock levels in Woocommerce arent updated. In the WP Lister plugin, it shows that it has updated stock level, but it doesn’t change. Im guessing there is some sue case here not accounted for, is there any suggestions on what I can look into to resolve it?
Thank you! ??
]]>Hello,
I would like to add the 3 fields of this add-on to the CSV template to upload the variations, i have like 2000 variations.
Hopefully someone already did this and can guide me through this.
Thanks guys
Hello!
I'm using your plugins it is great, but your plugins still do not have new updates...
When I made an update to WordPress 5.9.2 your plugin made many problems on my page and on the server. When I made a backup to 5.7.6 everything worked well again.
Do you plan any updates? We can use your plugins only if you plan the next updates. Now it is not proffesional.
Sorry.
WB.
]]>
Hi I’m using your plugin and it’s a great work. Recently I started to use return plugin named: Return Refund and Exchange For WooCommerce
By MakeWebBetter and I realised that stock is not always updated when returning.
Now I’ve been able to find the situation when it doesn’t work.
When you return the product that has no stock and the stock of this product is dependent on other product the stock dependency doesn’t work and the stock is not updated. Do you have any idea how to fix it?
Thank you in advance,
Chris
Hi Kevin,
I was super happy when I found your plugin, it is so useful in our case!
I have a problem though. We have a product (lets call it “A”) which is dependent on two other products (lets call it “B”) (same product just two pieces of that).
When I purchase product “A” the stock is reduced for product “B”, which is good.
But when I set the order status “cancelled” the stock is increased for product “A” and not product “B”, which is obviously not good as it should modify the same stock what was used originally when the order was created.
How can I make it work that way?
]]>Hi.
Hope i cant get some help here.
When orders are canceled, it does not put quantity back in stock status?
Hello,
how can I show product dependecies in cart ?
I want to make auto add in cart product which is connected with product already in cart.
Please let me know how to do that?
]]>Hi there, hope you are doing well.
I been experiencing some issues with last version of the plugin.
The products configured with Stock dependencies cannot be ordered.
Altough at product page the plugin is showing the inventory available, when you go to checkout and try to place the order, the following error appears: Not enough units of “PRODUCT” are available in stock to fulfil this order.
Any idea of what can be the issue?
]]>Hi. i am having some huge issues with this plugin.
Main product is have 100 in stock.
but
– product2 not possible to order. I have set the SKU for the main product, and set the stock to 1.
— product2 is displayed as having 100 in stock.
if i change the stock for product2, to 100. the displayed stock is showing 1.
i have also been trying to select and deselect stock management on product level, without succes. (stock in product level, is also automatically being activate, for some reason).
Stock can go in minus…. and as green and able to order.. ???
Also: a simple guide could be nice on the plugin page ??
any suggestion ?
Hello,
Thank you for you work,
I’m facing an issue with the plugin.
Sometimes, i see that in the orders notes, the stock for the SKU goes to 0 after a customer order, and, unfortunately, when a stock sku goes to 0 it’s doesn’t allow other customer to buy the same products, because on the wheckout, an error message is displayed saying that this products is out of stock or There are not enough units.
Can you please help ?
Thank you.
]]>Hi Kevin, your plugins works very well.
However it is being slowing down the website as the plugin fires too many requests to the database (+1000 just by the plugin ).
I have checked with “Query monitor” and there seem to be a lot of duplicated queries (check the photo links)
https://i.postimg.cc/dtyDSbLs/homepage.jpg
https://i.postimg.cc/RCcZ7c8h/single-product.jpg
Woocommerce version: 5.1
Wordpress Version: 5.5.5
Theme: Porto v6.1.1
Stock Dependencies version: 1.3.1
What could be the issue?
Thanks in advance.
]]>Hi there, great plugin. Was wondering if you could troubleshoot an issue. When a product is out of stock, it used to show a label on the image public facing stating out of stock. However with your plugin this no longer shows? Any chance this can be addressed please?
]]>We make customized hats and in addition to the sizes they have a lot of options. This means that we have a lot of variations per hat product.
Would it be possible to have some bulk edit options for the stock dependency, for example:
– toggle stock dependency
– add new stock dependency
– remove stock dependencies
Hi There! Fantastic plugin you did here ??
Quite unique!
Its weird, when i install and activate the plugin I don’t see the ‘add stock dependency’ option as showed in the documentation under product inventory tab…
I run WooCommerce 4.8.0 & WordPress 5.6 with Astra 2.6.2 + elementor.
Thank you in advance for your help!
]]>Hey Kevin,
I’m making a little software to auto update the stock, and easily add new products to my woocommerce store.
So I was trying to retrieve the _stock_dependency field through the Woocommerce API(Legacy) but the stock dependency doesn’t appear even with this filter -> wc-api/v3/products?filter[meta]=true
I did a little research and I found this code to add to your functions.php file to add custom fields to your product request:
function my_custom_product_api_response( $product ) {
$id = $product['product']['id'];
// Adding your custom field:
$product['product']['custom_field_name'] = get_post_meta( $id, 'custom_field_name', true );
return $product;
}
add_filter( 'woocommerce_api_product_response', 'my_custom_product_api_response' );
But my php is shit so I’m having some trouble figuring this out. I did it like this but as you would expect, it doesn’t work…
By the way my products types are “variable” so that’s why I tried adding it to the variations.
function my_custom_product_api_response( $product ) {
$id = $product['product']['id'];
// Adding your custom field:
$product['variations']['stock_dependency'] = get_post_meta( $id, '_stock_dependency', true );
return $product;
}
add_filter( 'woocommerce_api_product_response', 'my_custom_product_api_response' );
And this is the result
"stock_dependency": false
So if you can point me in the right direction that would help me a lot.
Thanks in advance.
]]>