Total products price

Phoca Cart - complex e-commerce extension
Zaydy
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 15 Oct 2019, 22:26

Total products price

Post by Zaydy » 15 Oct 2019, 23:24

Hi Team

How can I get total price and total original price? Either to be in control panel phoca cart interface or in the left menu column.

Any help in this?

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 41832
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Total products price

Post by Jan » 16 Oct 2019, 14:03

Hi, what do you exactly mean? Total is displayed in calculation but original price is not included in calculation, it is just "design" price to see what was the price previously in past.

Jan
If you find Phoca extensions useful, please support the project

Zaydy
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 15 Oct 2019, 22:26

Re: Total products price

Post by Zaydy » 16 Oct 2019, 20:04

Hi
In the control panel products list there is two columns: price and original price, is there a way around to sum up automatically price column to get total price of all products. Likewise to original price column.

Zaydy
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 15 Oct 2019, 22:26

Re: Total products price

Post by Zaydy » 20 Oct 2019, 23:46

Any advice on this

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 41832
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Total products price

Post by Jan » 21 Oct 2019, 12:44

Hi, there is no such option to counting all prices together to get total price of all products but if this is needed, some simple sql query can just return the sum of all price columns from database directly, something like this:

Code: Select all

select sum(price) from jos_phocacart_products where published = 1;
But still no idea what do you exactly mean with original price column. Such is not used in any calculation or statistics. Can you paste a screenshot what do you exactly mean?

Jan
If you find Phoca extensions useful, please support the project

Zaydy
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 15 Oct 2019, 22:26

Re: Total products price

Post by Zaydy » 24 Oct 2019, 11:47

Hi

There is button for attaching a screenshot in this forum.

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 41832
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Total products price

Post by Jan » 24 Oct 2019, 13:14

Hi, see phoca forum rules, just upload your image to imgur, copy the bb code from imgur and paste it here:
https://www.phoca.cz/documents/50-phoca ... forum-post

Jan
If you find Phoca extensions useful, please support the project

Zaydy
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 15 Oct 2019, 22:26

Re: Total products price

Post by Zaydy » 24 Oct 2019, 15:58


User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 41832
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Total products price

Post by Jan » 25 Oct 2019, 13:31

Hi, now I understand, so there is no such option and this needs to be customized.

The number you can get per SQL queries like this:

Code: Select all

select sum(price) from jos_phocacart_products where published = 1;
select sum(original_price) from jos_phocacart_products where published = 1;
So the number then should be loaded from database and pasted in the control panel view:
administrator\components\com_phocacart\views\phocacartcp\tmpl\default.php

Jan
If you find Phoca extensions useful, please support the project

Post Reply