Your input clarified how this module works. I put in the proper parameters and it's working as it should now, and it will do what I need it to do without futher programming--simple is good. Thanks!
justme
Your input clarified how this module works. I put in the proper parameters and it's working as it should now, and it will do what I need it to do without futher programming--simple is good. Thanks!
justme
Will this module apply the discount to the prices in price manager? SaleMaker through admin does not so I am looking for something that will. Thank you.
It's completely separate from price manager - it's a different mechanism entirely.
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
I'm using Zen Cart 1.3.7, installed this order_total module - modified apply_special_category_discount() for the particular category I want it to apply a discount for, but it didn't work - I had set the module to do discounts by category.
So, I did some echos and found that $products[$i]['category'] was null, so I added the following subroutine to the calculate_deductions function right afteradd the following:Code:$products = $_SESSION['cart']->get_products(); $prod_list = array(); $prod_list_price = array(); $cat_list = array(); $cat_list_price = array(); $all_items = 0; $cat_list_back = array(); $prod_list_back = array(); $all_items_price = 0; for ($i=0, $n=sizeof($products); $i<$n; $i++) {
Now I get the quantity discount showing in the checkout page.Code:if ($products[$i]['category'] == '') { $products[$i]['category'] = zen_get_products_category_id($products[$i]['id']); }
Let me know if there's an easier fix!
Thanks,
Linda
If category is null, you have the dreaded :) Master Categories problem, likely caused by using Easy Populate. You can back up your database, then go to Admin -> Tools -> Store Manager, and click on "Reset ALL Products Master Categories ID".
Good luck,
Software Guy
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Actually, I looked at(which returns the $products array), it does not return a category for the product, which makes it null.Code:$products = $_SESSION['cart']->get_products();
The shopping_cart class doesn't even mention master_categories_id. Here's the code from the shopping cart class:
Taking a look the the database shows that all products have a master_categories_id, so that's not the problem. I also have not used Easy Populate.Code:$products_array[] = array('id' => $products_id, 'name' => $products->fields['products_name'], 'model' => $products->fields['products_model'], 'image' => $products->fields['products_image'], 'price' => ($products->fields['product_is_free'] =='1' ? 0 : $products_price), // 'quantity' => $this->contents[$products_id]['qty'], 'quantity' => $new_qty, 'weight' => $products->fields['products_weight'] + $this->attributes_weight($products_id), // fix here 'final_price' => ($products_price + $this->attributes_price($products_id)), 'onetime_charges' => ($this->attributes_price_onetime_charges($products_id, $new_qty)), 'tax_class_id' => $products->fields['products_tax_class_id'], 'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''), 'attributes_values' => (isset($this->contents[$products_id]['attributes_values']) ? $this->contents[$products_id]['attributes_values'] : ''), 'products_priced_by_attribute' => $products->fields['products_priced_by_attribute'], 'product_is_free' => $products->fields['product_is_free'], 'products_discount_type' => $products->fields['products_discount_type'], 'products_discount_type_from' => $products->fields['products_discount_type_from']);
Interesting - could it just be a change from the version of zen cart?
Thanks,
Linda
What you have posted looks like an old version. Re-download 1.3.7 and look again - line 1178 of shopping_cart.php should be
'category' => $products->fields['master_categories_id'],
It is true that in older versions of shopping_cart.php this field wasn't set; I used to compensate for that if you look back at Quantity Discounts version 1.2 and prior by including a customized copy of shopping_cart.php.
SoftwareGuy
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Thanks,
You are so right! lol... interesting that the version tool in admin says it's 1.3.7, probably partly updated... I promise not to complain any more... about that anyway!
Thanks again,
Linda
You probably just had an old local change you forgot to update. It might be worth re-checking against a fresh download to be sure that's the only out of date file.
Good luck,
Scott
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
hi Softwareguy
how are you?
thanx for the this mod its really great to have it but i have one problem is that the mod don't work with the cart,, i did everything you mentioned in the read me file, and its installed correctly, i used discount Discount Basis
Total Items in Cart.
it do not show or calculate a discount with the cart, i have 1.3.7 zen cart
the Discount model appears in Order Total Modules correctly...
but not on the interface or in calculations...
what is the problem?
www.alsousbros.com
can you help in it?
regards
Bookmarks