• I want to understand what joy did WooCommerce get by deprecating/renaming functions (why is it important ?) :

    woocommerce_get_page_id <— WHY BAD ?

    to

    wc_get_page_id <— WHY GOOD ?

    Now, we have to open all the closed projects and make this change. Everything has a cost, maybe not to you but to us.

    • This topic was modified 7 years, 5 months ago by oumz99. Reason: WooCommerce is making changes without reasons
    • This topic was modified 6 years, 6 months ago by oumz99.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Codex: https://docs.woothemes.com/product/woocommerce-plugin/developer-reference/
    API Docs: https://docs.woothemes.com/wc-apidocs/
    Github for issues and discussion: https://github.com/

    There is a huge developer community. Not sure what you mean or want to see.

    Thread Starter oumz99

    (@oumz99)

    I don;t know how I missed it…..
    I have seen that page at least 10 times and missed the theming snippets part..

    But still I need a little info. here…

    Most of the WooCommerce functions like : woocommerce_show_product_images,woocommerce_template_single_title …..and so on. Output the HTML.
    Like in wordpress we have a the_ID() and a get_the_ID(). Do we have similar functions in WooCommerce ?
    If no any workarounds ? How can I grab the ID/images/title of the product in a php array?

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    If you are working with custom product loops, everything you need is in the $product object which gets populated automatically by the_post()

    Then you just use:

    global $product;
    $product->id;

    etc to get to get data from the product class.

    As for the functions you referenced, some of these are hooked in, some output in the Core WC templates. Those core templates can be overridden via a theme.

    How about you download a free WC theme like myStyle and see how we do themes?

    Thread Starter oumz99

    (@oumz99)

    Yes, I’ve been using overriding core WC templates for quite a while now. And global $product; $product contains $post.
    But it does not fully answer my question. Here’s is a situation I’ve been trying to get an answer of:

    1. I want to show a product in a Post
    2. So I run a custom loop query_post(‘post_type=product&p=123);
    3. Now I want to use standard WooCommerce Templates to show product price/Tabs/Short descriptions/Attributes/Related products etc..
    I have been trying to use woocommerce templates to get this using ob_get_clean but since there is no global $product defined while echoing the template nothing is shown.

    Is there a better way to do the same or am I missing something ?

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Why would you want to show a product in a post, instead of using the actual product post itself? There are shortcodes for outputting products elsewhere too.

    Make a support thread if you want help – 1 star reviews are not the place to get community support ??

    Thread Starter oumz99

    (@oumz99)

    ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Uncessary changes and unstable for devs’ is closed to new replies.