Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Yup re-saving the product did the trick. Thanks Mike. I’ll be waiting for 2.4.2 push to upgrade my live store.

    Cheers!

    OK I’ll try re-saving the product and check if it rectifies the issue. Thanks for all the help ??

    I updated this file in my test build and things are slightly better in that ‘Free’ isn’t displaying anymore.

    I think the next step would be to modify the code such that if ‘Show Out of Stock items’ is true and price is not empty, it should return the price.

    One curious thing that I noticed and may be of interest to you Mike. I am using a child theme with a custom functions.php. In this I am hooking my custom functions to:

    1. Override the default ‘From-to’ range notation for variations with different pricing to show a simple ‘Starting from’ followed by the minimum price of the variation (irrespective of whether it is out of stock or not since the business logic for display is non-discretionary on this factor).

    2. Replace the default ‘Sale’ notation with a banner with maximum percentage discount available.

    In the first case, because I just need the minimum/maximum variation regular price and sale price, I am using the get_variation_price() (for current price) and get_variation_regular_price() (for regular price). From what I understood in the function definition, both these functions place calls to the get_variation_prices() function, which in turn calls the get_price() function that is part of the WC_Product class definition. Effectively the $price, $regular_price and $sale_price properties are not getting populated for the variation if it is out of stock. Hence those functions are turning up blanks (or previously ‘Free’ price tags).

    In the second case, since I need to calculate the discount for each variant and then display the lowest one, I am handling the price myself using get_post_meta(). In this case, I am checking for regular price and active price to both be populated and ignoring cases where regular price is blank (to avoid divide by zero situations). Out of Sale notification are handled by a filter hook on woocommerce_get_availability that displays a custom Out of Sale notice. In this case I am getting proper results where the sales banner is getting the correct sales percentage irrespective of whether the variation is In Stock or not.

    Since I am using the Mystile theme, I even thought to switch back once to the parent theme and give it a go but in line with my expectation, it was the same behaviour. (Plus the same child theme was working till yesterday so my deduction is that something changes in the function my custom functions are calling, causing a break in functionality).

    So, I’m going to get down into the bowels of the php code to see if I can fix it (on my local copy, of course. Live store is back to 2.3 for now.) Please do let me know if you figure something out before I do (odds on you will!)

    Aaah great! Now to pull this commit into my test environment. Correct me if I’m wrong but I just need to pull the class-wc-product-variable.php and replace the existing one, right?

    Will there be a 2.4.2 to include this fix anytime soon?

    Hi Mike

    I think I have edge cases here. Let me enumerate:

    Show Out of Stock items in catalog: Enabled
    Variation Enabled: True
    Variation Regular Price: set to value
    Variation Sale Price: set to value
    Stock quantity: 0
    Stock Status: Out of stock

    In cases where all variations are out of stock, WC is showing the product as free (this is changed behaviour, because till yesterday the exact same products were showing up correctly albeit with an ‘Out of Stock’ notification for the customer since backorders are not allowed).

    In cases where a few variations are out of stock, WC is not reporting the sale price on the out of stock items (again a change in behaviour from 2.3.x). Hitherto, even if all my ‘On Sale’ variations were out of stock, WC was faithfully showing a price range in lieu of the sale price to reflect the differential pricing of the variations. That’s gone now.

    Also, in the single product template, previously, WC would show the variation price beneath the drop down selectors once the customer had chosen the desired options. Now nothing shows up.

    I know I’m just listing down issue after issue but the site owner was really unhappy with what the store looked like today morning (largely my fault for not testing fully before pushing into production) and so I’m currently downgrading his WC version back to the last 2.3.x series but I would love to upgrade to the 2.4 build as soon as possible.

    Thanks for all the help and support.

    Yup Nik. I was thinking along the same lines so I did revert the stock level to 0 and the price indeed went back to ‘Free’. I am currently restoring my webstore over a crappy internet connection back to 2.3.x to at least get it back online. I’ll leave my local copy on 2.4.1 to test any fixes Claudio may suggest. Also kicking myself for not having checked the development version thoroughly! Lesson for the future :/

    Thanks Nik for the update. By flush, you mean flushing the browser cache?

    Also, I was testing out a few things on my local development copy. Apparently, the issue arises only for “out of stock” variations/products (I have enabled display of out of stock items in my shop) if that gives a clue to Claudio or one of the other developers. Simply increasing the stock quantity by 1 resolved the issue for the product I was testing on.

    I upgraded to 2.4.1 manually (by uploading the folder to my server via ftp). Plugin version shows up correctly in the dashboard. I also upgraded the database when prompted by WooCommerce to do so. Yet the price appears as ‘Free’ on some (not all) of my variable products. Could somebody please help me out here? My store has been pulled down for the time being till further notice ??

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