Change position of Characteristics selection method: List

  • Posts: 410
  • Thank you received: 15
6 years 6 months ago #278423

-- HikaShop version -- : 3.2.0

Hi how to change the position of the characteristics to be at the top of the product and not the bottom?

Attachments:
Last edit: 6 years 2 months ago by neo191987.

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

  • Posts: 12953
  • Thank you received: 1778
6 years 6 months ago #278431

Hello,

The best solution will probably be to directly edit the code of the "show_default" file of the "product" view of your front-end template via "Hikashop->Display->Views".

www.hikashop.com/support/documentation/1...-display.html#layout

The following user(s) said Thank You: neo191987

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

  • Posts: 410
  • Thank you received: 15
6 years 6 months ago #278904

Unfortunately, I was unable to find the exact code. Can you give me a hand ? My view is show_tabular. Which code should I look for?

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

  • Posts: 12953
  • Thank you received: 1778
6 years 6 months ago #278908

Hello,

Correctly moving that code will probably do the job :

<?php
	if($this->params->get('characteristic_display') != 'list') {
		//LAYOUT show_block_charasteristic
		$this->setLayout('show_block_characteristic');
		echo $this->loadTemplate();
?>

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

  • Posts: 410
  • Thank you received: 15
6 years 6 months ago #278968

Hi, unfortunately not this code. Even when you delete this code, the table is still available and is at the bottom.

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

  • Posts: 4491
  • Thank you received: 609
  • MODERATOR
6 years 6 months ago #279041

Hello,

Then, there is only one possibility, you don't edit the good view, maybe you edit a view link to the wrong template ?
Check that the view you edit is link with the template you use.
The code that Mohamed give you, if deleted it characteristics can't be displayed.

Regards

Last edit: 6 years 6 months ago by Philip.

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

  • Posts: 410
  • Thank you received: 15
6 years 6 months ago #279047

If it is in a dropdown list view it is removed but in this view it is not affected by anything even to remove the code. Anyway I will use a dropdown list for now but there is one problem that I have described in another topic.

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

  • Posts: 410
  • Thank you received: 15
6 years 2 months ago #285343

Hi, I've found the code for this view but I have a few problems:
1. The code for this view is located in show.php row 93 - 96
code

if($this->params->get('characteristic_display') == 'list') {
	$this->setLayout('show_block_characteristic');
	echo $this->loadTemplate();

if changing code
if($this->params->get('characteristic_display') != 'list') {
	$this->setLayout('show_block_characteristic');
	echo $this->loadTemplate();
the table will disappear which is my goal.

Now my goal is to show it elsewhere
I change the code in show_tabular row 117 - 119
if($this->params->get('characteristic_display') != 'list') {
		$this->setLayout('show_block_characteristic');
		echo $this->loadTemplate();
changed to
if($this->params->get('characteristic_display') == 'list') {
		$this->setLayout('show_block_characteristic');
		echo $this->loadTemplate();
now shows right where I want.
But here comes the problem, the first variant is working normally but the second does not allow me to add either the cart or to wishlist.
Error
POST http://127.0.0.1/developer/index.php/games/product/updatecart/add-1/cart_type-wishlist/cid-4?tmpl=raw 403 (Forbidden)
xRequest @ hikashop.js?v=322:217
addToCart @ hikashop.js?v=322:942
addToWishlist @ hikashop.js?v=322:962
onclick @ dying-light-the-following:317

2. I see there are many lines I can show from show_block_characteristic.php. How could I enable and disable the fields I want to show or hide?

Last edit: 6 years 2 months ago by neo191987.

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

  • Posts: 12953
  • Thank you received: 1778
6 years 2 months ago #285361

Hello,

1. Can you firstly give us more information about what you exactly want to achieve and also show us some screenshots of how you want it to be displayed ? Thank you.

2. The solution will probably be to directly un-publish variants from the "Variants" tab of your product configuration page.

Best regards,
Mohamed Thelji.

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

  • Posts: 410
  • Thank you received: 15
6 years 2 months ago #285402

Hi thanks for responding to my problem. Now I will describe all the steps.

1.There is the position of the table before all changes



2. This is the code before editing it (show.php)


3. After editing


4. Result


5. This is the code before editing it (show_tabular.php)


6. After editing


7. Result, I now have to design and remove the fields I do not want to see in the table


8. The error of adding the second variant to the cart and wishlist

Last edit: 6 years 2 months ago by neo191987.

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

  • Posts: 81379
  • Thank you received: 13037
  • MODERATOR
6 years 2 months ago #285405

Hi,

The problem of doing that change is that now you have one form around each add to cart button and one form around the whole product page.
And you can't have a form in a form in HTML, that's not valid and it creates that issue.
You have two solutions:
- You edit the file "show" of the view "product" and you remove the main form of the product page.
- You remove the form around each add to cart in the "show_block_characteristic" view file.

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

  • Posts: 410
  • Thank you received: 15
6 years 2 months ago #285450

Hi, now it really works, but there is another problem. Adding a product to cart or a wishlist no longer shows popup for that the product has been added and directly redirects to an order or wishlist, I also get one error.

The steps that I made

1. I removed this code from show.php (row 58) - Incorrect. Fix: Move to show_tabular.php, above characteristics code (row 116)

<form action="<?php echo hikashop_completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form" onsubmit="return hikashop_product_form_check();" enctype="multipart/form-data">

2, Whether I add the product to the cart or wish list I get this error


Is there a way to fix this or if I'm wrong what exactly do I have to do?

Attachments:
Last edit: 6 years 2 months ago by neo191987. Reason: Fix

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

  • Posts: 81379
  • Thank you received: 13037
  • MODERATOR
6 years 2 months ago #285455

Hi,

That's normal as HikaShop is normally expecting that this form element is present on the page.
Instead of removing it, place it just before the </form> tag in that same file.

The following user(s) said Thank You: neo191987

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

  • Posts: 410
  • Thank you received: 15
6 years 2 months ago #285473

Hi, unfortunately there is no change. The same error, and there is still no notification of added product. Monday will give you access to the site if you can fix it.

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

  • Posts: 410
  • Thank you received: 15
6 years 2 months ago #285611

It took me 5 minutes to do it right. You gave me good guidelines for which I am grateful to you. :)

Last edit: 6 years 2 months ago by neo191987.

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

  • Posts: 410
  • Thank you received: 15
6 years 2 months ago #285700

Hi, I have the last question on this subject. How do I display the Waitlist button as it is not added to this view?

Also, can you check if the contact code is correct because it is missing there

<span id="hikashop_product_contact">
<?php
         $contact = $this->config->get('product_contact',0);
		if(hikashop_level(1) && ($contact == 2 || ($contact == 1 && !empty ($this->element->main->product_contact)))) {
			$params = @$this->params;
			global $Itemid;
			$url_itemid = '';
			if(!empty($Itemid)) {
				$url_itemid = '&Itemid='.$Itemid;
			}
			echo $this->cart->displayButton(
				JText::_('<i class="fa fa-question" aria-hidden="true"></i>'),
				'contact_us',
				$params,
				''.hikashop_completeLink('product&task=contact&cid=' . $variant->product_id.$url_itemid),
				'window.location=\'' . hikashop_completeLink('product&task=contact&cid=' . $variant->product_id.$url_itemid) . '\';return false;'
			);
		}
?>
</span>

Thank you in advance.

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

  • Posts: 81379
  • Thank you received: 13037
  • MODERATOR
6 years 2 months ago #285701

Hi,

This code is not the waitlist button but the contact button.
The waitlist button can be added with such code:

	<a class="<?php echo $this->config->get('css_button', 'hikabtn'); ?>" rel="nofollow" href="<?php echo hikashop_completeLink('product&task=waitlist&cid='.$this->element->main->product_id); ?>"><span><?php
		echo JText::_('ADD_ME_WAITLIST');
	?></span></a>

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

Time to create page: 0.124 seconds
Powered by Kunena Forum