Welcome Guest, Not a member yet? Register   Sign In
flexi cart - A comprehensive shopping cart library for CodeIgniter
#73

[eluser]haseydesign[/eluser]
@koichirose

Lots of questions there koichirose, let me try and address them individually.

Item Group Discounts
The 'disc_item_fk' column is only used to define a discount for a specific item.
If you would like to apply a discount to a group of items, you would use the 'disc_group_fk' column.

This column would then link to the 'disc_group_id' column within the 'discount_groups' table. Each row within this table is the wrapping group for items to be inserted into.

Then the ids of the items you want to group discount are added to the 'disc_group_item_id' column within the 'discount_group_items' table.

When you then add an item to the cart, it will automatically check through the foreign key relationship between the 3 tables and check whether the item id exists within the 'discount_group_items' table. If the discount conditions are valid, the discount will be applied for the item.

I will also point out that the library also includes functions to help you manage discount item groups.
http://haseydesign.com/flexi-cart/user_g...ount_group
http://haseydesign.com/flexi-cart/user_g...group_item

A demo of adding items to a discount group using a custom SQL WHERE builder can be found at:
http://haseydesign.com/flexi-cart/admin_...up_items/1
http://haseydesign.com/flexi-cart/user_g..._sql_where


Defining an Infinite Discount Limit
This is not possible with the current design of the library, instead you will just need to put a large value into the 'disc_usage_limit' column.
If the quantity is 0 or null, the library will detect the discount offer as no longer being available.


Allowing Only 1 Discount Code
Thanks for pointing out this bug. I've updated the Github repo with a fix to solve this problem.
Only the /models/flexi_cart_model.php file needs to be updated.


Messages In This Thread
flexi cart - A comprehensive shopping cart library for CodeIgniter - by El Forum - 11-14-2012, 02:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB