Jump to content
mnementh64

[Free module] clean carts

Recommended Posts

Hi all,

I have been developping for a while some Prestashop modules / hacks for some friends' web sites, so now, I'd like to share them with the community, if they could be interesting. They are available on my (very new) web site.

The first module is "clean carts". You could list carts by many criterias : amount, number of products, dates, users or not, carrier on not and then delete them.

Of course, only carts not ordered are included.

Ok, it's over for today !

 

>> Edit 2012/02/28 (1.0) : new feature to transform carts into orders (use with care !!)

>> Edit 2011/11/08 (0.7) : link for cart details & customer details / button to list all carts / display date & price better / correct translation bug for 1.2.x versions

>> Edit 2011/07/10 (0.6) : compatible with Prestashop 1.4.3 and older 1.2.5

>> Edit 2011/06/06 (0.5) : compatible with Prestashop 1.4.2

>> Edit 2011/05/09 (0.4) : compatible with Prestashop 1.4.1

>> Edit 2011/03/29 (0.3) : upload path was incorrect in v1.4.0

>> Edit 2011/03/29 (0.2) : a single zip for versions 1.3.x et 1.4.0 + clean cross-indexed datas linked to cleaned carts

>> Edit 2011/03/25 (0.1) : compatible with Prestashop 1.4.0 + add files to download

pss_clearcarts_0.4.zip

pss_clearcarts_0.5.zip

pss_clearcarts_0.6.zip

pss_clearcarts_0.7.zip

pss_clearcarts_1.0.zip

  • Like 1

Share this post


Link to post
Share on other sites

I only call the Cart's class delete function, so the only impacted table are :
ps_cart
ps_cart_discount
ps_cart_product

And I don't delete anything in other tables (linked to ps_cart) :
ps_customization, ps_customized_data, ps_message, ps_message_readed

I am about to make my module work with Prestashop 1.4.

Share this post


Link to post
Share on other sites

To say the module is now compatible with Prestashop 1.4.0.
And it's now available for download from this thread (see first message).
Enjoy !

Share this post


Link to post
Share on other sites

Hi Angora,

Thank you for your reply. You're right when you say to delete carts without a good understanding of Prestashop database could damage it. But as you say, we should not delete carts :

- that have been converted to orders : my module does it,

- that are not older than 30 days : it's your opinion. With my module, you choose the dates. It's the shop administrator's responsability. For example, in some of my shops, I'd like to delete single product carts made from google shopping bot. I don't want to wait for 30 days to delete them.

At last, you say that to delete a cart should take into account all cross-indexed tables. You're right. But I don't think not to do this could damage the database and the coherence of objects to be loaded (carts, orders, ...). You will have some "orphans" datas in some tables, and some "orphans" files in some directories.

But, I propose you (in the case you think my module is a good base to do this) to help me to complete the module and delete all the informations cross-indexed to deleted carts.

As far as I have understood what "community" means, it's doesn't imply for contrinutors to give at first time a very perfect module ! So, please, help me to improve it !

Sylvain

Share this post


Link to post
Share on other sites

Thank you angora for your precise answer. Ok, I will add a cleaning of the cross-indexed core tables (code is already in the module but commented for the moment - I was waiting for a good advice such as yours), and also uploaded files for customized products. And soon, I will check also for some modules tables.

It will be available soon.



I don't understand why you show this bug because in my module, it's impossible to delete carts that have been ordered ! They are excluded.

Concerning orphans, I agree with you : no orphans is better. To follow this good path, it should be great if Prestashop team adds foreign keys to innodb version on 1.4.0 database !

Share this post


Link to post
Share on other sites

Here is an updated version that cleans also cross-indexed datas in Prestashop core tables.

For some details, the module cleans these datas linked to cleaned carts :

- uploaded files related to cart products customization

- in tables ps_customized_data & ps_customization

- in tables ps_message_readed & ps_message


I provide now a single zip file for all the supported Prestashop versions : 1.3.x & 1.4.0

Share this post


Link to post
Share on other sites

Now compatible with Prestashop 1.4.3 and older 1.2.5 (thanks to Leeloo for help).

Share this post


Link to post
Share on other sites

New version with many enhancements. See details in first post.

Thanks again to leeloo for help.

 

Enjoy,

Share this post


Link to post
Share on other sites

Here is a new version with a major change : a new feature to transform carts into VALIDATED orders. To be handled with care ! To be reserved to advanced users !

 

You set the payment module to be used and a cart is validated into an order using the validation process of this module : email sending, db insertions, logs, ... The validateOrder function of the module is called.

 

I needed this feature a few time ago because I had issues with bad validations from Paypal (403 HTTP error to get the validation.php file despite it's was ok to read for public). So I needed to validate some carts. Maybe you could use it also to check validation process of new payment module, or to create dummy orders for tests.

 

I'm waiting for your feedback but, please, I repeat : do use this feature only if you are an advanced user !

  • Like 2

Share this post


Link to post
Share on other sites

Hello. I am using PS 1.3.6.0

What version better to use ? As I understand this module clean carts? Does it clean from database? It cleans only empty carts and leaves real carts connected with real orders ? =)

Share this post


Link to post
Share on other sites

Please, make it work with v1.5.2 ... the module cannot be installed on 1.5.x.

Share this post


Link to post
Share on other sites

1.5.2 might have made the difference but FYI installed fine on 1.5.1.

 

Good combination of filters to narrow batches down to delete.

 

Still not sure why there is not checkbox/delete for carts or orders in the default package.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More