Okay
  Public Ticket #2391732
Small issue with WooCommerce mini cart template
Closed

Comments

  • Česlav started the conversation

    Hello,

    I've noticed that Kalium uses its own version of woocommerce/templates/cart/mini-cart.php template file (kalium/tpls/wc-mini-cart.php).

    My problem is that the WooCommerce template uses WC_Product::get_name() method to render cart item names, while Kalium uses WC_Product::get_title() method. See: https://github.com/woocommerce/woocommerce/blob/4.1.0/templates/cart/mini-cart.php#L35

    There is a slight but quite important difference between the two - in case of variable product, the get_name() method outputs product title with any selected attributes (like color or size), while the latter not.

    Example - let's assume I put two variations of the same T-shirt of different size and color in the cart.

    Legacy WooCommerce template renders:

    - Fancy T-shirt - XL, black
    - Fancy T-shirt - M, white

    Kalium template renders:

    - Fancy T-shirt
    - Fancy T-shirt

    Would you consider updating the kalium/tpls/wc-mini-cart.php file to use the same method as the legacy template?

  • [deleted] replied

    Hi Česlav,

    Thank you for pointing out this issue. I have managed to fix and now the items use get_name() method instead of get_title():

    medium
    (view large image)

    So here is the quick fix for you until the 3.0.1 is released:

    https://d.pr/f/6YbfUm

    Just replace in tpls directory.

  • Česlav replied

    Hi Arlind,

    I've just installed version 3.0.1 and everything works as expected now. Thank you for quick fix!

    Kind regards,

    Česlav


  • [deleted] replied

    Hi Česlav,

    Happy to hear that, and thanks for reporting this problem.

    Have a great day and be safe!

    P.S: If you like our theme, it would help us a lot if you could give us five star rating on themeforest from your Downloads tab.

    A huge thank you from Laborator in advance!