swguy Posted July 31, 2019 Author Share Posted July 31, 2019 If you want you can change the code to replace the old table defines with the hardcoded names, but it will be faster just to use the patch I just posted. Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
LeeFoster Posted August 2, 2019 Share Posted August 2, 2019 On 7/31/2019 at 11:05 PM, swguy said: Adding back the defines will fix the issue. In includes/modules/order_total/ot_better_together.php after php starts, add: if (!defined('TABLE_PRODUCTS')) { define('TABLE_PRODUCTS', 'products'); } if (!defined('TABLE_PRODUCTS_TO_CATEGORIES')) { define('TABLE_PRODUCTS_TO_CATEGORIES', 'products_to_categories'); } if (!defined('TABLE_TAX_RATES')) { define('TABLE_TAX_RATES', 'tax_rates'); } Yeah this fixed it Quote Link to comment Share on other sites More sharing options...
♥Dan Cole Posted August 3, 2019 Share Posted August 3, 2019 The usual way to fix this is to just use the table names in your queries....ie replace TABLE_TAX_RATES with tax_rates....problem solved. Dan Quote Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here. Link to comment Share on other sites More sharing options...
swguy Posted August 3, 2019 Author Share Posted August 3, 2019 Agreed - I'm just getting all the required changes sorted and then I'll submit an update. Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
Guest Posted August 29, 2019 Share Posted August 29, 2019 Installed and playing with the contribution - 2.3.4.1 CE Edge and PHP 7.0 This is what I'm testing: $this->add_cat_to_cat(3,3,"%", 100); Which essentially means - buy one from category 3, get one from category 3 for free (100% off) If I put 10 items in my cart from category 3....5 of them are being discounted 100% and given for free. Buy One, Get One Free...over and over and over Is there a way to limit this to only one free item per cart? Sorry if this has been answered already. I rushed thru this thread and didn't see anything. - Andrea Quote Link to comment Share on other sites More sharing options...
swguy Posted August 29, 2019 Author Share Posted August 29, 2019 Nothing is built in. But if you look at includes/modules/order_total/ot_better_together.php around line 310 where it says for ($i=0, $n=sizeof($discountable_products); $i<$n; $i++) { you could do a check like: if ($discount > 0) break; Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
Guest Posted August 29, 2019 Share Posted August 29, 2019 15 minutes ago, swguy said: if ($discount > 0) break; Perfect! Thank You so much! - Andrea Quote Link to comment Share on other sites More sharing options...
swguy Posted October 19, 2019 Author Share Posted October 19, 2019 Phoenix users - please get Better Together for Phoenix here: https://apps.oscommerce.com/Apps&XpyA1&better-together-for-phoenix kgtee, ArtcoInc and LeeFoster 3 Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
kgtee Posted December 12, 2019 Share Posted December 12, 2019 @swguy Dear Scott, I have been playing with this wonderful app of yours for some time. Yesterday, I saw a FAQ on your website: Quote Q: What would my setup() look like if I wanted to do buy one of item 5, get one from category 2, 7 or 9 at $5 off?A: Here's what you would do: function setup() { $this->add_prod_to_cat(5,2,"$", 5); $this->add_prod_to_cat(5,7,"$", 5); $this->add_prod_to_cat(5,9,"$", 5); } So, I tried a similar promo and tested it. To my surprise, the promo will calculate $5 discount only, no matter items of one, two or all three categories 2, 7 and 9 are included in checkout. It seems the discount only apply to the first pair of better together promo and ignore the others. Is the algorithm meant to work this way? Quote Link to comment Share on other sites More sharing options...
swguy Posted December 12, 2019 Author Share Posted December 12, 2019 Yes it is. Better Together deals with pairs of items. Get ONE from ONE of these categories (2 OR 7 OR 9). If you need "get multiple from any of these categories" look at Big Chooser. kgtee 1 Quote Contributions: Better Together and Quantity Discounts for osCommerce 2.3.x and Phoenix. See my profile for more details. Link to comment Share on other sites More sharing options...
kgtee Posted December 12, 2019 Share Posted December 12, 2019 I just realized I could change the function get_discount( ) in ot_better_together.php to enable totalling the discounted amount of all the three items in categories 2 & 7 & 9. 😄 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.