Cart default value can not be 0

  • Posts: 205
  • Thank you received: 13
  • Hikashop Business
2 weeks 1 day ago #369856

-- HikaShop version -- : 6.1.1

Normally the quantity is displayed in the cart button of the cart module. When the card is empty, I would like to show 0 as value. The problem is that the number 0 get ignored. Also when I change the language string CART_EMPTY="The cart is empty" to CART_EMPTY="0" the value is not shown.



I hope this can be fixed.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 84939
  • Thank you received: 13835
  • MODERATOR
2 weeks 1 day ago #369861

Hi,

The system uses the PHP "empty" function to check the content of that field. And "0" is considered empty by PHP.
You could try to enter

0
in that field. It will be replaced by the browser to "0" automatically.
Otherwise, you can keep the "hide if empty" setting to "default", and use a translation override in order to customize the "The cart is empty" message in the cart module:
CART_EMPTY="0"
www.hikashop.com/download/languages.html#modify

Last edit: 2 weeks 1 day ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 205
  • Thank you received: 13
  • Hikashop Business
2 weeks 11 hours ago #369871

Hi,

Both options do not work. The text field in the module 0 and 0 have the same effect also the language override CART_EMPTY="0" outputs nothing. Do you haven on other solution? Or maybe check string length to check if the fields is empty?

Please Log in or Create an account to join the conversation.

  • Posts: 84939
  • Thank you received: 13835
  • MODERATOR
2 weeks 6 hours ago #369878

Hi,

Use the translation override like this:

CART_EMPTY="<span>0</span>"

The following user(s) said Thank You: Rixters

Please Log in or Create an account to join the conversation.

  • Posts: 205
  • Thank you received: 13
  • Hikashop Business
2 weeks 4 hours ago #369882

Great solution!

Thanks for the feedback!

Please Log in or Create an account to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum