Skip to main content

Hide Variant Name in Product Show

More
14 years 11 months ago #26852 by Nello
Hi Nicolas,
how can I hide the variant name on the product page, without using the option or css.

Because if I set option to Not Add Variant Name, it does not also show in the cart.

You can see an example here.
www.hidesign.it/it/catalogo/product/show...3075/steelwood-chair

I want to hide ": Rosso"

Thank you!

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

More
14 years 11 months ago #26859 by nicolas
You can edit the file show of the view product via the menu Display->Views and change the code:
<span id="hikashop_product_name_main" class="hikashop_product_name_main">
<?php
echo $this->element->product_name;
?>
</span>

to:
<?php
echo $this->element->main->product_name;
?>

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

More
14 years 11 months ago #26871 by Nello
Ok! It works, but if I select a variant from the dropdown list, it reappears...
what i have to modify?

Thank you so much.

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

More
14 years 11 months ago #26880 by nicolas
That means that you didn't remove the span as I wrote.

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

More
14 years 11 months ago - 14 years 11 months ago #26883 by Nello
If I remove SPAN, when the product have no variants, no name is showed...

I want to hide only the name of variant, and show the name of product..
Last edit: 14 years 11 months ago by Nello.

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

More
14 years 11 months ago #26884 by nicolas
Then just remove the id attribute of the span: id="hikashop_product_name_main"

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

More
14 years 11 months ago #26887 by Nello
Don't works!

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

More
14 years 11 months ago #26888 by nicolas
I still see the id in your span on your product page.

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

More
14 years 11 months ago #26891 by Nello
Ok! With this code

<span class="hikashop_product_name_main">
<?php
echo $this->element->main->product_name;
?>
</span>

this are the results:

www.hidesign.it/it/catalogo/product/show...misuratore-magnetico

This is OK!

But this below have no product name, because have no variants

www.hidesign.it/it/catalogo/product/show/cid-198/divano-velvet

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

More
14 years 11 months ago - 14 years 11 months ago #26893 by Xavier
Hi Nello,

Try to change your code:
<span class="hikashop_product_name_main">
<?php
echo $this->element->main->product_name;
?>
</span>

To:
<span id="hikashop_product_name_main" class="hikashop_product_name_main">
<?php
if(isset($this->element->main->product_name)) echo $this->element->main->product_name;
else echo $this->element->product_name;
?>
</span>
Last edit: 14 years 11 months ago by Xavier.

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

More
14 years 11 months ago #26894 by Nello
I tried with this code and now works well!

<span class="hikashop_product_name_main">
<?php
if(isset($this->element->main->product_name)) echo $this->element->main->product_name;
else echo $this->element->product_name;
?>
</span>

Thank you!

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

Time to create page: 0.250 seconds
Powered by Kunena Forum