Product size selection

  • Posts: 205
  • Thank you received: 12
2 years 11 months ago #332646

-- HikaShop version -- : 4.4.2
-- Joomla version -- : 3.9.25
-- PHP version -- : 7.4.14

Hello
we are importing products from csv files.

Each product has 2 or 3 or 4 sizes that does not affect the price.

The sizes of each product are in the csv size column like this: M,L,XL,XXL (comma separated values).

As i said the size does not affect the price or anything else.

Is there a way to have these values show as a dropdown selection list that will be dynamically created from the csv, avoiding the creation of characteristics, variants, etc? There is no reason of creating variants because everything is the same (info, images, etc) and the price is not affected.

If yes... can the selected value show on the cart and order mail, so that we know what size the client ordered?

No other characteristics (color, material, etc), just the size.

Thank you

Last edit: 2 years 11 months ago by liaskas.

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

  • Posts: 12953
  • Thank you received: 1778
2 years 11 months ago #332669

Hello,

Is there a way to have these values show as a dropdown selection list that will be dynamically created from the csv, avoiding the creation of characteristics, variants, etc? There is no reason of creating variants because everything is the same (info, images, etc) and the price is not affected.

Of course, the solution will be to create a custom field via "Hikashop->Display->Custom fields" and set the :
- "Field type" option to "Single dropdown"
- "Table" option to "Item"

Kind regards,
Mohamed.

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

  • Posts: 205
  • Thank you received: 12
2 years 11 months ago #332696

Is there a way to have these values show as a dropdown selection list that will be dynamically created from the csv, avoiding the creation of characteristics, variants, etc?

Of course, the solution will be to create a custom field via "Hikashop->Display->Custom fields" and set the :
- "Field type" option to "Single dropdown"
- "Table" option to "Item"


Thank you for you reply Mohamed.

We did create the custom field as you suggested. I left the values blank we want them to be "dynamically created from the csv" as we mentioned on our first post.

Where are the values from the csv stored so that each product has a dropdown with it's corresponding sizes?

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
2 years 11 months ago #332703

Hi,

There is a special hidden feature of custom fields to do what you want.
You need to have two custom fields:
- one custom field of the table "item" and the type "single dropdown" without any values.
- one custom field of the table "product" and the type "multiple dropdown" or "checkbox" with all the possible values entered in it.
For that field, make sure that the "column name" is the concatenation of the column name of the first custom field + "_values".
Then, in your CSV, you can import the sizes in that second custom field column and the first custom field will appear on the product page on the frontend with only the values of the product from your CSV available.

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

  • Posts: 205
  • Thank you received: 12
2 years 11 months ago #332721

- one custom field of the table "item" and the type "single dropdown" without any values.

Created

- one custom field of the table "product" and the type "multiple dropdown" or "checkbox" with all the possible values entered in it.

Created

When the second custom field gets values from the csv, everything works as it should. The entered values show with the first field as selectable options.

But...

if the xml does not enter values in the second field, because a particular product does not have size for example, then the second field with all the possible values entered appears. This is not correct because some products or products from other vendors may not need to have size.

We need if the second field does not get values from csv, both fields to be hidden.

How can we do this?

Thank you.

Last edit: 2 years 11 months ago by liaskas.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
2 years 11 months ago #332722

Hi,

In that case, you can enter a new entry to the hikashop_config table via your PHPMyAdmin with the namekey "empty_product_field_values_means_all" and the value "0".
That will then work like you want it to work.

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

  • Posts: 205
  • Thank you received: 12
2 years 11 months ago #332726

Thank you!!!
This did the trick.

We are done with it 99%. The remaining problem has to do with the button that shows in the products list. All the product buttons in the products list became "Choose options" even if there are no options for this product.



The above product has no variants or anything else that requires the client's choice. The button should be "Add to cart" so that products without variants or any other requirements for user choice, to be added to the cart directly.

Is there a way?

Attachments:

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
2 years 11 months ago #332730

Hi,

That's because the listing sees the custom item field you created and since you didn't restrict it to any category or product, the system believes it is necessary for the add to cart.
I suppose that you've activated the "required" option of the custom item field.
If you turn it off, it should display again the add to cart button on listings. You should also activate the display option for custom item fields in the settings of the menu item so that the custom field can be displayed on the listing when necessary. Since it's a dropdown, even if the user doesn't change anything in the dropdown the first value will be selected automatically, so having a dropdown required or not shouldn't change anything, besides allowing it to display the add to cart button on the listing.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum