- Posts: 100
- Thank you received: 1
Adding a "Please select" to variants
- paddyrolls
-
Topic Author
- Offline
Less
More
13 years 6 months ago #94858
by paddyrolls
Adding a "Please select" to variants 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 - 13 years 6 months ago #94966
by Mohamed Thelji
Replied by Mohamed Thelji on topic Adding a "Please select" to variants
Hi Patrick,
My solution would be to :
- Go to "Hikashop->Display->Views"
- Edit the show_block_characteristic file of the product view of your front-end template
- Change these lines :
by :
Hope this will help you a little
.
My solution would be to :
- Go to "Hikashop->Display->Views"
- Edit the show_block_characteristic file of the product view of your front-end template
- Change these lines :
Code:
<?php
if (!empty ($this->element->characteristics)) {
?>
Code:
<?php
if (!empty ($this->element->characteristics)) {
echo "Please select";
?>
Hope this will help you a little
Last edit: 13 years 6 months ago by Mohamed Thelji.
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 #95026
by paddyrolls
Replied by paddyrolls on topic Adding a "Please select" to variants
HI Mohamed
I tried that but it did not seem to work.
I would have thought I would needed to append the "Please select" as a sql query with a union join to the query that retrieves the variant data. Could you tell me which file the sql for the variant date is called from.
Thanks
Patrick
I tried that but it did not seem to work.
I would have thought I would needed to append the "Please select" as a sql query with a union join to the query that retrieves the variant data. Could you tell me which file the sql for the variant date is called from.
Thanks
Patrick
Please Log in or Create an account to join the conversation.
13 years 6 months ago #95215
by Eliot
Replied by Eliot on topic Adding a "Please select" to variants
Hi there,
The Mohamed solution wasn't the best for your case.
I think you should simply add a new variant called "Please Select" with no stock and no price.
So this variant would be displayed but people won't be able to buy it and will have to select one of your variants
The Mohamed solution wasn't the best for your case.
I think you should simply add a new variant called "Please Select" with no stock and no price.
So this variant would be displayed but people won't be able to buy it and will have to select one of your variants
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 #95244
by paddyrolls
Replied by paddyrolls on topic Adding a "Please select" to variants
HI Eliot
Thank you for your suggestion. I already thought of doing that. However, this would work, if there are variant products to choose. But once all the variants have been sold/bought, then it would look silly to have a "Please select", with no variants to choose from.
If I can somehow hide this option when there are no variant products to display then your solution would work fine.
Thanks for the suggestion though.
Thank you for your suggestion. I already thought of doing that. However, this would work, if there are variant products to choose. But once all the variants have been sold/bought, then it would look silly to have a "Please select", with no variants to choose from.
If I can somehow hide this option when there are no variant products to display then your solution would work fine.
Thanks for the suggestion though.
Please Log in or Create an account to join the conversation.
13 years 6 months ago #95256
by nicolas
Replied by nicolas on topic Adding a "Please select" to variants
Hi,
The solution proposed by Eliot is indeed better.
Regarding the hiding of the characteristics if only the default value is left in the dropdown, you can add the code:
if(count($this->values)===1) return 'Out of stock';
before the line:
$html = JHTML::_('select.'.$characteristic_display.'list', $this->values, $map, 'class="inputbox" size="1"'.$this->options, 'value', 'text', (int)$value,$id );
in the file administrator/components/com_hikashop/types/characteristic.php
The solution proposed by Eliot is indeed better.
Regarding the hiding of the characteristics if only the default value is left in the dropdown, you can add the code:
if(count($this->values)===1) return 'Out of stock';
before the line:
$html = JHTML::_('select.'.$characteristic_display.'list', $this->values, $map, 'class="inputbox" size="1"'.$this->options, 'value', 'text', (int)$value,$id );
in the file administrator/components/com_hikashop/types/characteristic.php
Please Log in or Create an account to join the conversation.
7 years 7 months ago #303787
by grayt7
Replied by grayt7 on topic Adding a "Please select" to variants
Hi,
What if you had the notify of when back in stack feature on? Then adding a "please select" variant wouldn't work as it would look like the product is out of stock when actually you've just set the "please select" variant with no stock. Anyway around this?
Cheers.
What if you had the notify of when back in stack feature on? Then adding a "please select" variant wouldn't work as it would look like the product is out of stock when actually you've just set the "please select" variant with no stock. Anyway around this?
Cheers.
Please Log in or Create an account to join the conversation.
7 years 7 months ago #303790
by nicolas
Replied by nicolas on topic Adding a "Please select" to variants
Hi,
Instead of using the stock of the variant, you could set the "sale date" start value in the remote future or the end value in the past. It would do the same but with a different message (that you can customize with a translation override), but the "notify me" button wouldn't display for the "please select" choice.
Instead of using the stock of the variant, you could set the "sale date" start value in the remote future or the end value in the past. It would do the same but with a different message (that you can customize with a translation override), but the "notify me" button wouldn't display for the "please select" choice.
Please Log in or Create an account to join the conversation.
Time to create page: 0.243 seconds