- Posts: 100
- Thank you received: 1
JGLOBAL_SELECT_AN_OPTION
- paddyrolls
-
Topic Author
- Offline
Less
More
13 years 6 months ago #93611
by paddyrolls
JGLOBAL_SELECT_AN_OPTION was created by paddyrolls
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
13 years 6 months ago #93622
by Mohamed Thelji
Replied by Mohamed Thelji on topic JGLOBAL_SELECT_AN_OPTION
Hi,
Can you give me a link to your website, it would help me to understand what your problem really is ?
Thank you.
Can you give me a link to your website, it would help me to understand what your problem really is ?
Thank you.
Please Log in or Create an account to join the conversation.
- paddyrolls
-
Topic Author
- Offline
Less
More
- Posts: 100
- Thank you received: 1
13 years 6 months ago - 13 years 6 months ago #93670
by paddyrolls
Replied by paddyrolls on topic JGLOBAL_SELECT_AN_OPTION
Hi Mohamed
My website is in a password protected directory. Do you have an email address i can send the details to.
However I believe you can reproduce this problem by creating
1 Main Product
1 characteristic (with 1 value)
3 Options
Then assign the 1 characteristic to the 3 options, so each option will have 1 variant product. And assign the 3 options to the Main Product.
If you publish all 3 variants and set the quantity for any of the variants to 0, you will get the error text.
Products and Variants
Output
Thanks
Patrick
Thanks
Patrick
My website is in a password protected directory. Do you have an email address i can send the details to.
However I believe you can reproduce this problem by creating
1 Main Product
1 characteristic (with 1 value)
3 Options
Then assign the 1 characteristic to the 3 options, so each option will have 1 variant product. And assign the 3 options to the Main Product.
If you publish all 3 variants and set the quantity for any of the variants to 0, you will get the error text.
Products and Variants
Output
Thanks
Patrick
Thanks
Patrick
Last edit: 13 years 6 months ago by paddyrolls.
Please Log in or Create an account to join the conversation.
13 years 6 months ago #93951
by nicolas
Replied by nicolas on topic JGLOBAL_SELECT_AN_OPTION
Hi,
That's something we indeed didn't take into account.
You need to add the code:
if(!count($this->values)) continue;
before the line:
$html = JHTML::_('select.genericlist', $this->values, $map, 'class="inputbox" size="1" onchange="hikashopChangeOption();"', 'value', 'text', (int)$value,$id );
in the file "option" of the view "product" via the menu Display->Views to not display the option at all when no variants are available for the option.
That's something we indeed didn't take into account.
You need to add the code:
if(!count($this->values)) continue;
before the line:
$html = JHTML::_('select.genericlist', $this->values, $map, 'class="inputbox" size="1" onchange="hikashopChangeOption();"', 'value', 'text', (int)$value,$id );
in the file "option" of the view "product" via the menu Display->Views to not display the option at all when no variants are available for the option.
Please Log in or Create an account to join the conversation.
- paddyrolls
-
Topic Author
- Offline
Less
More
- Posts: 100
- Thank you received: 1
13 years 6 months ago #94042
by paddyrolls
Replied by paddyrolls on topic JGLOBAL_SELECT_AN_OPTION
HI Nicolas
Thank you for the solution.
But could I suggest rather than making the option disappear, could I change it to displaying a value from a custom field.
For example,
NoVariants_CustomField
Values: All sold out, None Available etc
By setting it to a custom field I can have different message for different category of products.
Is the code too difficult to alter for this solution.
Thanks
Patrick
Thank you for the solution.
But could I suggest rather than making the option disappear, could I change it to displaying a value from a custom field.
For example,
NoVariants_CustomField
Values: All sold out, None Available etc
By setting it to a custom field I can have different message for different category of products.
Is the code too difficult to alter for this solution.
Thanks
Patrick
Please Log in or Create an account to join the conversation.
13 years 6 months ago #94109
by nicolas
Replied by nicolas on topic JGLOBAL_SELECT_AN_OPTION
Hi,
Then, instead of the code:
if(!count($this->values)) continue;
you can use the code:
if(!count($this->values)){$html=$optionElement->CUSTOM_PRODUCT_FIELD_COLUMN;}else
where CUSTOM_PRODUCT_FIELD_COLUMN is the column name of your custom product field with the error message in it.
Then, instead of the code:
if(!count($this->values)) continue;
you can use the code:
if(!count($this->values)){$html=$optionElement->CUSTOM_PRODUCT_FIELD_COLUMN;}else
where CUSTOM_PRODUCT_FIELD_COLUMN is the column name of your custom product field with the error message in it.
Please Log in or Create an account to join the conversation.
- paddyrolls
-
Topic Author
- Offline
Less
More
- Posts: 100
- Thank you received: 1
13 years 6 months ago #94697
by paddyrolls
Replied by paddyrolls on topic JGLOBAL_SELECT_AN_OPTION
Hi Nicolas
I have created a custom field with Columne Name: zero_quantity_message and Table: Product. I have created 2 values: All sold out and Not Available.
I have modified the file - Option and view - Product with the following:
if(!count($this->values)){$html=$optionElement->zero_quantity_message;}else
However in the front, I can see the Option being displayed, however instead of seeing the values, all I see an empty <td></td>
Not too sure what I am doing wrong.
Thanks
Patrick
I have created a custom field with Columne Name: zero_quantity_message and Table: Product. I have created 2 values: All sold out and Not Available.
I have modified the file - Option and view - Product with the following:
if(!count($this->values)){$html=$optionElement->zero_quantity_message;}else
However in the front, I can see the Option being displayed, however instead of seeing the values, all I see an empty <td></td>
Not too sure what I am doing wrong.
Thanks
Patrick
Please Log in or Create an account to join the conversation.
13 years 6 months ago #94715
by nicolas
Replied by nicolas on topic JGLOBAL_SELECT_AN_OPTION
Hi,
It probably means that you didn't fill the value of the custom field in that option product. Edit it, fill that field and save.
It probably means that you didn't fill the value of the custom field in that option product. Edit it, fill that field and save.
Please Log in or Create an account to join the conversation.
- paddyrolls
-
Topic Author
- Offline
Less
More
- Posts: 100
- Thank you received: 1
13 years 6 months ago #94771
by paddyrolls
Replied by paddyrolls on topic JGLOBAL_SELECT_AN_OPTION
Hi Nicolas
I have set a value for the Option but I get the blank <td></td>. However, If I set a value in the Variant, then it works. However I am using $optionElement->zero_quantity_message but it is using the values from the variant and not the option. If I change to a new value in the Option, then nothing happens and it still uses details from the variant product.
Thanks
Patrick
I have set a value for the Option but I get the blank <td></td>. However, If I set a value in the Variant, then it works. However I am using $optionElement->zero_quantity_message but it is using the values from the variant and not the option. If I change to a new value in the Option, then nothing happens and it still uses details from the variant product.
Thanks
Patrick
Please Log in or Create an account to join the conversation.
13 years 6 months ago #94797
by nicolas
Replied by nicolas on topic JGLOBAL_SELECT_AN_OPTION
Hi,
Then try the line :
if(!count($this->values)){$html=$optionElement->main->zero_quantity_message;}else
instead of the one of your previous message and that should help.
Then try the line :
if(!count($this->values)){$html=$optionElement->main->zero_quantity_message;}else
instead of the one of your previous message and that should help.
Please Log in or Create an account to join the conversation.
Time to create page: 0.208 seconds