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

[eluser]AlwynW[/eluser]
@haseydesign thanks for the quick answer. There was a problem with the data I send to the cart which triggered an error in the calculation.
Another issue I'm facing is that the data doesn't seem to be stored in between pages. So the item is added to the cart but after a redirect the cart is empty again.

Any idea?
#62

[eluser]haseydesign[/eluser]
@AlwynW

This problem is usually caused if you are not saving session data to a database.

This is defined via a config setting in the CI config file.
Code:
$config['sess_use_database'] = TRUE;

For the this to work, you have to also ensure the session database table has been created.
Read more at http://ellislab.com/codeigniter/user-gui...sions.html under the subheading Saving Session Data to a Database
#63

[eluser]AlwynW[/eluser]
Again thanks for taking the time to look at my question. It seems to be a combination of things I did wrong (got the settings right after all). Note to self, make sure you only load the library once. I did a load on construct and another in the controller function which messed it all up. I figured it out and everything works as expected now!

Another question though, is it possible to configure the following system, either with points or vouchers and what would be the best way to go:

Each purchase grants the user a discount of 2% of the amount (of the current sale) for the next purchase. The user should be able to save these discounts until they want to use it (after each next purchase the discount adds to the existing one).
So it's not mandatory they use it for a next purchase.
I think the point system is not really useful for this or I had to abuse it so each point is in fact 1 euro/dollar.
#64

[eluser]haseydesign[/eluser]
Hey again AlwynW,

The libraries reward point feature would not really be suitable for the functionality you have outlined as it is intended to be monetary based.

However, there would be nothing stopping you creating a new discount every time the user placed an order that was linked to the users id. The discount could then be defined with a voucher code so that the user can then redeem the voucher when they wish.
Upon creating the discount, you could check whether the user had an existing discount, and then just up the percentage as required.

Whilst this is possible, I will advise you that incrementing the discount as you have described without any other conditions would be a very bad idea. All I would need to do is place 50 separate orders for the cheapest item on the site. This would increment my discount to 100% (50 orders x 2%), I could then place another order for everything on your site with a 100% discount - free!
So just make sure you have some conditions capping the percentage at a maximum limit.
#65

[eluser]harpreets[/eluser]
Hi when i add items to cart in the demo the cart is shown empty in view cart. plz help
#66

[eluser]haseydesign[/eluser]
@harpreets

Refer to my post above to AlwynW and the solution he came up with, that appears to be the most common cause.
#67

[eluser]haseydesign[/eluser]
Duplicate post
#68

[eluser]harpreets[/eluser]
Thanks for timely reply.
#69

[eluser]koichirose[/eluser]
Hi, I have a few questions about discounts:

- It seems I can't set discounts for a group of users (users of a certain group, an array of user_ids, etc). Is that correct? How should I correctly integrate this functionality with flexi?
- On a related note: can I insert a discount code redeemable only once per user?

Thank you
#70

[eluser]haseydesign[/eluser]
Welcome back koichirose,

There is no specifically defined discount column to handle a user group id.
Instead, there are 3 custom status columns that you can define whatever data you want into them - e.g. A user group id.

Within the database discount table, you could for example define the 'custom_status_X' as '3' (User group id = 3).
This would mean that the discount could only be applied to users that are in a user group with the id of 3.

- But how do you set the user group id within your php?
You can use the set_custom_status_X() function to define the user group id to the library session. It will then allow discounts with a 'custom_status_1' column value of '3'.

If you need to get the current custom status defined within the library session, you can use the [email=http://haseydesign.com/flexi-cart/user_guide/cart_config_session_data#custom_status_1]custom_status_X()[/email] function.

There are upto 3 custom statuses that you can define per discount.

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

Regarding limiting discounts to 1 per user, I seem to remember that I pondered on adding this as a feature, but never implemented it as it is too easy for a user to circumvent.
Basically the library would check whether the users id had ever completed an order with the discount active, if so it would invalidate the discount.

All you would need to do to get around this is create another account to get another user id.

If you wanted to add this yourself, you would need a little custom code.
Save the discount id within the order details table, when a user adds a discount, check whether the specific discount id and user id exist within the table - if so, deactivate the discount.

HTH




Theme © iAndrew 2016 - Forum software by © MyBB