/** * Plugin Name: Custom WooCommerce Currency Switcher * Description: A floating currency switcher for WooCommerce with a pop-up selector. * Version: 1.2 * Author: Your Name * License: GPL2 */ // Enqueue CSS and JavaScript function custom_currency_switcher_assets() { wp_enqueue_style('currency-switcher-css', plugin_dir_url(__FILE__) . 'css/currency-switcher.css'); wp_enqueue_script('jquery'); wp_enqueue_script('currency-switcher-js', plugin_dir_url(__FILE__) . 'js/currency-switcher.js', array('jquery'), null, true); wp_localize_script('currency-switcher-js', 'currencySwitcherAjax', array( 'ajax_url' => admin_url('admin-ajax.php'), )); } add_action('wp_enqueue_scripts', 'custom_currency_switcher_assets'); // Ensure WooCommerce session starts properly function start_woocommerce_session() { if (!session_id()) { session_start(); } if (WC()->session) { WC()->session->set('currency', WC()->session->get('currency', 'USD')); } } add_action('init', 'start_woocommerce_session'); // Currency symbols mapping function get_currency_symbols() { return array( 'USD' => '$', 'NGN' => '₦', 'GHS' => '₵', 'ZAR' => 'R' ); } // Add currency switcher HTML (Removed from checkout page) // Add currency switcher only on specific pages function custom_currency_switcher_html() { if (is_checkout() || is_shop()) { return; // Don't show on checkout or shop page } // Check if we're on a single product page and if the product belongs to the "recipe-book" category if (is_product()) { global $post; $product = wc_get_product($post->ID); if (!$product || !has_term('recipe-book', 'product_cat', $product->get_id())) { return; // Hide switcher if not in the "recipe-book" category } } // Ensure it shows on the cart page if (is_cart() || is_product()) { $selected_currency = WC()->session->get('currency', 'USD'); $currencies = array('USD' => 'USD', 'NGN' => 'NGN', 'GHS' => 'GHS', 'ZAR' => 'ZAR'); echo '
'; echo '
Currency: ' . esc_html($selected_currency) . '
'; echo '
'; // Currency Popup echo '
'; echo ''; echo ''; echo '
'; } } add_action('wp_footer', 'custom_currency_switcher_html'); // Handle AJAX currency switching function set_currency() { if (!WC()->session) { WC()->initialize_session(); } if (isset($_POST['currency'])) { $currency = sanitize_text_field($_POST['currency']); WC()->session->set('currency', $currency); // Ensure prices update dynamically via AJAX WC()->cart->calculate_totals(); wp_send_json_success(array('currency' => $currency)); } else { wp_send_json_error(array('message' => 'Invalid request')); } wp_die(); } add_action('wp_ajax_set_currency', 'set_currency'); add_action('wp_ajax_nopriv_set_currency', 'set_currency'); // Display correct price and currency symbol function custom_currency_display_price($price, $product) { if (!WC()->session) { WC()->initialize_session(); } $selected_currency = WC()->session->get('currency', 'USD'); $currency_symbols = get_currency_symbols(); $custom_price = get_post_meta($product->get_id(), '_custom_price_' . strtolower($selected_currency), true); if (!empty($custom_price)) { $symbol = isset($currency_symbols[$selected_currency]) ? $currency_symbols[$selected_currency] : $selected_currency; return $symbol . number_format($custom_price, 2); } return $price; } add_filter('woocommerce_get_price_html', 'custom_currency_display_price', 10, 2); // Update Cart & Checkout Prices Based on Selected Currency function update_cart_totals($cart) { if (!WC()->session) { return; } $selected_currency = WC()->session->get('currency', 'USD'); $currency_symbols = get_currency_symbols(); foreach ($cart->get_cart() as $cart_item) { $product = wc_get_product($cart_item['product_id']); $custom_price = get_post_meta($product->get_id(), '_custom_price_' . strtolower($selected_currency), true); if (!empty($custom_price)) { $cart_item['data']->set_price($custom_price); } } } add_action('woocommerce_before_calculate_totals', 'update_cart_totals', 10, 1); // Ensure Checkout Uses Selected Currency and Symbol function set_currency_at_checkout($currency) { if (WC()->session) { return WC()->session->get('currency', 'USD'); } return $currency; } add_filter('woocommerce_currency', 'set_currency_at_checkout'); // Add AJAX refresh for cart page when switching currency function refresh_cart_on_currency_change() { wc_add_notice(__('Currency updated successfully.', 'woocommerce'), 'success'); wp_send_json_success(); } add_action('wp_ajax_refresh_cart', 'refresh_cart_on_currency_change'); add_action('wp_ajax_nopriv_refresh_cart', 'refresh_cart_on_currency_change'); // Add custom price fields for different currencies in the product edit page function add_custom_currency_fields() { global $post; echo '
'; $currencies = array( 'USD' => 'US Dollar', 'NGN' => 'Nigerian Naira', 'GHS' => 'Ghanaian Cedi', 'ZAR' => 'South African Rand' ); foreach ($currencies as $currency_code => $currency_label) { woocommerce_wp_text_input(array( 'id' => '_custom_price_' . strtolower($currency_code), 'label' => __('Price in ' . $currency_label, 'woocommerce'), 'desc_tip' => 'true', 'description' => __('Set a fixed price for ' . $currency_label . '.', 'woocommerce'), 'type' => 'number', 'custom_attributes' => array( 'step' => '0.01', 'min' => '0' ), )); } echo '
'; } add_action('woocommerce_product_options_pricing', 'add_custom_currency_fields'); // Save the custom prices function save_custom_currency_fields($post_id) { $currencies = array('USD', 'NGN', 'GHS', 'ZAR'); foreach ($currencies as $currency) { $field_id = '_custom_price_' . strtolower($currency); if (isset($_POST[$field_id])) { update_post_meta($post_id, $field_id, sanitize_text_field($_POST[$field_id])); } } } add_action('woocommerce_process_product_meta', 'save_custom_currency_fields'); // Handle AJAX request to fetch product price based on selected currency function get_product_price_by_currency() { if (!isset($_POST['product_id']) || !isset($_POST['currency'])) { wp_send_json_error(array('message' => 'Invalid request.')); } // Get the product ID and selected currency $product_id = intval($_POST['product_id']); $currency = sanitize_text_field($_POST['currency']); // Ensure WooCommerce session is initialized if (!WC()->session) { WC()->initialize_session(); } // Define your currency symbols mapping (you can modify it) $currency_symbols = array( 'USD' => '$', 'NGN' => '₦', 'GHS' => '₵', 'ZAR' => 'R', ); // Get the custom price for the selected currency $custom_price = get_post_meta($product_id, '_custom_price_' . strtolower($currency), true); // If custom price is not set, use the regular price if (empty($custom_price)) { $product = wc_get_product($product_id); $custom_price = $product->get_price(); } // Get the correct currency symbol $currency_symbol = isset($currency_symbols[$currency]) ? $currency_symbols[$currency] : '$'; // Return the formatted price wp_send_json_success(array( 'price' => $currency_symbol . number_format($custom_price, 2), )); } add_action('wp_ajax_get_product_price', 'get_product_price_by_currency'); add_action('wp_ajax_nopriv_get_product_price', 'get_product_price_by_currency'); Yam Porridge – Joyful-cook Skip to main content

Yam Porridge

Yam porridge with stir-fry beef is a warm, satisfying dish full of rich flavors that will transport you to the heart of Nigerian cuisine. Whether you’re cooking it for a family gathering or a special meal, this dish is sure to please everyone. The creamy yam combined with the spicy, savory sauce is the ultimate comfort food!

Yam Porridge

Yam Porridge with Stir-Fry Beef – A Rich, Flavorful Comfort Food

I remember when I first tried yam porridge, and my taste buds were forever changed. Growing up, yam was often boiled and served as a side dish, but when it’s made into a porridge, it takes on a whole new depth of flavor. This dish is one of those comforting meals that hits the spot whether you’re craving something hearty or just need a delicious home-cooked meal to warm you up. It’s savory, a bit spicy, and rich from the palm oil, making it the perfect dish for any occasion.

What is Yam Porridge ?

Yam porridge is a traditional Nigerian delicacy that’s rich, hearty, and bursting with flavor. Paired with tender stir-fry beef, this dish is not only comforting but also incredibly satisfying. It’s perfect for family dinners or gatherings, and it offers a balance of savory and spicy flavors. Get ready for a bowl of deliciousness that will warm you up from the inside out!

What you’ll need Main Ingredients for Yam Porridge:

  • Stir-fry beef (cut into pieces): Adds protein and flavor, making the dish hearty and filling.
  • Yam (peeled and cut into small pieces): The base of this dish. Yam provides a soft and starchy texture that absorbs all the delicious flavors.
  • Palm oil: Adds richness and depth of flavor, giving the porridge its signature color and taste.
  • Seasoning cubes: Essential for seasoning the beef and yam, bringing out the savory umami flavors.
  • Onions: For flavor and aroma, both sautéed and cooked in the porridge for added depth.
  • Eru (vegetable): A leafy green that adds texture and a unique taste to the dish. You can substitute it with spinach or kale if needed.
  • Ground crayfish: Adds a rich, earthy flavor that complements the yam and beef.
  • Powdered bell pepper: Provides a mild sweetness and a beautiful color to the sauce.
  • Scotch bonnet pepper (blended): For that signature spicy kick that’s essential to many Nigerian dishes.

How to Make Yam Porridge:

  1. Cook the Beef: Heat some oil in a pan and add the stir-fry beef. Cook for 4-5 minutes until the beef is well-browned. Add one seasoning cube, stir, and set aside.
  2. Boil the Yam: Add the peeled and cut yam pieces to a pot with enough water to cover the yams. Add salt and onions, and let it cook until the yam is soft.
  3. Prepare the Sauce: In another pan, heat palm oil and add three seasoning cubes and chopped onions. Fry for about a minute, then add the Eru (or spinach) and grounded crayfish. Stir for 1-2 minutes, being cautious not to burn the crayfish.
  4. Fry the Pepper Mix: Add the powdered bell pepper and scotch bonnet pepper to the oil. Let it fry until the mixture reduces and becomes dry.
  5. Combine the Yam and Sauce: Once the yam is cooked, add it to the sauce. Mix everything well and break up the yam if you want a creamier texture. If the mixture seems too thick, add a bit of water and let it simmer for 5-7 minutes.
  6. Adjust and Serve: Taste and adjust the seasoning. You can add a bit of spinach or kale for extra nutrition. Simmer for an additional 30 seconds before removing from heat. Serve hot!

How to Serve Yam Porridge

Yam porridge is rich enough to be a stand-alone meal, but there are a few ways you can elevate it:

  • With Fried Plantain: You can’t go wrong with a side of dodo (fried plantains). The sweetness of the plantains balances the savory flavor of the yam porridge.
  • Serve with Fried Fish or Chicken: Add extra protein by pairing the porridge with fried fish or crispy fried chicken.
  • With Steamed Vegetables: For a more balanced meal, serve with a side of steamed vegetables like carrots, peas, or green beans.
  • As a Hearty Dinner: This dish is filling on its own. Add a glass of fresh juice or a cold drink to complete the meal.

Pro Tips for Perfect Yam Porridge

  • Use Fresh Ingredients: Fresh yam and good-quality palm oil are key to making a flavorful dish. Fresh produce and spices always make the difference.
  • Don’t Overcook the Yam: You want the yam to be tender, but not mushy. Keep an eye on it while it cooks to make sure it doesn’t disintegrate into the porridge too soon.
  • Fry the Sauce Properly: The longer you fry the pepper mix, the richer the flavor becomes. Let the oil separate from the pepper paste to get that authentic Nigerian flavor.
  • Adjust the Thickness: If the porridge is too thick, add a little water. If it’s too watery, let it simmer uncovered to reduce the sauce.
  • Seasoning is Key: The seasoning cubes and crayfish give the porridge its distinctive umami flavor. Don’t skimp on these for a flavorful result.

How to Make Your Yam Porridge Extra Special

While this recipe is already full of flavor, here are some simple tips and variations you can try to make your yam porridge even more unique:

  • Add More Vegetables: You can include spinach, kale, or any leafy green you love for extra nutrition.
  • Use Coconut Oil: For a richer, slightly different flavor, you can swap palm oil for coconut oil.
  • Spice it Up: For more heat, add more scotch bonnet pepper or even a pinch of cayenne pepper.
  • Add Tomatoes: For a slightly tangy taste, include fresh chopped tomatoes when frying the sauce mixture.

Frequently Asked Questions

  • Q: Can I use a different type of meat for this recipe?
  • A: Absolutely! If you prefer chicken, goat meat, or even fish, they can be substituted for stir-fry beef. Just adjust the cooking times accordingly.
  • Q: How do I know when the yam is cooked?
  • A: The yam is ready when it is soft and tender enough to be pierced with a fork or knife. If it’s hard or firm, let it cook for a few more minutes.
  • Q: Can I prepare yam porridge in advance?
  • A: Yes! You can make yam porridge in advance and store it in an airtight container in the fridge for up to 3 days. Just reheat it thoroughly before serving. Add a little water or broth if it becomes too thick.
  • Q: Can I make this dish vegetarian?
  • A: Yes! Simply omit the stir-fry beef and use vegetable broth or water for cooking the yam. You can still enjoy the dish with the flavorful vegetable sauce and crayfish.

Enjoy this hearty, flavorful meal that brings comfort in every bite. Whether for a cozy dinner or a weekend gathering, yam porridge with stir-fry beef is sure to satisfy your cravings!

Yam Porridge

Yam porridge with stir-fry beef is a warm, satisfying dish full of rich flavors that will transport you to the heart of Nigerian cuisine. Whether you’re cooking it for a family gathering or a special meal, this dish is sure to please everyone. The creamy yam combined with the spicy, savory sauce is the ultimate comfort food!

  • Prep Time: 10 mins
  • Cook Time: 35 - 40 mins
  • Marinate: None
  • Serving Size: 4 People
Pin

Ingredients

For Yam Porridge

Instructions

  1. Heat some oil in a pan.
  2. Add stir-fry beef and cook for 4-5 minutes.
  3. Add 1 seasoning cube and stir. Avoid adding curry or thyme.
  4. Remove from heat after 5 minutes.
  5. Add peeled and cut yam pieces to a pot.
  6. Add water, salt, and onions.
  7. Cover and cook until the yam is soft.
  8. Heat palm oil in another pan.
  9. Add 3 seasoning cubes and chopped onions. Fry for 1 minute.
  10. Add eero and crayfish. Stir for 1-2 minutes, being careful not to burn the crayfish.
  11. Add powdered bell pepper, onions, and scotch bonnet pepper to the oil.
  12. Fry until the mixture reduces and becomes dry.
  13. Add cooked yam to the sauce.
  14. Mix well and break up the yam if desired for a creamy texture.
  15. If the mixture is too dry, add a bit of water and let it simmer for 5-7 minutes.
  16. Taste and adjust seasoning if needed.
  17. Optional: Add spinach or kale. Simmer for 30 seconds.
  18. Remove from heat and serve.
Instagram Icon

Did you make this recipe? Tag or mention @joyfulcook_. I would love to hear from you!

Recipe Video

What do you think?

Rate this recipe

Average Rating: 0 / 5

Leave a Reply

Your email address will not be published. Required fields are marked *