Products Variants Etc

  • Posts: 62
  • Thank you received: 0
10 years 9 months ago #179717

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3

HI there,

I am trying to get my head around how product variants working but am having problems getting it to display how I want.

I have a product, lets name it 'SleeveJacket'. This product has 4 sizes. iPad, iPad Mini, Macbook, and Macbook Pro. If I create a 'SleeveJacket iPad' it will allow me to create product variants. So I create iPad Mini, Macbook, and Macbook Pro variants.

Then for me to be able to have in that dropdown list on the front end of the variants to have iPad selected, I need to create a variant called iPad, but the model number/product code of that product used as default value has to be different than the parent product, even though when you are on the product page that it uses the variant model number even on the initial loaded page before variants are changed/selected after page load. I need the product code to be the proper product code, while on iPad selection, so this is the first problem. I guess this can be solved by giving the parent product code a dummy code since it uses the product code of the variant on the product page but I would of thought this isnt the way to do it as in the backend it wont be the proper code.

My 2nd problem is if a customer clicks on 'SleeveJacket iPad' product in category page, it will name it SleeveJacket iPad (which is what I want it to do) but when on the product page and you select a variant, it will then change it to 'SleeveJacket iPad : Mini iPad'. I am needing it to change the name of it to just 'SleeveJacket Mini iPad'. Even though I change the name on the variant page to 'SleeveJacket Mini iPad' it only seems to change all the other parts like the content and images applicable to the variant but not the name. How does one achieve this?

Many thanks.

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 9 months ago #179770

Hi,

The main product should be "SleeveJacket" and the characteristic should contains : "iPad", "iPad Mini", "Macbook" and "Macbook Pro".
You can define the variant "SleeveJacket : iPad" as the default variant ; there is no problem for that.
And yes, the main product won't be buy by a customer so his product code is not really important, the product code of the variants are.

You can look at how we made the product with characteristics in our demo website.
demo.hikashop.com/index.php?option=com_h...ow&Itemid=82&lang=en

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 62
  • Thank you received: 0
10 years 9 months ago #179814

Jerome wrote: Hi,

The main product should be "SleeveJacket" and the characteristic should contains : "iPad", "iPad Mini", "Macbook" and "Macbook Pro".
You can define the variant "SleeveJacket : iPad" as the default variant ; there is no problem for that.
And yes, the main product won't be buy by a customer so his product code is not really important, the product code of the variants are.

You can look at how we made the product with characteristics in our demo website.
demo.hikashop.com/index.php?option=com_h...ow&Itemid=82&lang=en

Regards,


Thanks for the reply.

The problem I have with that is the actual product name is SleeveJacket iPad, and not SleeveJacket. And I also have a category that is named SleeveJacket and each in need to be in that category. So going by what you said I could only have one in the category, but each product has a name and needs to populate that category but have the option to be able to change the size to the other product. So it seems like its not possible to do that?

If I cant do that, then I guess I will just to live with it but how do I change and get rid of the ':' colon ? In language?

Thanks.

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

  • Posts: 62
  • Thank you received: 0
10 years 9 months ago #179817

What I ended up doing is to add a new Custom Field and call it 'subname'. I then after 'product_name' added the 'subname' field in the product template, as well as add it to the category template as well. It seems to be an ok solution.

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

  • Posts: 62
  • Thank you received: 0
10 years 9 months ago #179818

Actually it didnt work. Because for some reason the data I enter in the name of 'subname', the data doesnt change when I select the product variant even though I changed the data in the variant.

Is there a way to make that custom field data change when select the other variant? Perhaps the PHP code I use isnt correct to do that?

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

  • Posts: 12953
  • Thank you received: 1778
10 years 9 months ago #180675

Hello,

Is there a way to make that custom field data change when select the other variant? Perhaps the PHP code I use isnt correct to do that?

- How did you configured that custom field ?
- What php code did you used ?

- Instead of using a characteristic, using a "size" Item custom field will probably do the job.
ELSE
- if you want to a "size" characteristic, and want to hide the " : variant_code", you'll have to edit the file "show_default" of the "product" view of your front-end template via "Hikashop->Display->Views".

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

  • Posts: 62
  • Thank you received: 0
10 years 9 months ago #180689

Thanks for the reply.

I need the characteristic to be a dropdown list, so when the user clicks on that it changes to the variant. But the Variant I need for it to change then name (or the custom field that I would call 'subname').

For instance in category view the custom field would be listed after the actual name of the product, so <product>SleeveJacket<subname>10". So in category view I can create different versions of the product so they display in the list.

So after clicking on the product, the product loads and displays its name and subname. But when the user clicks the dropdown box to change to a different size for lets say Macbook, I want the subname (which would be a custom field) to change to Macbook. At the moment I do not know the PHP code to be able to do that. Entering in the data in the variants doesnt change the data when user clicks on the dropdown like the other data like prices and description etc. I need it to change custom fields also.

If I change the code where Product_ID is, I can get the custom field to change but it only replaces the product_ID which is no good. So I guess I know its possible but I cant work out how to replicate that code for the custom fields.

There is no real PHP code to paste since I do not know how to get the product variant drop down list to change the custom field data after clicking.

Thanks.

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 9 months ago #180841

Hi,

The characteristics switching system already handle the switch of the custom product fields display by default in HikaShop.
If that doesn't work on your product page, then it means that the product page has been customized in some way preventing the system to be able to do the switch.
If you revert to the default files of HikaShop for the product view, it should work again.

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

Time to create page: 0.079 seconds
Powered by Kunena Forum