- Posts: 209
- Thank you received: 18
Variant names in product title
Product X
Characteristics
Variants
How many days hire?----1, 2 or 3 (in a drop down box)
Which interface?
PS2, XBox (in a drop down box)
When I view product X in the first instance, the product title says "Product X 1 PS2". I'm assuming it is picking up the first variants for each characteristic as the product title changes when different variants are selected.
It looks very confusing to the buyer when the product name shows a pre-selected variant. I have tried adding a variant called "--" to the characteristic. This sort of works, I now see a default product title as "Product X -- --" but it's starting to look very messy. Also, when the variants are numbers, the product title starts to look weird especially if you have a lot of characteristics. eg: Product X 1 PS2 3 5 7
Is there a way to:
Show just the product name without the variant name?
or
Set a default variant that is blank and then force the user to choose a valid variant?
cheers!
Please Log in or Create an account to join the conversation.
Yes and yes.
The first option is the easiest: on the product edition screen you have a button "manage variants" in the characteristics area. Upon clicking on it, you will get the listing of variants of your product. You can just edit each one and set a product name for each. That will override the product name auto completion system which adds the characteristics values to the main product name.
For the second: You indeed can add fake values to your characteristics. Instead of -- you could used that will be replaced automatically by a space by your browser. Then, edit the variants with those values ( you should have 6 variants with a in it ) and set the quantity to 0. That way those variants won't be available for sale. You might also want to change the text "no stock" to "please select your options" in the configuration under the tab languages by editing your translation file.
Please Log in or Create an account to join the conversation.
The first option does not work for me because it removes the variant names completely - eg: from the shopping cart view etc.
I was able to create a "fake" variant using the but when I click on manage variants the fake is not available for editing.
Any ideas?
cheers!
Please Log in or Create an account to join the conversation.
Works now!
Please Log in or Create an account to join the conversation.
???
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
docs.joomla.org/Cache
Also, it seems that you edited some of the views. Since we worked on the "add to cart" button for last release, if you made modifications to the views of the product page, you are using old views with the new code and it might be the reason why it's not working. I would recommend to save the folder templates/YOUR_TEMPLATE/html/com_hikashop to another folder so that all the modifications are removed and see if it works. If so then, it's indeed because of that. You should try to pinpoint in which file it is (probably the quantity or the show file) and reapply your modifications to the new versions of the view(s).
Please Log in or Create an account to join the conversation.
I'll give your suggestion a go and will update the software to see if it works.
Thanks!
Please Log in or Create an account to join the conversation.
Many many thanks Nicolas, you're the best!
cheers
Please Log in or Create an account to join the conversation.
both solutions you proposed imply a huge amount of rework for me as I have hundreds of variants for each product.
I was wondering if I could disable the visualization of the variant in the title on the code side?
thanks
Cristiano
Please Log in or Create an account to join the conversation.
<div id="hikashop_product_name_<?php echo $variant_name;?>" style="display:none;">
<?php echo $variant->product_name;?>
</div>
and then change the line:
echo $this->element->product_name;
to:
echo $this->element->main->product_name;
Please Log in or Create an account to join the conversation.
would this change remove the variant name also from the cart?
thanks
Cristiano
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I want the variant name in the cart, so people are sure they bought the right variant. what I dont want is that people get confused reading the product title and beleive there is just a variant (before scrolling down on the product page).
So your mod is perfect in my case
thanks!!!
CC
Please Log in or Create an account to join the conversation.
Sure. You can go in the menu Display->Views and edit the file show of the view product. There, you can just remove the lines:
<div id="hikashop_product_name_<?php echo $variant_name;?>" style="display:none;">
<?php echo $variant->product_name;?>
</div>
and then change the line:
echo $this->element->product_name;
to:
echo $this->element->main->product_name;
Hi nicolas. After I have amended the following you mentioned, those products of mine which does not have any characteristics had their product names dissapear on product page. Please help. Thanks.
Currently, I have used back
echo $this->element->product_name;
while waiting for your help and the variants are still showing in product title.
Please Log in or Create an account to join the conversation.
If you want both to work you should use instead the line:
echo (empty($this->element->main->product_name) ? $this->element->product_name : $this->element->main->product_name );
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
What are the new codes to make this modification?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.