Jump to content

[solved] Admin order management - reports by products ordered


Recommended Posts

Hello,

 

I am building a PrestaShop (1.5.4) site for a region specific fruit and veg delivery business.

 

The client would like access to “Product order summary reports” that combines the total produce from all orders from a specified period so they know what produce they need to buy at the market.

 

Eg If 5 different customers order 1kg carrots, 1kg potatoes and 1kg grapes,

in the report they would like a combined summary listing all different products and their quantities –

ie 5kg carrots, 5kg potatoes and 5kg grapes.

 

The only fields we really need are Product ID, Product Name, Any Options and Quantity Ordered.

 

Is this possible / supported with PrestaShop?

 

When initially investigating PrestaShop for this project i was told in the forums it is supported natively in the stats of prestashop but I cannot for the life of me find this.

 

In the orders section I can see how to view individual invoice and delivery slips which lists the products from that order - and how to combine delivery slips for a specified time period into one pdf file with each order on a separate page - these look realy nice. But how do I combine the orders into one file summarising all products sold during a specified time period?

 

In the Stats section, in the product details area, I can see "product list" - if I click on a name it shows sales of a particular product and there is a cross selling sub section - I can copy and paste that data to an excel file but it dies not include the product you clicked on so we'd always miss one product doing it this way.

 

The client would like something that she can easily export / print (rather than copying and pasting) and take with her to the market - basically like the delivery slips but in one summary file.

 

Any ideas on how to do this natively? Or is there a module that might do it?

 

Thanks in advance.

Edited by sunnyb0y (see edit history)
Link to comment
Share on other sites

I created a modification to meet my needs for the statsproduct module that may be close to what you are looking for. This provides a column listing each product with the quantity sold and another with quantity in stock. Attached is the statsproduct.php code that replaces the code in the \modules\statsproduct directory. You can use the date range selection of the native module. I commented the header of the file with the following changes.

 

/*

* 2007-2012 PrestaShop - taken from 1.5.3.1 source of statsproduct.php module

* Rhapsody added stats attributes, changed so customer name is displayed

* with customer id in table, added Sold column

* Rhapsody modified so only sold products are displayed in Product Detail Stats

statsproduct.php

Link to comment
Share on other sites

In the spanish forum was almost similar (if not equal) request .... http://www.prestasho...4#entry1335504.

The translated version: http://translate.goo...04#entry1335504

Thanks Enrique.

Wow that is similar and only days apart - the only difference with ours is that it's not in kilograms, just unit pricing (each, bunch etc). Perhaps we could "car pool" and split the costs of a custom module?

 

And at this moment there's no module (that I know about) that does that simple requirement.

Ah ok. Interesting, I would have thought units sold would be of interest to many shops. Thanks for investigatng and revitalising this thread Enrique.

Edited by sunnyb0y (see edit history)
Link to comment
Share on other sites

I created a modification to meet my needs for the statsproduct module that may be close to what you are looking for. This provides a column listing each product with the quantity sold and another with quantity in stock. Attached is the statsproduct.php code that replaces the code in the \modules\statsproduct directory. You can use the date range selection of the native module. I commented the header of the file with the following changes.

 

Thanks Rhapsody. That really is pretty close to what we need.

(I am looking in the "product details" link within the stats area after replacing with your file)

 

On screen the quantity "sold" column is visible and only products with sales are shown - but the csv export does not include the quantity "sold" column and all products in the shop are listed.

 

The columns in the exported csv are as follows:

ID (but no name for this column in the exported file), Ref., Name and Stock

 

+ Are you able to modify the file so that the sold column is included in the csv export?

 

It would be wonderful to also have on screen and in the export:

+ the stock column excluded (we are not carrying stock)

+ any options included as separate rows

+ only products with sales listed

 

eg

ID,Name,Option,Sold

7,apples,,9

5,olive oil,500ml,2

13,potatoes,,7

9,pumpkin,whole,3

9,pumpkin,quarter,1

 

Happy to pay for your time - please pm me with a quote if interested.

 

Regardless, thank you very much for sharing this code.

Edited by sunnyb0y (see edit history)
Link to comment
Share on other sites

The short answer is I can modify it, but since we're in the middle of sailing season I don't want to spend the time behind a desk :-)

 

Try this as a quick solution.

 

1. Open Excel, then switch the window to your PS BO

2. Display the product detail screen in the statsproduct module.

3. In the Products Available table, use your mouse to grab the data in the table, including the column names through the lower right data in the last row, then copy that

4. Switch window to Excel, then use "paste special", and paste as "unicode text"

5. Delete the columns you don't want.

 

This should give you what you desire.

  • Like 1
Link to comment
Share on other sites

Enrique - not a bad joke. I smiled! I am leaving work in 2 hours to go sailing and will spend the next week enjoying the sun and winds.

 

sunnyb0y - I am not a professional programmer and do not code efficiently, so may not be the best to program for your needs. My contributions on the forum are based on my PS experiences, modifying things over time to help 4 shops I've setup for volunteer / non-profit organizations, and getting help from others. Happy to help when I can, but I know my skill limits.

Link to comment
Share on other sites

The short answer is I can modify it, but since we're in the middle of sailing season I don't want to spend the time behind a desk :-)

 

Try this as a quick solution.

 

1. Open Excel, then switch the window to your PS BO

2. Display the product detail screen in the statsproduct module.

3. In the Products Available table, use your mouse to grab the data in the table, including the column names through the lower right data in the last row, then copy that

4. Switch window to Excel, then use "paste special", and paste as "unicode text"

5. Delete the columns you don't want.

 

This should give you what you desire.

 

Ha ha - sailing season, nice! I am a keen surfer so share your love of the sea and would choose hoisting sales over pushing pixels any day. And totally understand - thanks for sharing your mod.

 

I worked out the copy and paste trick, many thanks - the only thing is doen't give is product options which makes it tricky in our instance.

 

Thanks for your contribution and enjoy your sailing.

Link to comment
Share on other sites

What can be better than programming? :D :D :D

Sailing!!! (and surfing)

 

sunnyb0y - I am not a professional programmer and do not code efficiently, so may not be the best to program for your needs. My contributions on the forum are based on my PS experiences, modifying things over time to help 4 shops I've setup for volunteer / non-profit organizations, and getting help from others. Happy to help when I can, but I know my skill limits.

No problems and understood Rhapsody, I know my limitations too - and that starts with PrestaShop! Thanks again for your help - that's been a big step in the right direction for this query, almost there.

 

God speed and fair winds (isn't that what they say to sailors?)

Edited by sunnyb0y (see edit history)
Link to comment
Share on other sites

Solved.

 

"Enrique Gómez" made a great little module that does exactly what we need - it plugs into the PrestaShop stats section and outputs product sales reports in a specified period on screen and in csv format.

 

Where is that module? I really need it :D

Link to comment
Share on other sites

  • 2 years later...
  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...