Option for alteration of a price after a size selection

  • Posts: 43
  • Thank you received: 1
5 years 3 months ago #301579

-- url of the page with the problem -- : mebeliyanev.com
-- HikaShop version -- : 4.0.1
-- Joomla version -- : 3.9.1

Hi,
How can we install or activate an option for alteration of a price after a customer selects a size?
We are attaching an exemplary photo of what needs to be done.
Please help us by explaing in deatail how can we do it.
Thank you in advance!

Attachments:

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
5 years 3 months ago #301586

Hi,

You can do that with a characteristic and variants attached to the product. You can see an example with two characteristics on our demo website:
demo.hikashop.com/index.php/en/hikashop/...with-characteristics
And we have a documentation on the characteristics here:
www.hikashop.com/support/support/documen...html#characteristics
So you just create a new characteristic "size" via the Products>Characteristics menu, with all the sizes you need as values of the characteristic.
Then, in your product, you add that characteristic in the characteristics setting, and then at the top, you click on the "variants" tab which will appear after that, and there you add the variants you need for the product (maybe some products don't have some sizes) with the correspoding price. The price will then update automatically on the product page based on what you select in the characteristics dropdown.

The following user(s) said Thank You: eduarddimitrov

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

  • Posts: 43
  • Thank you received: 1
5 years 3 months ago #301632

Thank you, nicolas, now variants works with one small problem: when user click on picture, are opened all 12 pictures (12 variants fro this product) and user must click 12 times on X to close modal box. So , the question is where can i edit the html code, for example on pictures now is code <a href="" rel="shadowbox"></a>, maybe I must try with <a href="" target="_blank"></a>.

You can see the product here: mebeliyanev.com/%D0%BC%D0%B5%D0%B1%D0%B5...A-%D1%80%D0%B8%D0%BE

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
5 years 3 months ago #301637

Hi,

It seems that either you have some customization of the product page or some custom image popup system which doesn't work properly with the variants system.
Try switching to the default template of Joomla and see if that works properly if so, it means that it comes from something in the files of the folder templates/YOUR_TEMPLATE/html/com_hikashop/product/ that was added either by the template or someone customizing the view files of the product page there.

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

  • Posts: 43
  • Thank you received: 1
5 years 3 months ago #301672

I will update hikashop to latest version and will remove template files for product page today. After this will write here the result. Thanks.

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

  • Posts: 43
  • Thank you received: 1
5 years 3 months ago #301681

Updated and deleted files in template part/product. All works, but pictures opened in new window instead of lightbox/modal. Maybe some javascript conflict with template js files?

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

  • Posts: 43
  • Thank you received: 1
5 years 3 months ago #301704

The problem is in file show_block_img.php.

Now there is no file: show_block_img.php in folder: templates/gk_storefront/html/com_hikashop/product/ - works with default files from component.

The problem:

1. If I insert shadowbox on page, picture pop-up is opened, but you need to close 12 times! button X. Shadowbox code:

<link href="/shadowbox/shadowbox.css" rel="stylesheet" type="text/css" />
<script src="/shadowbox/shadowbox.js" type="text/javascript"></script>

2. If there is no shadowbox on page, pictures opened in the same window.

In file show_block_img.php of Hikashop is code:
<div id="hikashop_small_image_div<?php echo $variant_name;?>" class="hikashop_small_image_div">
<?php
	if( !empty($this->element->images) && count($this->element->images) > 1) {
		$firstThunb = true;
		foreach($this->element->images as $image) {

			if($this->image->override) {
				echo $this->image->display($image->file_path, 'hikashop_main_image'.$variant_name, $image->file_name, 'class="hikashop_child_image"','', $width,  $height);
				continue;
			}

			if(empty($this->popup))
				$this->popup = hikashop_get('helper.popup');
			$img = $this->image->getThumbnail(@$image->file_path, array('width' => $width, 'height' => $height), $image_options);
			if(empty($img->success))
				continue;

			$id = null;
			$classname = 'hikashop_child_image';
			if($firstThunb) {
				$id = 'hikashop_first_thumbnail'.$variant_name;
				$firstThunb = false;
				$classname .= ' hikashop_child_image_active';
			}

			$attr = 'title="'.$this->escape(@$image->file_description).'" onmouseover="return window.localPage.changeImage(this, \'hikashop_main_image'.$variant_name.'\', \''.$img->url.'\', '.$img->width.', '.$img->height.', \''.str_replace("'","\'",@$image->file_description).'\', \''.str_replace("'","\'",@$image->file_name).'\');"';
			$html = '<img class="'.$classname.'" title="'.$this->escape(@$image->file_description).'" alt="'.$this->escape(@$image->file_name).'" src="'.$img->url.'"/>';

			if(empty($variant_name)) {
				echo $this->popup->image($html, $img->origin_url, $id, $attr, array('gallery' => 'hikashop_main_image'));
			} else {
				echo $this->popup->image($html, $img->origin_url, $id, $attr, array('gallery' => 'hikashop_main_image_VARIANT_NAME'));
			}
		}
	}
?>
	</div>

And I can't edit a href of links to images. Please, say me how to activate modal/lightbox/shadowbox popup on this page? Where are generated a href links of variants pictures?

Link to product again: mebeliyanev.com/%D0%BC%D0%B5%D0%B1%D0%B5...A-%D1%80%D0%B8%D0%BE

Last edit: 5 years 3 months ago by eduarddimitrov.

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
5 years 3 months ago #301682

Hi,

Well, you still have something called gkZoom which handles the image popup on the product page.
I suppose this is either something from the template or from a third party zoom extension for HikaShop.
I'm not familiar with it. I would strongly advise to check with your template provider what they recommend.

Also, in HikaShop configuration, you have the "image popup mode" setting to configure which popup system to use for the thumbnails of the product page. But if there is a view override of show_block_img, it might disregard that setting and do its own thing.
By default the image popup mode is set to "mootools" and that's not what you're using. There is also the shadowbox mode, but it works fine by default, so if it doesn't work on your website, there is something else the template is doing, or gkzoom ?

Last edit: 5 years 3 months ago by nicolas.
The following user(s) said Thank You: eduarddimitrov

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

  • Posts: 43
  • Thank you received: 1
5 years 3 months ago #301729

Many thanks, changed options and now all pictures working. But how can we get some more control over pictures opening? I mean pictures opened in modal, but without prev/next buttons. Where are generated a href links of pictures on product page (which hikashop file)?

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

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
5 years 3 months ago #301739

Hi,

If you select "shadowbox (external)" you will get the popups with the previous/next buttons. But if your template has some issue with the shadowbox mode, then you might not be able to use it.
There is also this extension on our marketplace www.hikashop.com/marketplace/product/117...pups-by-obsidev.html which can add new image popup modes to HikaShop. So it could be a great way to circumvent the issue with shadowbox by using one of the modes of that plugin.

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

Time to create page: 0.061 seconds
Powered by Kunena Forum