Skip to main content

Error after editing report

More
11 years 3 months ago - 11 years 3 months ago #203797 by ijsbaanleuven
-- url of the page with the problem -- : www.ijsbaanleuven.be
-- HikaShop version -- : 2.4.1
-- Joomla version -- : 3.4.1
-- Error-message(debug-mod must be tuned on) -- : 1066 Not unique table/alias: 'p' SQL=SELECT *, p.product_hit as Total, COUNT(a.order_id) AS quantity FROM so2_hikashop_order_product AS prod LEFT JOIN so2_hikashop_order AS a on a.order_id=prod.order_id LEFT JOIN so2_hikashop_product AS p ON prod.product_id = p.product_id LEFT JOIN so2_hikashop_product_category AS cat ON cat.product_id = p.product_id OR cat.product_id=p.product_parent_id LEFT JOIN so2_hikashop_category AS categ ON cat.category_id = categ.category_id LEFT JOIN so2_hikashop_product AS p ON p.product_id=prod.product_id WHERE a.order_type='sale' AND cat.category_id IN ('43','46','45','44') AND a.order_created > 1430832408 AND a.order_created

Gentlmen,


I was editing a report, and when I hit save, I got this error.


All help would be gratefully accepted !!


BR,

Joris
Last edit: 11 years 3 months ago by ijsbaanleuven. Reason: not urgent anymore :-)

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #203807 by Xavier
Replied by Xavier on topic Error after editing report
Hi,

In the file "administrator/components/com_hikashop/classes/widget.php", function "data()" please replace the code:
Code:
$leftjoin['product'] = ' LEFT JOIN '.hikashop_table('product').' AS p ON prod.product_id = p.product_id '; $leftjoin['product_category'] = ' LEFT JOIN '.hikashop_table('product_category').' AS cat ON cat.product_id = p.product_id OR cat.product_id=p.product_parent_id'; if($widget->widget_params->category_childs){
By:
Code:
if(!isset($leftjoin['product'])) $leftjoin['product'] = ' LEFT JOIN '.hikashop_table('product').' AS p ON prod.product_id = p.product_id '; $leftjoin['product_category'] = ' LEFT JOIN '.hikashop_table('product_category').' AS cat ON cat.product_id = p.product_id OR cat.product_id=p.product_parent_id'; if($widget->widget_params->category_childs){

If that don't solve the issue, please give us a screenshot of you report settings in order to reproduce the issue on our end.

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #203869 by ijsbaanleuven
Hi !

Replaced the code, but no change.
Like I said before, I cannot reproduce the settings, as I cannot enter the report.

If I am correct, the following settings in the report should give me the number of sales per product in orders that are confirmed, in the category patches, in the period between may 1st up to today ?

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #203873 by nicolas
Replied by nicolas on topic Error after editing report
Hi,

Instead of the code change given by Xavier, add the line:
if(strpos($leftjoin,'hikashop_product AS p ON ')===false)
just before the line:
$leftjoin.=' LEFT JOIN '.hikashop_table('product').' AS p ON p.product_id=prod.product_id ';
in that same file. That should fix the problem.
The following user(s) said Thank You: ijsbaanleuven

Please Log in or Create an account to join the conversation.

Time to create page: 0.139 seconds
Powered by Kunena Forum