{"id":18962833,"date":"2026-07-12T07:53:53","date_gmt":"2026-07-12T07:53:53","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/inappropriate-method-used\/"},"modified":"2026-07-12T07:53:53","modified_gmt":"2026-07-12T07:53:53","slug":"inappropriate-method-used","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/inappropriate-method-used\/","title":{"rendered":"Inappropriate method used"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi WPClever team,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I found what appears to be a compatibility issue in WPC Shared Stock (v1.1.5) when used with WooCommerce (10.9.4) variable products.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When a variation is assigned to a shared stock group, it becomes non-purchasable on the frontend. The product page shows &#8220;Please choose a different option&#8221;, and the variation JSON (<code>data-product_variations<\/code>) contains <code>\"is_purchasable\": false<\/code>, even though the variation is enabled, has a valid price, and the shared stock group has available stock.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After debugging, I found that the plugin checks the variation&#8217;s visibility using <code>is_visible()<\/code>. Replacing this with <code>variation_is_visible()<\/code> in <code>\/includes\/class-frontend.php:134<\/code> resolves the issue, and the variation becomes purchasable again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It seems <code>variation_is_visible()<\/code> is the appropriate method for checking the visibility of product variations in this context.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Could you please review this and include a fix in a future release?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you!<\/p>\n","protected":false},"template":"","class_list":["post-18962833","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18962833","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18962833\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18962833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}