• On a 3rd party website, that’s using a custom development made by me, calling $variation->get_name() returns the exact same thing as $variation->get_title() when it shouldn’t.

    Looking at WooCommerce code, the name property is set on the WC_Product_Variation_Data_Store_CPT read method, after calling $this->generate_product_title( $product );

    The generate_product_title does have some rules to return the names of the attributes, or not, but the issue is that this part of the code is not even run on the other website. I’ve tried to var_dump( $new_title ) on line 90 of class-wc-product-variation-data-store-cpt.php and it never happens, which does on my install.

    On both websites this was tried with WordPress and WooCommerce on the latest versions, with Storefront.

    In short: what could be the reason for the WC_Product_Variation_Data_Store_CPT read method not being used at all when getting variations from the database and querying them for the name?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘$variation->get_name() not getting the attributes’ is closed to new replies.