Working with characteristics and variants

  • Posts: 21
  • Thank you received: 2
  • Hikaserial Subscription Hikashop Business
3 months 2 weeks ago #362917

-- HikaShop version -- : 5.1.0
-- Joomla version -- : 5.1.2
-- PHP version -- : 8.1
-- Browser(s) name and version -- : Edge 128.0.2739.42

We are in the process of moving away from J2store into Hikashop. Therefore on a product page I want te recreate price options for a product. I have found that this will be accomplished by working with characteristics and variants. But I can't seem to make it happen after spending hours going through the manuals and forums. Is there someone who can help me with this? I'm attaching a screenshot of the current config. It will most probably be something tiny (and or stupid) I am missing.

Attachments:
Last edit: 4 weeks 1 day ago by Scramble ITS.

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

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
3 months 2 weeks ago #362920

Hi,

This looks like an option rather than a characteristic since the product has a base price and the selection then adds its price to the base price.
On this page, you can see a product with several options, each one displayed as a dropdown :
demo.hikashop.com/index.php/en/hikashop/...ct-page/with-options

To acheave that, you want to first create an unpublished category. Then, create a characteristic, with one value per choice.
Then create a product in that unpublished category and add the characteristic in the corresponding option of the product. Then, under the variants tab, add the variants and then edit them in order to configure their price.
Finally, in your main product, select the product you created in the Options area and you'll be done.

The following user(s) said Thank You: Scramble ITS

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

  • Posts: 21
  • Thank you received: 2
  • Hikaserial Subscription Hikashop Business
3 months 2 weeks ago #362960

I've come somewhat further with your explanation. Was able to create the different variants. Two followup questions.
1) When selecting a variant the title of the product changes (above the picture). I've found some forum posts about this issue and found that this involves changing the file show of the view product php. But I can't seem to find the proposed syntax in that file.
2) Adding a product to the cart it shows a pop-up that this has happened. But that page remains the same. I'm sure there is a way that from the moment you press the button the screen goes to the cart directly.

Greets,

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

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
3 months 2 weeks ago #362962

Hi,

1. It's not product / show but product / show_default that you want to edit. That's probably why you didn't find the code mentioned on these forum posts.

2. You can configure the behavior after the add to cart with the settings of the cart notification plugin via the Joomla plugins manager.

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

  • Posts: 21
  • Thank you received: 2
  • Hikaserial Subscription Hikashop Business
3 months 2 weeks ago #362988

Nicolas, sorry to bother you again. Hikashop is completely new to me. The forum has helped me out with several things already. But getting stuck a little again.
1) Found the correct file. I think it is this syntax that I need to change:

<!-- NAME -->
		<span id="hikashop_product_name_main" class="hikashop_product_name_main" itemprop="name"><?php
			if(hikashop_getCID('product_id') != $this->element->product_id && isset($this->element->main->product_name))
				echo $this->element->main->product_name;
			else
				echo $this->element->product_name;
		?></span>
But still can't figure it out. Adding an attachment (title) with two colors. The main product in yellow (which needs to stay) and the selected characteristics in blue (which does not need to show.

2) I can configure the behavior of the 'pop-up' with the cart notification plugin, but that's not the issue. When I press 'add to cart' I want this page to go to the cart immediately. Now the pop-up appears but nothing happens.

Greets,

Attachments:
Last edit: 3 months 2 weeks ago by nicolas.

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

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
3 months 2 weeks ago #362996

Hi,

1. Change the line:

<span id="hikashop_product_name_main" class="hikashop_product_name_main" itemprop="name"><?php
to:
<span itemprop="name"><?php
and the product name won't change when you select another variant.

2. You missed the "redirect to checkout" setting of the plugin:
i.imgur.com/Q3oVWo2.png

The following user(s) said Thank You: Scramble ITS

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

Time to create page: 0.086 seconds
Powered by Kunena Forum