A
A
Andrey Borchik2021-03-06 12:35:57
Prestashop
Andrey Borchik, 2021-03-06 12:35:57

How to change the default combination in a certain category in Prestashop?

How to change the default combination in a certain category in Prestashop?
Website Arthata.by

The essence of the problem and question:
There is a product with combinations of goods. I want to assign multiple product categories to this products. And based on the category, the desired combination should be selected when opening a product in this category or when viewing a product in this category.

I googled these lines of code, but I do not understand how to use:

public function setWsDefaultCombination($id_combination)
    {
        $this->deleteDefaultAttributes();
        return $this->setDefaultAttribute((int) $id_combination);
    }


I'm thinking of doing this code:
if ($category->id == "21")
{$this->setDefaultAttribute(55);}


The code is not quite correct, but I think this is the direction.
The question is where to insert, and how to correct?
Help....

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question