Add to cart button is different if specific category is not assigned

  • Posts: 1060
  • Thank you received: 11
  • Hikashop Business
2 days 15 hours ago #365017

-- HikaShop version -- : 5.1.2
-- Joomla version -- : 5.2.1

Hi!

I noticed after migration to Joomla 5, if a product is not assigned to "product category" then the Add to cart button says "Add to cart" and not "Choose options". If you inspect the two buttons, the code is different.

For example, if you compare the product "1710031" and the "51951-07-345" you will see what i mean.

The problem is only in products listing page. It's very strange and i cannot figure out the cause of this.

Thank you

Attachments:

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

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
2 days 11 hours ago #365020

Hi,

On listings, if you have the display of the add to cart button activated, HikaShop will display it if possible.
There are several reasons which make it impossible. And in these cases, it will display a "Choose options" button instead which will direct the user to the product details page.

For example, if you have variants for a product, then the user has to be directed to the product page where he will be able to choose the variant before adding it to the cart.

Another example is if the product has options.

And a last possibility is if the product has custom fields of the table "item" which are required and the display of the custom item fields on the listing is not activated.

Since you're saying that based on the assigned category, you get the choose button or the add to cart button, I suppose that you must have custom item fields restricted based on the "categories" setting. And there must be something linked to that.

I think we would need a backend and a FTP access in order to check the situation.

The following user(s) said Thank You: verzevoul

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

  • Posts: 1060
  • Thank you received: 11
  • Hikashop Business
1 day 18 hours ago #365030

I sent you access and FTP.

Thank you

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

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
1 day 16 hours ago #365037

Hi,

The issue is that you've activated the "frontend product listing" display setting of your custom item fields.
When having non required custom item fields with their "frontend products listing" setting activated, with the add to cart button enabed on the listing but the display of the custom item fields turned off on the products listing, HikaShop would fallback to the "choose options" button on the listing even though it should be able to display the "add to cart" button in this particular case. I've made a patch to allow for this and I checked that it fixes the problem on your test website.
Download the install package of HikaShop on our website and install it on yours in order to get the patch for your live website.

The following user(s) said Thank You: verzevoul

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

Time to create page: 0.061 seconds
Powered by Kunena Forum