• I use the WC API to automatically update my site with price & stock level changes.

    This all works well except for one anomaly – the description for one variation does not show.

    This is a snippet of the data sent via the API, the first and last work perfectly, the second one posts but excludes the description. Not just on this product but others as well, always the 50 gram option.

    Variation_id is: 27256 (This is for a 10 gram bag)
    array(1) {
      ["product"]=>
      array(3) {
        ["regular_price"]=>
        string(4) "8.55"
        ["stock_quantity"]=>
        float(25)
        ["description"]=>
        string(80) "About 462 beads/items. Save around 8% on regular price. [£0.02 each]"
      }
    }
    
    Variation_id is: 27257 (This is for a 50 gram bag)
    array(1) {
      ["product"]=>
      array(3) {
        ["regular_price"]=>
        string(5) "41.70"
        ["stock_quantity"]=>
        float(5)
        ["description"]=>
        string(82) "About 2314 beads/items. Save around 10% on regular price. [£0.02 each]"
      }
    }
    
    Variation_id is: 27258 (This is for a 100 gram bag)
    array(1) {
      ["product"]=>
      array(3) {
        ["regular_price"]=>
        string(5) "78.69"
        ["stock_quantity"]=>
        float(2)
        ["description"]=>
        string(82) "About 4629 beads/items. Save around 15% on regular price. [£0.02 each]"
      }
    }

    The ‘Bag 50 grams’ variation is correctly updated except for the description.

    Am I missing something here?

    I know that when 2.6 is released I will be able to access the variation description directly, so I might be able to see what is going, but I’m stumped at the moment….

    https://www.ads-software.com/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    I don’t see why the file would exclude it. The code is simple:

    if ( isset( $variation['description'] ) ) {
    				update_post_meta( $variation_id, '_variation_description', wp_kses_post( $variation['description'] ) );
    			}

    Is that the code that outputs to the DOM attribute “data-product_variations”? I can definitely see all the other info in there, except the variation description.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Variation description not showing’ is closed to new replies.