Skip to content

Instantly share code, notes, and snippets.

@creitve
Created January 21, 2016 14:04
Show Gist options
  • Save creitve/dab8b3eeeb493598e0b1 to your computer and use it in GitHub Desktop.
Save creitve/dab8b3eeeb493598e0b1 to your computer and use it in GitHub Desktop.
diff --git a/app/addons/buy_together/func.php b/app/addons/buy_together/func.php
index 70751b6..39b022c 100644
--- a/app/addons/buy_together/func.php
+++ b/app/addons/buy_together/func.php
@@ -109,6 +109,8 @@ function fn_buy_together_get_chains($params = array(), $auth = array(), $lang_co
'descr.description',
);
+ fn_set_hook('buy_together_get_chains_pre', $fields, $params, $auth, $lang_code);
+
if (fn_allowed_for('ULTIMATE')) {
$fields[] = 'p.company_id';
}
@@ -332,13 +334,20 @@ function fn_buy_together_get_chains($params = array(), $auth = array(), $lang_co
}
if (!empty($params['simple'])) {
- return $chain;
+ $simple_chain = $chain;
+ break;
}
}
unset($chain);
}
+ if (isset($simple_chain)){
+ $chains = $simple_chain;
+ }
+
+ fn_set_hook('buy_together_get_chains_post', $chains, $params, $auth, $lang_code);
+
return $chains;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment