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

[eluser]JoJo17[/eluser]
@haseydesign

Your discounts work so it's definitely me getting it wrong! Here's my discount table:

insert into `discounts` values('1','0','8','0','0','0','0','0','0','test1','test discount code','0','0','0.00','1.00','1','1','0','0','','','','0','2012-09-19 12:54:41','2012-09-29 00:00:00','1','1');
#52

[eluser]haseydesign[/eluser]
@jojo

You were so close dude, you just needed to set the usage limit (disc_usage_limit).

Here's the revised code.

Code:
INSERT INTO `discounts` VALUES (1, 0, 8, 0, 0, 0, 0, 0, 0, 'test1', 'test discount code', 0, 0, 0.00, 1.00, 1, 1, 0, 0, '', '', '', 99, '2012-9-19 12:54:41', '2012-9-29 00:00:00', 1, 1);

The usage limit defines how many times the discount can be used, when set to 0, the cart thinks all the discount codes have been used up.

------------------------------------

I understand looking at the discount tables is a little daunting with so many columns and options.
To help out in future, I would suggest you create a separate installation of the flexi cart demo so that you can do stuff like build discounts via the provided demo and see what kind of output it does.

If you want/need to create discounts via your site, copy the code from the discount builder in the demo.
http://haseydesign.com/flexi-cart/admin_..._discounts
#53

[eluser]JoJo17[/eluser]
@haseydesign

Thank you for your help and patience - you are correct that was the problem though I was hoping to be able to have an unlimited use which is why I wasn't setting it!
#54

[eluser]Valcsi[/eluser]
@haseydesign

Thanks for the fix. Hopefully I'll have the time to give it a try in the next few days.

#55

[eluser]Procode[/eluser]
How exactly does the shipping work? Is there some sort of integration with any major carriers(ups, usps, or fedex)?
#56

[eluser]haseydesign[/eluser]
@Procode

The shipping within flexi cart has to be manually defined - there is currently no integration with any shipping companies.

However, that said, there are still many options to allow you to customise shipping rates for many different circumstances.

Shipping rates can be based on:
+ Location / Zone.
+ Order values and weight.

Shipping options include:
+ Different pricing tiers can be defined within each shipping option.
+ Customised tax value - that can differ from the default cart value.
+ Inclusion/Exclusion from cart discounts - i.e. A 10% cart wide discount could be excluded from affecting the shipping value.

Examples of setting shipping rates via an admin backend can be seen at:
http://haseydesign.com/flexi-cart/admin_...y/shipping
http://haseydesign.com/flexi-cart/admin_...ng_rates/1

If you, or anyone else does go down the road of trying to implement 3rd party shipping rates that can be integrated into the cart library, I'd be happy to lend a hand so the code could be included within the library for others to use. All contributors would be credited.
#57

[eluser]georgegijo[/eluser]
Flexi cart is a great library of shopping cart functions. I am trying to use it for an ecommerce project, but find it lacks adding new items. What I am going to do is to use the demo_items table itself to create new items and proceed from there. Please let me know the associated tables to be populated along with adding a new product item.

If possible can you please add sample code for adding a product item.

Thanks
#58

[eluser]haseydesign[/eluser]
@georgegijo

The flexi-cart library deliberately doesn't come with any product item management functions. The reason being is that e-commerce sites can have vastly different database
designs from one site to another.

So by omitting the functionality from the library, it allows the developer to plug the library into the setup they want, rather than forcing them to use a design that is potentially unsuitable to their needs.

To get a better understanding of some of the most common database designs for product tables on e-commerce sites, checkout this very good summary posted on Stackoverlow @ http://stackoverflow.com/a/695860/99106

As the most basic of examples, the flexi-cart demo includes a single table named 'demo_items'. If you need an example of inserting records to this table it could be done as simply as:
Code:
$sql_insert = array(
    'item_cat_fk' => 3,
    'item_name' => 'My Example Item',
    'item_price' => 29.99,
    'item_weight' => 9
);
$this->db->insert('demo_items', $sql_insert);

However, if you're unfamiliar with the native functions within CI (As used above), then I suggest you spend a couple of hours reading through the CI documentation just to give yourself an idea of what CodeIgniter can do. Once you know what it can do, then you can hunt down how to actually do it when you need to apply it.

http://ellislab.com/codeigniter/user-gui...ecord.html
#59

[eluser]AlwynW[/eluser]
While I was looking forward to using your library I can't make it work. I installed all the files correctly (demo files running fine as well) and just want to add an item to the cart and that's where it goes wrong.
I'm using this code in my controller:

Code:
$cart_data = array(
                'id' => $item_id,
                'name' => $name,
                'quantity' => $quantity,
                'price' => $price
            );

       $this->flexi_cart->insert_items($cart_data);

And this is the error:

Quote:Message: Undefined index: internal_price
Filename: models/flexi_cart_model.php
Line Number: 771

Which is a variable that according to the documentation is calculated automatically.
This is an exact copy of the code from the demo. What am I doing wrong?
#60

[eluser]haseydesign[/eluser]
@AlwynW

I know this will be a frustrating answer for you, but from what I can see, this is (Most likely) going to be a configuration problem that you are having. A problem that is going to be very hard for me to pinpoint without seeing your library setup.

The insert_items() code you have posted is fine - this is not where your problem lies.

What I do when in your situation is to reverse engineer the demo (Which you suggest IS working for you).
Take one of the working examples from the demo, and piece by piece, start changing the code to match the codebase you're aiming to create. Keep testing everytime you remove or add code until something causes the error you are seeing - then you will have found your problem.

If your still having trouble you could send me your current setup zipped and I'll try and have a look at it when I get time.

Good luck.




Theme © iAndrew 2016 - Forum software by © MyBB