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

  • Posts: 1074
  • Thank you received: 11
  • Hikashop Business
2 months 4 days 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: 83306
  • Thank you received: 13469
  • MODERATOR
2 months 4 days 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: 1074
  • Thank you received: 11
  • Hikashop Business
2 months 3 days ago #365030

I sent you access and FTP.

Thank you

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

  • Posts: 83306
  • Thank you received: 13469
  • MODERATOR
2 months 3 days 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.

  • Posts: 1074
  • Thank you received: 11
  • Hikashop Business
1 month 3 weeks ago #365100

Hi!

It was working up till today but now i see again the quantity and the "add to cart" instead of "choose options" button.
I reinstalled the latest version, disabled the "Front-end Product Listing" option of the item custom fields but it's not working as wanted.

Thank you

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

  • Posts: 83306
  • Thank you received: 13469
  • MODERATOR
1 month 3 weeks ago #365103

Hi,

The way you configured your menu items and custom item fields, it is normal that the products have the "add to cart" button on the products listing.
If you don't want that, then either you want to activate the "required" setting of the custom fields so that the user has to enter something in them (in that case, HikaShop will know that you want the user to go through the product page and will display the "choose options" button instead of the "add to cart" button), or you actually want to turn off the "add to cart button" display option under the "products options" tab of your menu item, and activate instead the "product details" button display option.

The following user(s) said Thank You: verzevoul

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

Time to create page: 0.062 seconds
Powered by Kunena Forum