• Woocommerce allows to set several types of attributes/variations ordering (by name, by Id, custom ordering). And it works just fine while using woocommerce original template.
    I retrieve variations grammatically ($product->get_available_variations()).
    And the question is: how can I detect the custom order (e.g. menu order)?

    • This topic was modified 8 years, 2 months ago by s976.
Viewing 3 replies - 1 through 3 (of 3 total)
  • $my_product = new WC_Product($variation_id);
    $menu_order = $my_product->post->menu_order;
    
    Thread Starter s976

    (@s976)

    It always returns 0

    Difficult to debug from here. Try var_dump($variation_id); to make sure its the right number, then var_dump($my_product); to make sure its a product object. If so, $post = $my_product->post; var_dump that to check, and so on.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to detect attributes order pro grammatically?’ is closed to new replies.