- Posts: 71
- Thank you received: 2
Characteristics and options selection method
-- HikaShop version -- : 2.x.x
-- Joomla version -- : 3.x
-- PHP version -- : 5.x.x
-- Browser(s) name and version -- : chrome
-- Error-message(debug-mod must be tuned on) -- : Error_message
Hello,
I would like characteristics to have a different selection method than options.
For ex.
Characterisitcs: displayed as a dropdown
Options: displayed as radio box with associated color & description
As it is set up now I see that if you set characteristics selection method as a dropdown all characteristics & options are listed as dropdown.
Is their a way to change this?
Thank you in advance
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
The only way will be to do some code customization through your show_block_characteristic file of your product view of your front-end template, but some development skill will be required.
Please Log in or Create an account to join the conversation.
But I just noticed that if I set the Characteristics selection method to radio box my options remains in a drop down format as seen here:http://www.canvascool.com/jml/index.php/commencez/product/1-canvas-simple. How come?
It seems that the Characteristics and the Options selection method can be set at different places but I can't seem to find the place where to manage the Options selection method.
Please Log in or Create an account to join the conversation.
The "characteristic display method" option of the configuration only apply to characteristics, not to options.
So you can have the display method you want for the characteristics with that option.
However, there is no option to change the options display method. You will have to change the code of the "option" file of the view "product" via the menu Display>views if you want to change the display method of options.
Please Log in or Create an account to join the conversation.
A few more questions:
1) I would like to list under each listed option its image and its description as well. I don't know in which variables these datas are stored and which one I should use.
2) When I select an option (radio box format) it does not refresh the total price.
Any suggestions how I can solve the above issues?
Thank you very much for your time & help.
Rgds
Please Log in or Create an account to join the conversation.
1. The values needed should be in the variable "$variant" in the foreach "foreach($optionElement->variants as $variant){"
2. By default the total price is not refreshed, but the price with option yes.
To refresh it you have to call the javascript function "hikashopChangeOption()" when selecting an option like it's done by default with the dropdown.
Please Log in or Create an account to join the conversation.
1.
$variant->characteristics_text; returns the title
$variant->characteristics_description; returns the Id (for some odd reason)
Which one returns the Description?
2. Can we change the default Total Price to Price with Option? I could not find a threaa about this.
Tx in advance
Eric
Please Log in or Create an account to join the conversation.
What you need is maybe in the object "$optionElement". The characteristics don't have image and descriptions, but the options have.
The easiest way seems to be to have the same display for the option price than the total price, and hide the total price if the option price exist. It will require some Javascript.
Please Log in or Create an account to join the conversation.
Since I changed the option listing with radio button using the JHTML::_('select.radiolist' its does not refresh the "Price with option:". May I ask you to check the code I use to see if I did anything wrong:
$html = JHTML::_('select.radiolist', $this->values, $map, 'class="inputbox" size="1" onchange="hikashopChangeOption();"', 'value', 'text', (int)$value,$id );
Thank you in advance for your kind help.
Please Log in or Create an account to join the conversation.
What is the content of your $map variable ?
You should have an id like: "hikashop_product_option_0" and a name like "hikashop_product_option[0]"
Please Log in or Create an account to join the conversation.
This is what I get:
hikashop_product_option[0] hikashop_product_option[1]
Please Log in or Create an account to join the conversation.
I am sorry but, I discovered this thread, I read the last posts and.. I do not understand anything at your answer.
Your link for the product page is no more working so I have some troubles to see what you want to do exacly.
First at all, do you still have your problem or is it solved ?
Can you try to reformulate it ?
Thanks
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
This is the situation:
On the product page, the default layout for the Options is a dropdown button. I changed the code to display Radio button instead. I used the following code to do this:
$html = JHTML::_('select.radiolist', $this->values, $map, 'class="inputbox" size="1" onchange="hikashopChangeOption();"', 'value', 'text', (int)$value,$id );
The problem:
Since I changed the code to display Options with Radio button the "Price with option" at the bottom of the page does not add automatically the cost of an Option anymore. I would like to know if there is a solution to this issue. It seems the onchange="hikashopChangeOption() is not working anymore.
You can review the page here: www.canvascool.com/jml/index.php/product...duct/1-canvas-simple
Let me know if I was not clear enough.
Tx in advance for the support
Eric
Please Log in or Create an account to join the conversation.
The function "hikashopChangeOption()" parse the html to find the elements with the id "hikashop_product_option_X"
Where X is a numeric value starting at 0 incremented in a loop to find all the options, if the id is not found, the script is stopped, so the ids must start at 0 and be incremented one by one..
So the script take the value depending on the option id. In your case, the radio buttons don't have correct id.
What you have to do is to add an input hidden with a correct option id, and change the value of its hidden input with some javascript when clicking on a radio button.
Something like:
Please Log in or Create an account to join the conversation.
Eric
Please Log in or Create an account to join the conversation.