• Прошу помочь! Актуального решения проблемы на данный момент нет, только для старой версии!

    Как сделать чтобы в вариативном товаре после названия товара ишло название вариации?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Anton Vanyukov

    (@vanyukov)

    @lova00,

    А какое решение Вы раньше использовали? Могу его адаптировать под новую версию

    С уважением,
    Антон

    Thread Starter lova00

    (@lova00)

    Plugin Author Anton Vanyukov

    (@vanyukov)

    Попробуйте в файле includes/class-generator.php заменить

    if ( ! $vendor_model_type ) {
    	$yml .= $this->add_child( 'name', $this->clean( $offer->get_title() ) );
    }

    на

    if ( ! $vendor_model_type ) {
    	$attributes = $product->get_attributes();
    	$offer_name[] = $this->clean( $offer->get_title() );
    	foreach ( $attributes as $param ) {
    		if ( self::woo_latest_versions() ) {
    			$taxonomy = wc_attribute_taxonomy_name_by_id( $param->get_id() );
    		} else {
    			$taxonomy = $param['name'];
    		}
    	
    		if ( isset( $param['variation'] ) && true === $param['variation'] || isset( $param['is_variation'] ) && 1 === $param['is_variation'] ) {
    			$param_value = $offer->get_attribute( $taxonomy );
    		} else {
    			$param_value = false;
    		}
    	
    		// Skip if empty value (when cyrillic letter are used in attribute slug).
    		if ( ! isset( $param_value ) || empty( $param_value ) ) {
    			continue;
    		}
    		/* @var WC_Product_Attribute $param */
    		$offer_name[] = $param_value;
    	}
    	$yml .= $this->add_child( 'name', implode(", ", $offer_name) );
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Правильное название вариативного товара’ is closed to new replies.