EllisLab text mark
Advanced Search
2 of 10
2
   
flexi cart - A comprehensive shopping cart library for CodeIgniter
Posted: 29 May 2012 11:19 AM   [ Ignore ]   [ # 21 ]   [ Rating: 0 ]
Joined: 2009-05-11
52 posts

Thank you, I think I’ll go with this solution.
I need the third table since I need to save split data for each store.

I wanted to report a couple of what may be bugs:
1. In your doc pages the anchors don’t seem to work (ex. this link is not taking me to the tax_total section: http://haseydesign.com/flexi-cart/user_guide/cart_summary_session_data#tax_total )

2. It seems that the shipping is taxed even though $config[‘defaults’][‘shipping’][‘tax_rate’] = 0;
Example:
I’m adding one item to my cart (€22), quantity: 2 (€44), shipping is €10, set with

$shipping_data = array(
 
'value' => 10 //example
);
$this->flexi_cart->set_shipping($shipping_data); 

Tax is 21%, set with

$tax_data = array(
 
'rate' => 21,
 
'name' => 'VAT'
);
$this->flexi_cart->set_tax($tax_data); 

Results:

$this->flexi_cart->item_summary_total(); // 44
$this->flexi_cart->shipping_total(); // 10
$this->flexi_cart->tax_name()." @ ".$this->flexi_cart->tax_rate(); //VAT @ 21%
$this->flexi_cart->tax_total(); //11.34, calculated on €54
$this->flexi_cart->total(); //65.34 (54+11.34) 

Results in a foreach cart items:

$this->flexi_cart->item_tax_total($row_idfalsefalsefalse); //9.24, calculated on €44, without shipping 

I’m guessing the 11.34 is wrong - tax has to be calculated on products without shipping.
Or viceversa. Actually, maybe 11.34 is correct and 9.24 is not.

How can I set this? I am not (yet) using a shipping db table, but even then I’ll still set shipping rate as shown above.

Thank you once again.

 
Posted: 31 May 2012 09:18 AM   [ Ignore ]   [ # 22 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

@koichirose

Thanks for the input.

Issue #1: the broken link to http://haseydesign.com/flexi-cart/user_guide/cart_summary_session_data#tax_total
This seems to work fine for me, perhaps your browser is jumping to the last position you were viewing on the page before a page refresh? - Or is there something I’m misunderstanding?

Issue #2: Shipping tax rate set as ‘0’ via the config file is being ignored.
This was definitely a bug, the value ‘0’ was being treated as FALSE, and so was being ignored.

I have fixed this problem and made the change to the Github repo.
If you’d prefer to just change the errornous line, its located on line 2060 within flexi_cart_model.php.

Change the following line from:

$value = (! empty($this->flexi->cart_defaults['shipping'][$column])) ? $this->flexi->cart_defaults['shipping'][$column] $data

To:

$value = (! empty($this->flexi->cart_defaults['shipping'][$column]) || $this->non_negative($this->flexi->cart_defaults['shipping'][$column])) ? 
  
$this->flexi->cart_defaults['shipping'][$column] $data

I haven’t had a chance to properly test this yet, so if things are still weird, let me know.

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 16 July 2012 03:29 PM   [ Ignore ]   [ # 23 ]   [ Rating: 0 ]
Joined: 2012-07-16
3 posts

Hi,


Flexi-cart library looks very nice but after I got it installed, everything is looking good except no items can be added to the cart.  No errors either, it just returns to the view after I click on any of the examples such as Example 101 , Example 102 etc.

Any ideas what maybe I’m missing?

Thanks,
Mike

 
Posted: 17 July 2012 07:11 AM   [ Ignore ]   [ # 24 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

Hi Mike,

Since you seem to suggest that the installation is generally working okay - i.e. there being no errors - I would presume the problem to be with either CI’s sessions or the database setup.

I will take a guess that maybe the ‘sess_use_database’ setting in CI’s config/config.php file is not set as ‘true’.
It MUST be set as

$config['sess_use_database'TRUE

If that doesn’t help and you haven’t done so already, install a brand new installation of CI and then run through the flexi cart step by step installation guide http://haseydesign.com/flexi-cart/user_guide/installation

Let us know if your still struggling.
Good luck.

 

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 17 July 2012 10:13 PM   [ Ignore ]   [ # 25 ]   [ Rating: 0 ]
Joined: 2012-07-16
3 posts

99% there. Like you said, changing from false to true worked for most items.

$config[‘sess_use_database’] = TRUE;  // <——Great

but it’s odd that none of the items via links work (the 100 series) am I missing something else that you can think of. 

Thanks!

 
Posted: 18 July 2012 07:51 AM   [ Ignore ]   [ # 26 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

Hey again Mike,
it’s a little odd that the ‘items via links’ are not working whilst the other examples are.
The item form examples essentially work in the same manner, so the library files will be working okay.

I would suggest the best way to diagnose the problem is to start the flexi cart demo from scratch, by setting up a brand new CI installation, and then running through the flexi auth installation guide http://haseydesign.com/flexi-cart/user_guide/installation.
I know i’s a little long to read but it is all pretty essential in order for the library to work.

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 18 July 2012 07:53 AM   [ Ignore ]   [ # 27 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

Duplicate post

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 18 July 2012 08:07 PM   [ Ignore ]   [ # 28 ]   [ Rating: 0 ]
Joined: 2012-07-16
3 posts

OK I will trudge through it again. I was praying it was something simple. I looked through the instructions and did notice I missed a part that mentioned the session and didn’t notice that I missed anything else. I will have to do it again and see where it leads.

Thanks I will let you know either way how it works out.

 
Posted: 08 August 2012 09:17 AM   [ Ignore ]   [ # 29 ]   [ Rating: 0 ]
Joined: 2012-08-08
5 posts

Hi there,

Does anyone have any idea why I get this error when I view the content of the cart?

A PHP Error was encountered

Severity: Warning

Message: Creating default object from empty value

Filename: models/flexi_cart_lite_model.php

Line Number: 41

Which is this line:

$this->flexi->cart $this->config->item('cart','flexi_cart'); 

I can see the items added to my cart with all the info, but I have no idea how I could fix this issue. The configs file look good, the SQL database works, the session looks OK.

Any ideas? I would really appreciate any help. Thanks

 
Posted: 09 August 2012 09:17 AM   [ Ignore ]   [ # 30 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

Hey Valcsi,

The PHP error warning you were receiving was a minor bug with the library.

I have since fixed this bug and have pushed the changes to the Github repo.
So just pull the changes from the repo and all should be working fine.

Thanks for reporting the bug.

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 09 August 2012 06:49 PM   [ Ignore ]   [ # 31 ]   [ Rating: 0 ]
Joined: 2012-08-08
5 posts

Thanks for the help. I’ve updated the installation, and now I get the following errors:

A PHP Error was encountered
Severity: Notice
Message: Undefined property: stdClass::$cart_database
Filename: models/flexi_cart_lite_model.php
Line Number: 1026

and about a 100 more with the same message but different line numbers. I also have these:

A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: models/flexi_cart_model.php
Line Number: 3853

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: config_data
Filename: models/flexi_cart_model.php
Line Number: 3868

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at <installdir>\system\core\Exceptions.php:185)
Filename: libraries/Session.php
Line Number: 672

Any idea why I get these? I appreciate your help.

Thanks

 
Posted: 09 August 2012 09:57 PM   [ Ignore ]   [ # 32 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

Hey again Valcsi,
The original warning seems to be occur in the most latest versions of PHP, which is why I originally missed it.

The fix I put out yesterday was a late night rush job, which sadly didn’t get properly tested.
I will try and get a proper fix out very soon.

In the meantime, if you need to progress with development, I suggest you rollback the git update I put out last night and temporarily ignore the single warning put out until I release the fix.

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 10 August 2012 06:06 AM   [ Ignore ]   [ # 33 ]   [ Rating: 0 ]
Joined: 2012-08-08
5 posts

Ok, great thanks.

 
Posted: 16 August 2012 07:03 AM   [ Ignore ]   [ # 34 ]   [ Rating: 0 ]
Joined: 2012-03-08
159 posts

Hey Valcsi,

Sorry for the delay in patching the PHP 5.4 warning.

If you want you can amend the very quick changes manually, or alternatively, if your still trialing with the demo, you can download the changes via the updated Github repo.

The changes concern defining a global object to each of your controllers that load the flexi cart library. No changes were made to the actual flexi cart libraries or models!

To manually do the change, you need to add the following code to each of your controllers JUST BEFORE you load the flexi cart library.

$this->flexi = new stdClass;
$this->load->library('flexi_cart'); 

The user guide has been updated to reflect these changes under the heading ‘Define the global cart class’.
http://haseydesign.com/flexi-cart/user_guide/installation

Hopefully that gets you going again.

 Signature 

flexi-auth | A user authentication library for CodeIgniter.
flexi-cart | An e-commerce shopping cart library for CodeIgniter.

 
Posted: 18 August 2012 05:54 AM   [ Ignore ]   [ # 35 ]   [ Rating: 0 ]
Joined: 2012-08-18
1 posts

the above fix not working and i still getting the error
Severity: Notice
Message: Undefined property: stdClass::$cart_database
Filename: models/flexi_cart_lite_model.php
Line Number: 1026.

I tried this in different codeignitor versions, still no chance

 
2 of 10
2