flexi cart - A comprehensive shopping cart library for CodeIgniter |
[eluser]haseydesign[/eluser]
@koichirose Hey again, I'm also pretty sure we touched on this topic before sometime, but here's the low-down again. When designing the library, I needed it to be flexible enough to work for many users different database setup regarding product/item tables. Whereas it would have been easy for me to include a product_category and product_brand column within the libraries discount table - that wouldn't have helped users that has a slightly different database setup that wanted to target product_sub_categories. Therefore, I added the 'discount_group' and 'discount_item_group' tables. These tables allow you to group a set of items, which can then be targeted by discounts via using the 'disc_group_fk' column within the main discount table. How you add items to your discount group is up to you, however, in the demo, I included an working example (http://haseydesign.com/flexi-cart/admin_...up_items/1) where you can select items via their name, category, price etc, and then add ALL of the matched items to a group via just one page and one html form. This demo can easily be expanded to match items to whatever product/item attributes you are trying to match - all without needing to clutter the main discount table with product/item attribute columns. So checkout the above link, look through the associated demo controller, model and view files - and you should be able to achieve what you want to do. The particular demo files you'll need to look at are: - \models\demo_insert_discount_group.php - \views\demo\admin_examples\discounts\discount_group_items_insert_view.php If you still want to go your own route on a per item discount, then you can match an item id to the discount table via the 'disc_item_fk' column. |
Welcome Guest, Not a member yet? Register Sign In |