Viewing 1 replies (of 1 total)
  • Plugin Author WPClever

    (@wpclever)

    Hi @kzain480

    When having a wishlist key, you can get the products by using below code:

    $products = get_option( 'woosw_list_' . $key );

    Example:

    function woosw_wishlist_json( $key ) {
    	$products = get_option( 'woosw_list_' . $key );
    
    	if ( $products ) {
    		var_dump( json_encode( $products ) );
    	}
    }
    
    woosw_wishlist_json( 'W5H5F8' );

    And the result:

    string(112) "{"1602":{"time":1639972471,"note":""},"1601":{"time":1639972469,"note":""},"1604":{"time":1639972466,"note":""}}"

Viewing 1 replies (of 1 total)
  • The topic ‘[NSFW] how i can get list in json format for API’ is closed to new replies.