Answer the question
In order to leave comments, you need to log in
How to make a two-way link for products in OpenCart 2.1?
Hello!
Installed one-way linked products module for Opencart to disable automatic two-way linking for products. But you need to make sure that when you manually add feedback, this connection is not destroyed.
An example in the picture. With the module enabled, if I add a registrar to the camera, the registrar will disappear from the camera.
When the module is disabled, everything works, but such links are NOT needed for all products, but only for those where the link is set manually.
I hope I explained the problem in detail. Can anyone help please explain how this can be done.
Thank you!
Answer the question
In order to leave comments, you need to log in
There, the module simply comments 2 lines:
$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE product_id = '" . (int)$related_id . "' AND related_id = '" . (int)$product_id . "'");
$this->db->query("INSERT INTO " . DB_PREFIX . "product_related SET product_id = '" . (int)$related_id . "', related_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE product_id = '" . (int)$related_id . "' AND related_id = '" . (int)$product_id . "'");
continues to work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question