Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter tommix95

    (@tommix95)

    In wp all import:
    Name: _crp_related_ids Value: [list_to_seralized({my_variable[1]})]

    In function wp all import

    function list_to_seralized( $sku ) {
    			$product_ids = array();
    			$skus	 = explode( ",", $sku );
    			// find product ids
    			foreach ($skus as $sku) {
    				$product_ids[] = wc_get_product_id_by_sku($sku);
    			}
    			return serialize($product_ids);
    }

    tested and work. if you have any tips to optimize, let me know.

    Plugin Author WebToffee

    (@webtoffee)

    Hi @tommix95,

    Thanks for reaching out.

    We are looking into it and will get back to you soon.

    Plugin Author WebToffee

    (@webtoffee)

    Hi @tommix95,

    Thanks for waiting. Our sincere apologies for the delayed response. We have gone through the code and it seems ok with the scenario. You can keep using that code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Wp All Import related product based on sku’ is closed to new replies.