Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configurable children #467

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ public function dolink($pid, $cond, $conddata = array())
// recreate associations
$sql = "INSERT INTO $cpsl (`parent_id`,`product_id`) SELECT cpec.entity_id as parent_id,cpes.entity_id as product_id
FROM $cpe as cpec
JOIN $cpe as cpes ON cpes.type_id IN ('simple','virtual') AND cpes.sku $cond
JOIN $cpe as cpes ON cpes.sku $cond
WHERE cpec.entity_id=?";
$this->insert($sql, array_merge($conddata, array($pid)));
$sql = "INSERT INTO $cpr (`parent_id`,`child_id`) SELECT cpec.entity_id as parent_id,cpes.entity_id as child_id
FROM $cpe as cpec
JOIN $cpe as cpes ON cpes.type_id IN ('simple','virtual') AND cpes.sku $cond
JOIN $cpe as cpes ON cpes.sku $cond
WHERE cpec.entity_id=?";
$this->insert($sql, array_merge($conddata, array($pid)));
unset($conddata);
Expand Down