Multiply options

  • Posts: 49
  • Thank you received: 7
  • Hikashop Multisite
1 year 2 months ago #349491

-- HikaShop version -- : 4.7.1
-- Joomla version -- : 4.2.8
-- PHP version -- : 8.0.16
-- Browser(s) name and version -- : Chrome 110.0.5481.100

Hello,

I'm working on a new Hikashop project for an ice cream shop. There are 4 products:

  • bucket with 1 scoop of ice cream
  • bucket with 2 scoops of ice cream
  • bucket with 3 scoops of ice cream
  • bucket with 4 scoops of ice cream
There are 86 flavours to choose from.

What I've done so far:
Under Characteristics I've created one item which holds the 86 flavours. After that I've created a product in the root [which isn't visible in the front end]. That product, let's call it Option 1, has all the 86 characteristic options.

At product Bucket 1 scoop of ice cream, I only have to select the Option 1 once. At Bucket 2 scoops of ice cream I would like to select the Option 1 twice, unfortunately that isn't possible. At least, I'm not getting it right. And so on for the 3 and 4 scoops versions.

Why do I only prefer only 1 Option 1 with 86 characteristics? Because not all of them are available each day. I could copy the Option 1 for the other scoops, but then my client needs to check 4x the 86 flavours.

I really hope there is a way to only use Option 1 multiple times... Please let me know if something isn't clear, I've done my best to translate it to something readable ;-)

Regards,
Ans

PS: the Hikashop pages are currently hidden and only open for Super Administrators. Please let me know if you want to have access to the front- and/or back-end.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
1 year 2 months ago #349495

Hi,

It's indeed not possible to use the same product several times to get several options.
So I would have indeed recommended duplicating the option product.
But as you said, this means having to edit each option product when adding/removing flavors.

So instead, I think you need to create 4 custom fields of the table "item" and under the "DATA" section, instead of entering the values, use the MySQL query mode with that MySQL query:

SELECT characteristic_value AS value FROM #__hikashop_characteristic WHERE characteristic_parent_id = XX;
where XX is the id of the characteristic where you have the flavors listed. That way, all 4 custom fields will use the values of the characteristic so you'll only have to add/remove/change the values in the characteristic and it will automatically reflect in the 4 custom fields.

Last edit: 1 year 2 months ago by nicolas.
The following user(s) said Thank You: Ans van Tongeren

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

  • Posts: 49
  • Thank you received: 7
  • Hikashop Multisite
1 year 2 months ago #349522

Hi Nicolas,

I've copied all steps as described above, unfortunately that resolves in an error:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 9' at line 1

My steps:
  • Created a new custom field
  • Table > Item
  • Field type: Single drop down selection
  • Entered
    SELECT characteristic_value AS value FROM #__hikashop_characteristic WHERE characteristic_parent_id == 9;
    into the MySQL query box, where 9 is the characteristic parent id
Right after saving the error is being displayed, in the frontend the webshop is showing the same error.

I'm probably doing something wrong, but I haven't got a clue where/what? Can you please help me with this?

Thank you very much in advance!

Regards,
Ans

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
1 year 2 months ago #349523

Hi,

sorry, I made a typo. It should be just one = not == in the MySQL query.

The following user(s) said Thank You: Ans van Tongeren

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

  • Posts: 49
  • Thank you received: 7
  • Hikashop Multisite
1 year 2 months ago #349525

No problem at all, it only makes you 'human'...! :-D

I've tried it again, and I think this is just what I was looking for. Little typo or not, you're still the hero of the day [at least for me].

Merci beaucoup Nicolas!

Ans

The following user(s) said Thank You: nicolas

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

  • Posts: 49
  • Thank you received: 7
  • Hikashop Multisite
11 months 1 week ago #351692

Hello Hikashop Team,

Instead of asking for help, this is a message to send you an enormous THANK YOU for your help during this [and other] projects. This was the first shop I've created and configured by myself, with help from you. I've learned so much, I loved every step of it. Besides all of that, my client is more than satisfied, that means the world to me!
So thank you for the helping hand now and then, you really can't imagine how good it is to know you're there when I feel like giving up...

It's a pity I'm not in the neighborhood, otherwise I would have come by to bring you a big bunch of flowers [I'm Dutch, so flowers, tulips, bulbs, wooden shoes, you name it ;) ]

Have a great weekend!

Regards,
Ans

The following user(s) said Thank You: nicolas

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
11 months 1 week ago #351702

Hi,

Thanks ! It's always rewarding to read such a message !

Don't hesitate posting a comment on the JED for HikaShop if it's not already done:
extensions.joomla.org/extension/hikashop/
Getting new good reviews there helps spread the love :)

The following user(s) said Thank You: Philip, Ans van Tongeren

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

  • Posts: 49
  • Thank you received: 7
  • Hikashop Multisite
11 months 1 week ago #351709

Been there, done that [this afternoon]. I've genuinely been spreading the word of love...! Thank you! :)

The following user(s) said Thank You: Philip

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

Time to create page: 0.068 seconds
Powered by Kunena Forum