drag and drop product order or manual ordering

  • Posts: 99
  • Thank you received: 6
  • Hikashop Business
6 years 9 months ago #294640

-- url of the page with the problem -- : antiqueswan.com/
-- HikaShop version -- : 3.4.1
-- Joomla version -- : 3.8.8
-- PHP version -- : 7

Hi,

The products on this site need to be ordering manually rather than set by a database field. I saw this post, albeit dated, www.hikashop.com/forum/product-category-...r-drag-and-drop.html , which describes much of what we need to do. I saw in that post that there was a way to add a number in the product overview but I don't have that available in my version of Hikashop. See take.ms/3kfMl

A question on this subject may have already been asked, but it was difficult to search because of the all too common words of product and ordering.

Is there a drag and drop feature available? Or, is this manual ordering available where I could add a number to the product and have it display on the front end that way?

Thanks,

Karen

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

  • Posts: 83603
  • Thank you received: 13533
  • MODERATOR
6 years 9 months ago #294659

Hi,

There is no drag'n'drop. However, you can order the products with that "order" column. It's not possible that you don't have it. You have to have it.
Note however that the input fields to change the ordering number will only be available for leaf categories (categories without sub categories). So you need to access a listing of the products of a particular category and there you will be able to order the products in that category with that order column.

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

  • Posts: 99
  • Thank you received: 6
  • Hikashop Business
6 years 9 months ago #294690

OK, thank you Nicolas. I believe I understand.

Right now we don't have the order column in the product overview. We did make some changes to that view however so I can only suspect that it was somehow eliminated, though I can't conceive of why, when changes were made. See take.ms/FF2jt

Presuming that the listings.php file is the correct file where that lives, could you direct me to the section of code relevant to the order.

We want to control the order of the "All Products" category, so is that what you mean by a leaf category?

Last edit: 6 years 9 months ago by karendunne.

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

  • Posts: 26220
  • Thank you received: 4035
  • MODERATOR
6 years 9 months ago #294729

Hello,

Please do not include your credentials in the forum for your own security.
We won't (and we can't) guarantee the safety of the content of your message since it's a public forum.
Please be sure that if we need access to your backend, we will ask for it (using a safe method to retrieve them).

Now regarding your message, if you do not have the ordering column it's because you do not display the products of the selected category but of all sub categories.
You have tooltips which are telling you that in the backend product listing when you're not in the right mode to perform the ordering of the items.
The reason is simple, if you display products of several categories, you can't perform a sort because you have items of different categories in the same time.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 99
  • Thank you received: 6
  • Hikashop Business
6 years 9 months ago #294736

Hi Jerome,

The credentials were wrapped in the

This message contains confidential information

Last edit: 6 years 9 months ago by karendunne.

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

  • Posts: 26220
  • Thank you received: 4035
  • MODERATOR
6 years 9 months ago #294749

Hello,

Like I wrote

We won't (and we can't) guarantee the safety of the content of your message since it's a public forum.

We cannot guarantee that the "confidential" tag will stay confidential.
You want to send us confidential information, then use the "contact us" form like we always say and do for the past 8 years.
www.hikashop.com/support/contact-us.html

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 6 years 9 months ago by nicolas.

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

  • Posts: 99
  • Thank you received: 6
  • Hikashop Business
6 years 9 months ago #294837

I did not know about using the contact form to send credentials. I looked around and did not find where that is stated. How would a subscriber know that's what you've been saying for the past 8 years? What is the confidential information function on the editor for then?

Are you able or willing to answer the question I've been asking in each reply, i.e.

Is it the listings.php file (adminstrator>components>com_hikashop>views>product>listings.php) where the code lives for the order sorting? If so, what block of code is relevant to the order? If not, what file should I be looking at? There isn't any order column in our site's backend.

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

  • Posts: 83603
  • Thank you received: 13533
  • MODERATOR
6 years 9 months ago #294943

Hi,

The problem with the confidential information function of the forum is that if there is a bug in the forum in the futur (we're using Kunena), it could potentially display the information inside the confidential tags of all the posts to anyone. That's why, when we ask someone to provide credentials, we usually ask them to do so via our contact form, even it's not stated in any "forum rules" area as we don't have such area.

But anyways, we don't need your backend credentials to answer you.
The code handling the "order" column is indeed in the file "listing" of the view "product". You can edit this file in the menu Display>Views for your backend template.
However, you probably won't find the code there, because when I look at your screenshot, it looks like the column has been removed.
In the default view file, this column is handled by the code:

<th class="title titleorder"><?php
								if($this->doOrdering) {
									if ($this->order->ordering)
										echo JHTML::_('grid.order', $this->rows);
									echo JHTML::_('grid.sort', JText::_( 'HIKA_ORDER' ), 'a.ordering',$this->pageInfo->filter->order->dir, $this->pageInfo->filter->order->value );
								} else {
									?><a href="#" title="<?php echo JText::_('CHANGE_SUB_ELEMENT_FILTER_TO_REORDER_ELEMENTS'); ?>"><?php echo JText::_( 'HIKA_ORDER' ); ?></a><?php
								}
							?></th>
and the code:
<td class="order"><?php
								if($this->doOrdering){
									if($this->manage){ ?>
										<span><?php echo $this->pagination->orderUpIcon( $i, $this->order->reverse XOR ( $row->ordering >= @$this->rows[$i-1]->ordering ), $this->order->orderUp, 'Move Up',$this->order->ordering ); ?></span>
										<span><?php echo $this->pagination->orderDownIcon( $i, $a, $this->order->reverse XOR ( $row->ordering <= @$this->rows[$i+1]->ordering ), $this->order->orderDown, 'Move Down' ,$this->order->ordering); ?></span>
										<input type="text" name="order[]" size="5" <?php if(!$this->order->ordering) echo 'disabled="disabled"'?> value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" />
									<?php }else{ echo $row->ordering; }
								} else {
									?><a href="#" title="<?php echo JText::_('CHANGE_SUB_ELEMENT_FILTER_TO_REORDER_ELEMENTS'); ?>"><img src="<?php echo HIKASHOP_IMAGES; ?>delete2.png" alt="<?php echo JText::_('HIKA_DELETE'); ?>"></a><?php
								}
							?></td>
You can find the original code of your version of HikaShop for that file in administrator/components/com_hikashop/views/product/tmpl/listing.php

Note however that even if you add back that code, or remove your view override to use your original version of that file, you still won't be able to edit the order of the products in the "all products" category because it doesn't normally make much sense to do that. That's because the products are probably not linked to that category but to sub categories of that category, and thus the ordering of the products is configurable in each category where you have the products directly linked. That's because on the frontend, you normally display a listing of the categories, and when you click on a category, you see the products of that category. And thus, the ordering of the products are for that category and not the main category. If we allowed you to change the ordering of the products among several sub categories, you would end up with several products with the order "1" (one for each sub category), several with the order "2", etc and that would be more confusing than anything.
So if you want to change the ordering of the products, you need to go into each individual category.

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

  • Posts: 99
  • Thank you received: 6
  • Hikashop Business
6 years 9 months ago #294965

Thank you Nicolas. I understand the explanation.

Thank you for pointing out the block of code. That was very helpful.

Cheers,

Karen

The following user(s) said Thank You: Philip

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

Time to create page: 0.073 seconds
Powered by Kunena Forum