Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter josephwv

    (@josephwv)

    This is currently not checked in my settings

    Thread Starter josephwv

    (@josephwv)

    Just an update, I contacted the Aelia developer about this and they responded with this:

    “Thanks for the information. We can’t analyse 3rd party plugins or test their code, but a quick check indicates that the RFQ plugin you mentioned does indeed override the availability check performed by WooCommerce. 

    The availability check relies on a filter called woocommerce_is_purchasable. The Prices by Country hooks into it, to change the result to false if the product is not available to a specific country. The RFQ plugin uses the same filter to change the availability of a product, using different criteria. The issue occurs because our plugin’s function runs with a priority of 10, whereas the RFQ plugin runs with a priority of 1000, i.e. after the Prices by Country plugin. The RFQ plugin doesn’t check if the product is already unavailable when its function runs, therefore it returns true or false exclusively based on its own criteria.

    Solution

    A proper solution would be to modify the RFQ plugin, so that it takes into account the availability of a product before it applies its own logic. When a product is unavailable, the RFQ plugin should not make it available again. This would involve changing its functions gpls_woo_rfq_normal_is_purchasable and gpls_woo_rfq_normal_is_purchasable, and it’s something that the plugin’s authors would have to do.

    Workaround

    A possible workaround could be to unhook the two functions from the event list, using some custom code, and altering the logic externally. That is, whereas now the functions are called when the filter woocommerce_is_purchasable is triggered, the custom code should remove those functions from the event chain, perform a check for the product’s availability and, if the product is available, call the functions. 

    This is a customisation for a 3rd party plugin, which falls outside the scope of our support service. I would recommend to contact your developer, who should be able to implement it for you. The authors of the RFQ plugin can also verify that such customisation won’t cause side effects in their plugin’s logic.”

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