want a button on the product listing view page.

  • Posts: 408
  • Thank you received: 8
  • Hikaserial Subscription Hikashop Business
9 years 1 month ago #214123

-- HikaShop version -- : 2.5.x
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.x
-- Error-message(debug-mod must be tuned on) -- : no error

Hello,
We have created a menu item to show us the various products of a particular category, nicely in blocks. In the attached picture you see 2 standing next each other. We see that the whole is clickable to go to the product but we want a button to let the potential customer to go through the product information. Soo above the compare we need a button. Like "More Info" Or is it possible to adjust the add to wishlist button that it will go to the product itself as when clicked on the whole image?
Hope you understand what i am asking.

Thanks
Michiel

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
9 years 1 month ago #214131

Hello Michiel,
To do what you want the solution will be to directly edit the code of the "Quantity" file of the "Product" view of the front-end template via "Hikashop->Display->Views".
Note that to have a button which will redirect you through your product page detail, you can copy the code of the "Choose options" button and replace the name :

echo $this->cart->displayButton(JText::_('CHOOSE_OPTIONS'), 'choose_options', $this->params, hikashop_contentLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$url_itemid.$this->category_pathway,$this->row),'window.location = \''.str_replace("'","\'",hikashop_contentLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$url_itemid.$this->category_pathway,$this->row)).'\';return false;', '');

Best regards,
Mohamed.

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

  • Posts: 408
  • Thank you received: 8
  • Hikaserial Subscription Hikashop Business
9 years 1 month ago #214206

Hello Mohamed,

Thanks for your answer, i will try to get it done. looks like a super solution.
Another thing i came accros is about a module filter in the sidebar of our site. see attached picture. The name of the filter option is within a spanclass and then we get on a new line a :(filteroptions) how can i get the : after the the name off the filter option i can not find it.
Please help
Thanks
Michiel

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
9 years 1 month ago #214208

Hello Michiel,
Using some CSS code to lower the font-size or add more space for your filter module will probably do the job : www.hikashop.com/support/documentation/1...the-display.html#css

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

  • Posts: 408
  • Thank you received: 8
  • Hikaserial Subscription Hikashop Business
9 years 1 month ago #214388

Hello,

Have tried to adjust the css, but that does not do the trick.
In the img i send u i need the : before the 1250 inside of the <span class of the price> in the css i can not do this.? And in the views product_filter i cannot find the : after any span class.
so where does the : comes from?
Another question is why is the currency in the filter not before the price as said in the configuration? or where can i adjust that also..
Thanks.

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
9 years 1 month ago #214518

Hi,

The exact CSS to use depends on how everything is configured and the CSS of your template.
So we can't give you precise help without analyzing the page on your website. Could you give a link to the page ?
The HTML of the filters comes from the file administrator/components/com_hikashop/classes/filter.php

The currency settings are not used for the display of the cursor filter as the normal function to generate prices is a PHP function but the filter prices are calculated dynamically in javascript. Some CSS might allow you to revert their position with the CSS "direction" attribute.

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

  • Posts: 408
  • Thank you received: 8
  • Hikaserial Subscription Hikashop Business
9 years 1 month ago #215294

Hello again,

I can not find a way to redirect the currency sign in the filter by CSS. In the configuration of the shop we have put it in front of the amount, but in the filters it is at the end? How can i make it come to the front of the amount in the filter? Please Help!

But before i can do this something different came up. We have put the side on bootstrap and it is working fine with the template etc. but however since we manage to make it this way compatible for mobile devices the price range and the rang of the km/hr etc. are not shown at the front end of the desktop version. But it is oke on my mobile phone?
this is the test site we're building on. www.01.uw-hiow-concept.nl
a screenshot from the site due to the filter is attached.
Thanks

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
9 years 1 month ago #215301

Hi,

You just have a css issue, the text is displayed behind the cursor, so you can add this kind of css property:

.hikashop_filter_cursor_span{
    float: none !important;
}

Regarding the currency, please edit the file "administrator/components/com_hikashop/classes/filter.php" and replace the function display() of the class "hikashopCursorClass" by:
	function display($filter, $divName, &$parent, $datas=''){
		$selected = parent::display($filter, $divName, $parent);

		if(!empty($selected) && !empty($selected[0])){
			$values=parent::display($filter, $divName, $parent, '_values');
			if(!is_array($values)){
				$values = explode(' - ', $values);
			}
			if($filter->filter_deletable && $values[0] != 'none' && ( isset($values[0]) && !in_array($selected[0],array(" ",'')))){
				$html = parent::displayInList($filter, $divName, $values);
				return $html;
			}
		}

		$cursorStep='';
		$html='';
		$cursorMin=0;
		$cursorMax=1000;
		$cursorEffect='';
		$cursorWidth='width:250px;';
		$float='';
		$deleteButton='';

		//try to get the min and max dynamically based on the other filters (does that really work Oo ?)
		if(!empty($datas) && $filter->filter_dynamic){
			$nameMax='max_'.$filter->filter_namekey;
			$nameMin='min_'.$filter->filter_namekey;
			$array = $datas['limits'];

			if(!empty($array->$nameMax)){
				$cursorMax=(float)$array->$nameMax;
			}else{
				$cursorMax=1000;
			}
			if(!empty($array->$nameMin)){
				$cursorMin=(float)$array->$nameMin;
			}else{
				$cursorMin=0;
			}
		}

		//force the min and max based on the settings of the filter
		if($cursorMin==0 && $filter->filter_options['cursor_min']!='none' && isset($filter->filter_options['cursor_min']) && !in_array($filter->filter_options['cursor_min'],array(" ",''))){
			$cursorMin=$filter->filter_options['cursor_min'];
		}
		if($cursorMax==1000 && !empty($filter->filter_options['cursor_max'])){
			$cursorMax=$filter->filter_options['cursor_max'];
		}
		$minVal=$cursorMin;
		$maxVal=$cursorMax;
		if(!empty($filter->filter_options['cursor_effect'])){
			$cursorEffect='animate: true,';
		}
		if(!empty($filter->filter_options['cursor_width'])){
			$cursorWidth='width:'.$filter->filter_options['cursor_width'].'px;';
		}
		if(!empty($filter->filter_options['cursor_step'])){
			$cursorStep='step:'.$filter->filter_options['cursor_step'].',';
		}
		if(isset($values)){
			if(is_array($values) && count($values)!=2){
				$data =& $values[0];
			}else{
				$data =& $values;
			}
			if( isset($data) && (is_array($data) || !in_array($data,array(" ",'')))){
				if(!is_array($data)){
					$data=explode(' - ',$data);
				}

				$minVal=(float)@$data[0];
				$maxVal=(float)@$data[1];
			}
		}

		if($minVal>$maxVal){
			$tmp = $maxVal;
			$maxVal = $minVal;
			$minVal = $tmp;
		}
		if($cursorMin>$cursorMax){
			$tmp = $cursorMax;
			$cursorMax = $cursorMin;
			$cursorMin = $tmp;
		}
		$onClick='';
		if($filter->filter_direct_application){
			$onClick='document.getElementById(\'slider_'.$filter->filter_namekey.'_'.$divName.'\').value="";document.forms[\'hikashop_filter_form_'.$divName.'\'].submit();';
		}
		$currency = '';
		if($filter->filter_data=='price'){
			$currencyClass = hikashop_get('class.currency');
			$currencies = null;
			$crurency_id = hikashop_getCurrency();
			$currencies = $currencyClass->getCurrencies($crurency_id, $currencies);
			$format = $currencies[$crurency_id]->currency_format;
			if(strpos($format,'%n')!==false){
				$currency.= ' '.$currencies[$crurency_id]->currency_symbol;
			}
			if(strpos($format,'%i')!==false){
				$currency.= ' '.$currencies[$crurency_id]->currency_code;
			}
		}
		$js = '
if(!hkjQuery) window.hkjQuery = window.jQuery;
hkjQuery(document).ready(function(){
	hkjQuery("#slider_'.$filter->filter_namekey.'_'.$divName.'").prop(\'slide\',null).slider({
		'.$cursorEffect.'
		range: true,
		min: '.$cursorMin.',
		max: '.$cursorMax.',
		'.$cursorStep.'
		values: ['.$minVal.', '.$maxVal.'],
		slide: function( event, ui ) {
			hkjQuery( "#filter_'.$filter->filter_namekey.'_'.$divName.'_values" ).val(  ui.values[ 0 ] + " - " + ui.values[ 1 ] );
			hkjQuery( "#filter_'.$filter->filter_namekey.'_'.$divName.'" ).val(1);
			';
		if($currencies[$crurency_id]->currency_locale['p_cs_precedes']){
			$js .= '
			hkjQuery( "#filter_span_'.$filter->filter_namekey.'_'.$divName.'" ).html( "'.$currency.' " + ui.values[ 0 ] + " - '.$currency.' " + ui.values[ 1 ] );
			';
		}else{
			$js .= '
			hkjQuery( "#filter_span_'.$filter->filter_namekey.'_'.$divName.'" ).html(  ui.values[ 0 ] + "'.$currency.' - " + ui.values[ 1 ] + "'.$currency.'" );
			';
		}
		$js .= '
		},
		change: function( event, ui ) {' .
			$onClick .'
		}
	});
	hkjQuery( "#filter_'.$filter->filter_namekey.'_'.$divName.'_values" ).val(  hkjQuery( "#slider_'.$filter->filter_namekey.'_'.$divName.'" ).slider( "values", 0 ) + " - " + hkjQuery( "#slider_'.$filter->filter_namekey.'_'.$divName.'" ).slider( "values", 1 ) );
	';
	if($currencies[$crurency_id]->currency_locale['p_cs_precedes']){
		$js .= '
			hkjQuery( "#filter_span_'.$filter->filter_namekey.'_'.$divName.'" ).html( "'.$currency.' " + hkjQuery( "#slider_'.$filter->filter_namekey.'_'.$divName.'" ).slider( "values", 0 ) + " - '.$currency.' " + hkjQuery( "#slider_'.$filter->filter_namekey.'_'.$divName.'" ).slider( "values", 1 ) );
		';
	}else{
		$js .= '
			hkjQuery( "#filter_span_'.$filter->filter_namekey.'_'.$divName.'" ).html(  hkjQuery( "#slider_'.$filter->filter_namekey.'_'.$divName.'" ).slider( "values", 0 ) + "'.$currency.' - " + hkjQuery( "#slider_'.$filter->filter_namekey.'_'.$divName.'" ).slider( "values", 1 ) + "'.$currency.'" );
		';
	}
	$js .= '
	hkjQuery(\'#dialog_link, ul#icons li\').hover(
		function() { hkjQuery(this).addClass(\'ui-state-hover\'); },
		function() { hkjQuery(this).removeClass(\'ui-state-hover\'); }
	);
});';
		if(HIKASHOP_PHP5){
			$doc = JFactory::getDocument();
		}else{
			$doc =& JFactory::getDocument();
		}
		$doc->addScriptDeclaration("\n<!--\n".$js."\n//-->\n");

		hikashop_loadJslib('jquery');
		hikashop_loadJslib('jquery-ui');

		$hasValue='';
		if(!empty($selected) && $selected[0]==1 && $values[0]!='none' && ( isset($data) && !in_array($data,array(" ",'')))) {
			$deleteButton = '  ' . parent::getDeleteButton($filter, $divName, '11', $html, '', true);
			$hasValue='1';
		}

		if($filter->filter_options['title_position']=='left'){
			$float='float:left;';
		}

		$html = '<div style="'.$cursorWidth.' '.$float.' margin-top:10px; margin-bottom:10px;" id="slider_'.$filter->filter_namekey.'_'.$divName.'"></div>';
		$html = $this->cursorTitlePosition($filter, $html, $cursorWidth, $divName,$deleteButton,$hasValue);

		return $html;

	}

The following user(s) said Thank You: BluepointWebdesign

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

  • Posts: 408
  • Thank you received: 8
  • Hikaserial Subscription Hikashop Business
9 years 1 month ago #215463

Hello there,
Thank u very much for helping out both issues,
in the first one of the css, i just need to add an extra line with a margin-left so it would be neat in display.
the other code worked super,
Thanks for the excellent support, we are very happy with hikashop!
:cheer: :lol:

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

  • Posts: 408
  • Thank you received: 8
  • Hikaserial Subscription Hikashop Business
8 years 11 months ago #219985

Hello,
We like to have a variant of this. Let me explain. We don't use the wishlist in our shop, but we want to use the button option build in. So how can we make the wishlist button to link to another page in our website. I know i need to modify it from the quantity php in the product view..
Thanks

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

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #219995

Hi,

The best would be to disable the wishlists and add a custom button in the "product / quantity" view directly.
Something like:

<a class="hikashop_cart_button" href="/your_link"><?php JText::_('ADD_TO_WISHLIST'); ?></a>
and of course replace "/your_link" by the desired url.

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

  • Posts: 408
  • Thank you received: 8
  • Hikaserial Subscription Hikashop Business
8 years 11 months ago #220103

Hello Xavier,
That would be a nice solution, but when we do that it will appear on every product, we only want it on some products, so if we set the system that only the free products can be added by the customer to the wishlist to let that button appear, so is there a way to make the wishlist button to link to another page in joolma?
Now it is going to the shopping cart, we want it to another page.
Hope you understand, what i mean.
Thanks.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #220108

Hi,

So in the view "product / quantity" you can replace the four occurrences of:

				echo '<div id="hikashop_add_wishlist">' .
					$this->cart->displayButton(JText::_('ADD_TO_WISHLIST'), $btnType, $this->params, $url, $wishlistAjax, '', $max, $min, '', false) .
					'</div>';
By:
<a class="hikashop_cart_button" href="/your_link"><?php JText::_('ADD_TO_WISHLIST'); ?></a>

That way this button will be displayed based on the wishlist button settings and will redirect to the desired page.
In my example it will redirect to the "/your_link" page.

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

  • Posts: 408
  • Thank you received: 8
  • Hikaserial Subscription Hikashop Business
8 years 11 months ago #220247

Hello,
When i do what you say to get the button working the way we want. We get the following. I have attached two images, 1 how the site looks like with the button, and one what happens if i implement your code. I can not figure it out. hope you can give me some more help. thanks.

Attachments:

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 11 months ago #220410

Hi,

Replace that code to this instead:

echo '<a class="hikashop_cart_button" href="/your_link">'.JText::_('ADD_TO_WISHLIST').'</a>';

The following user(s) said Thank You: BluepointWebdesign

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

  • Posts: 408
  • Thank you received: 8
  • Hikaserial Subscription Hikashop Business
8 years 11 months ago #220456

Thanks this is working! :cheer:

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

Time to create page: 0.108 seconds
Powered by Kunena Forum