wc_product = wc_get_product($this->ID); } public function price() { return $this->wc_product->get_price(); } public function get_price_html() { return $this->wc_product->get_price_html(); } public function get_attr() { return $this->wc_product->get_attribute('pa_compound'); } }; add_filter('timber/post/classmap', function ($classmap) { $custom_classmap = [ 'product' => WooProduct::class, ]; return array_merge($classmap, $custom_classmap); });