Can not add more than 60 products to discount

  • Posts: 295
  • Thank you received: 16
  • Hikashop Business
3 months 4 weeks ago #359179

-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.4.2
-- PHP version -- : 8.2.15

When adding products to discount (advanced restrictions), I can only add 60 products.
Is there a limit? How to increase it?

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

  • Posts: 81852
  • Thank you received: 13140
  • MODERATOR
3 months 4 weeks ago #359181

Hi,

There is indeed a limit based on the length of the discount_product_id column in the hikashop_discount table in your database.
You could change the type of that column. It's set by default to 255 characters. You could change it to "text" to allow for up to 65000 characters.
We decided not to change that because normally, if you have so much products to select in a discount, it makes more sense to create an unpublished category and select that category in the discount, and then add it to the products on which you want the discount to apply as a second category. Also, keeping the varchar type instead of text helps with the speed of the MySQL queries.

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

  • Posts: 295
  • Thank you received: 16
  • Hikashop Business
3 months 4 weeks ago #359202

Thank you.
As I understand VARCHAR is A VARIABLE length string (can contain letters, numbers, and special characters). The size parameter specifies the maximum column length in characters - can be from 0 to 65535.
Can I just increase VARCHAR(size) to VARCHAR(500)?

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

  • Posts: 81852
  • Thank you received: 13140
  • MODERATOR
3 months 4 weeks ago #359209

Hi,

Indeed, the maximum value of VARCHAR has been increased at some point with MySQL 5:
stackoverflow.com/questions/13506832/wha...sql-varchar-max-size
Before, the maximum was 256 and in order to support old versions of MySQL, we stuck we 255.
So yes, you can increase the VARCHAR size to 500

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

  • Posts: 295
  • Thank you received: 16
  • Hikashop Business
3 months 4 weeks ago #359229

Great. Working.

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

Time to create page: 0.070 seconds
Powered by Kunena Forum