public function add($related_product_id, $product_id)
    {
        $result = null;
        $this->hook->attach('product.related.add.before', $related_product_id, $product_id, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $this->db->insert('product_related', array('product_id' => $product_id, 'item_product_id' => $related_product_id));
        $this->db->insert('product_related', array('product_id' => $related_product_id, 'item_product_id' => $product_id));

        $this->hook->attach('product.related.add.after', $related_product_id, $product_id, $result, $this);
        return (bool) $result;
    }
public function add($related_product_id, $product_id)
    {
        $result = null;
        $this->hook->attach('product.related.add.before', $related_product_id, $product_id, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $this->db->insert('product_related', array('product_id' => $product_id, 'item_product_id' => $related_product_id));
        $this->db->insert('product_related', array('product_id' => $related_product_id, 'item_product_id' => $product_id));

        $this->hook->attach('product.related.add.after', $related_product_id, $product_id, $result, $this);
        return (bool) $result;
    }
public function add ( $ related_product_id , $ product_id ) { $ result = null ; $ this -> hook -> attach ( 'product.related.add.before' , $ related_product_id , $ product_id , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( bool ) $ result ; } $ this -> db -> insert ( 'product_related' , array ( 'product_id' => $ product_id , 'item_product_id' => $ related_product_id ) ) ; $ this -> db -> insert ( 'product_related' , array ( 'product_id' => $ related_product_id , 'item_product_id' => $ product_id ) ) ; $ this -> hook -> attach ( 'product.related.add.after' , $ related_product_id , $ product_id , $ result , $ this ) ; return ( bool ) $ result ; }
Adds product relations
@param int $related_product_id
@param int $product_id
@return bool
Adds product relations