Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @doyuk

    I want to print WordPress Attributes information in one area. I have to do this using translations by language.

    If you’re looking to print a dynamic list of attributes/values per product in this format, you’d have to write a custom PHP function that outputs the attributes as you desire: https://www.wpallimport.com/documentation/export/pass-data-through-php-functions/.

    Here’s an example that you can modify as needed:

    function my_output_atts( $id ) {
    	$xml = '';
    	if ( $product = wc_get_product( $id ) ) {
    		$atts = $product->get_attributes();
    		foreach ( $atts as $att => $att_object ) {
    			// parse and output values here
    			// see: https://docs.woocommerce.com/wc-apidocs/class-WC_Product_Attribute.html
    		}
    	}
    	return $xml;
    }
    Plugin Author WP All Import

    (@wpallimport)

    @doyuk I am marking this as resolved since we haven’t heard back. You can follow up here with any questions.

    Anyone else, please start a new topic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Attributes Export Features’ is closed to new replies.