• Closed by: Marek
  • Closed on: 01.11.19, 18:39
  • Reason: No answer from a customer
  • Comment: Glad to help!

Ticket #15616 - Module pk-isotope order

Hi

I wanna order products when we click any tab with last products added, by product id or created time.

Where we can set it?

Regards, Aaron

Comments

Marek 18 Sep 2019, 18:22

Hi, Servilogi World Services.
I suppose you need this option https://take.ms/Wvtf4

Servilogi World Services 18 Sep 2019, 19:50

No, for example in your demo clasic.

I attach image: http://prntscr.com/p7vnzf

I want sort items in that module,as product id or date created. Seems that is random or something.
I don’t know how sort that module items or how can i set it.

I did it: http://prntscr.com/p7vqb9

We want show last products added to calatog as first items in that module.

I try my best english, sorry :P

Marek 18 Sep 2019, 21:05

No problem with english, it’s not my first language too.
As for your question, there is no such option in the module to change the order

Servilogi World Services 18 Sep 2019, 23:03

I’m watching code, they get properties from “use PrestaShop\PrestaShop\Core\Product\Search\SortOrder;”

From lane 363 to 371 in file /modules/pk_isotope/pk_isotope.php put that lanes:

foreach ($uniqueListID as $k ⇒ $productID) {
if (Validate::isLoadedObject($product = new Product1)) {
$prdcts[”unsorted”][$k] = get_object_vars($product);
$prdcts[”unsorted”][$k][”id_product”] = $productID;
}
}
$products[”unsorted”] = $this→prepareBlocksProducts($prdcts[”unsorted”], $params[’hook’]);

Developer put unsorted and lanes 462 to 473 they put order by types, then would be any way to sort it.

It shouldn’t be very difficult for those who have created the template and the module.

Can you help me with that please

1) int)$productID
Marek 19 Sep 2019, 11:29

Try to change these variables (Line 377):

$orderBy = Tools::getProductsOrder('by', Tools::getValue('orderby'));
$orderWay = Tools::getProductsOrder('way', Tools::getValue('orderway'));

For example:

$orderBy = 'asc';
$orderWay = 'name';

Available options:

OrderBy
'asc',
'desc'
---
OrderWay
'position'
'name'
'price'
'date_add'
Marek 19 Sep 2019, 11:29

Our support doesn’t cover code customizations

Servilogi World Services 25 Sep 2019, 16:41

I will try and give you some info.

We have another two question, i give you url: (https://myshoplist.es/)

- Order as guest don’t run.
- Module appears on configuration page layout but isn’t in homepage. (module product list, would be appear before module pk_isotope)

Regards, Aaron

Servilogi World Services 30 Sep 2019, 21:07

Any idea¿?

Marek 01 Oct 2019, 10:56

Order as guest don’t run - what do you mean? it works for me
Please make sure the module is configured correctly, maybe there is just no any products to show