Radio Button no default selected.

  • Posts: 256
  • Thank you received: 2
6 years 1 month ago #289557

-- url of the page with the problem -- : 79.170.44.156/kvellandstitch.co.uk/dev/i...s-wear/product/mummy
-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.6
-- PHP version -- : 7.0.27
-- Browser(s) name and version -- : Chrome

Hello,
I have some radio buttons setup for the charactersitics on a product however I am looking to have no default selected when landing on the product page.
So if you then go to try and add the product to the cart, it prompts you with a warning message to please select from all the characteristics before adding to cart.
Is there away to do this? Or possibly something very similar.

I have added the exact page URL above.



Thanks

Attachments:

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
6 years 1 month ago #289558

Hi,

You can add a "please select" value in your characteristics, and in the products, add a variant for these please select values with a quantity of 0 or a sale end date in the past and then customize the no stock or not sold anymore message to say "please select the characteristics before seeing the add to cart button" (or something similar) with a translation override. If fact, with your override message, you could even set a fake add to button with some javascript to display an alert when the customer click on it.

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

  • Posts: 256
  • Thank you received: 2
6 years 1 month ago #289617

Hello Okay thats great. What I have done is add a select colour, select size and select garment characteristic and then any variant of them is set to 0 stock. I have then set these to display none so they do not display on front end.
This gives the illusions nothing is selected to begin with then you need to select all 3 options to add to cart.

However for my client this is a long process to add a new product and every time going through each variant and setting the stock to 0. Is there not an easier way to change the stock to 0 on the 'select' variants?

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

  • Posts: 256
  • Thank you received: 2
6 years 1 month ago #289633

Hello partly answering my question above.

I looked at setting up seperate mass actions for select colour, select size and select garment so it automatically changes these presets to 0 stock. Which works great when I use the manual process button. However I have set the triggering for 'after a product is created' but this doesn't seem to trigger anything.

I have tried copying an existing product and creating a product from scratch but it doesn't seem to update these variants with 0 stock?

Thanks

Attachments:

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
6 years 1 month ago #289623

Hi,

You should only have to add it to the one variant with all the "please select".
You don't have to create the other "please select". If they don't exist, they will be considered with a stock of 0.
You just need to have the default one to be able to select it as the default one.

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

  • Posts: 256
  • Thank you received: 2
6 years 1 month ago #289696

Hello, Yes I understand but I don't want the customer to add the products to cart unless they have selected each of the variants. If I set the default 'please select' for example on colour, then a garment and size variants would have already been selected as default . So I needed one for each so non of the variants are selected default?

I also wanted it so they needed to select all variants available before the cart button appearing. Not just on one variant.

You can preview the website here to see what I have done 79.170.44.156/kvellandstitch.co.uk/dev/i...ear/product/boys-boy

Anyhow it works as I want it now. Do you know how to alter stock 0 as mass action when a new product is created? I have attached screen shots on my previous post.

Thanks

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
6 years 1 month ago #289715

Hi,

I think there is a misunderstanding here.
Let me rephrase with this example:
79.170.44.156/kvellandstitch.co.uk/dev/i...ear/product/boys-boy
Here, you have 2 colors, 2 sizes and one garment (3 characteristics).
That's 2*2*1 = 4 variants in your product.
Then, you want to add the "please select" for each characteristic.
So you need to add ONE variant to that product with the value "please select" for each characteristic.
And you need to select that one variant as default.
You don't need to create other variants like "please select" / 1-2 / shirt or blue / "please select" / shirt on top of that.
That's what I was trying to say.

Altering the stock of a product when the product is created is easy with a mass action, but generating a "please select" variant automatically with a stock of 0 is not possible. But I suppose that what you want is add that variant, not change the stock of the main product, which won't help you.

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

  • Posts: 256
  • Thank you received: 2
6 years 1 month ago #289776

Yes I think I tried it that way originally, for example you load up the page all the 'please select' are set as default so no colour, no size and no garment is selected and the cart button doesn't show. (this works)

However if you now just select a blue colour for example. and keep the size and garment on default still which is 'please select' then the button will display again (I want this so a colour, a size and a garment are selected before button displays)

Because having for example blue, and two default (size and garment) isn't a stock 0 they then show the cart button which I don't want until all are selected.

If your way is meant to work the way I have explained it then there must be something else wrong.

Also all I want the mass action to do is change the stock to 0 when I create a new product.

Thanks

Last edit: 6 years 1 month ago by dancingkazzaf.

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

  • Posts: 256
  • Thank you received: 2
6 years 1 month ago #289781

I am terribly sorry for some reason the way you explained it, I swear it didn't work that way ence why I added the extra variants. However I thought I would just unpublished all the 'please select' except for that one and it works exactly the same way.

If you could explain how to setup the mass action to update the stock on that variant to 0 when you make a new product if possible.

Thanks for being so patient with me.

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
6 years 1 month ago #289780

Hi,


Regarding the mass action, it's really easy then. You need a mass action with a trigger "after a product is created" and an action "update the values" on the column "quantity" with an integer and the value 0.

Last edit: 6 years 1 month ago by nicolas.

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

Time to create page: 0.064 seconds
Powered by Kunena Forum