Add a column to Sales View in Backend

  • Posts: 13201
  • Thank you received: 2322
9 years 9 months ago #188667

Hi,

Sorry but could you give back more details ?
Do you still have the same custom fields published ?
Were the modification done in an override ? And not directly in a view ?

You have maybe lost the code you implemented before.

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

  • Posts: 267
  • Thank you received: 5
9 years 9 months ago #188969

Hello Xavier and thanks,
I upgraded to HikaShop recently businnes, previously used HikaShop essencial 2.0.0.
We perform modifications with your help. To change the view of orders. We got the results will be shown as seen in the image below:




Once the update has disappeared field code corresponding to order_product_code.
I wish to appear again.
Currently the screen is as shown below.

Last edit: 9 years 9 months ago by dvddvd.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
9 years 9 months ago #189003

Hi,

It's normal.
You made some modifications in the listing view file and that modification has been kept after the update as it was done as a view override.
But you also made a modification to the view.html.php file of the order view and that modification will be lost each time you update:
www.hikashop.com/forum/4-how-to/53045-ad...n-backend.html#66633
So you'll have to reapply it each time.

The following user(s) said Thank You: dvddvd

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

  • Posts: 267
  • Thank you received: 5
9 years 9 months ago #189472

I followed all the steps in the previous time in view.html.php file. But the result is always the same, the column where it should go product code, is empty.

Thanks

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
9 years 9 months ago #189512

Hi,

Please provide screenshots of the changes you made so that we can see what you did.

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

  • Posts: 267
  • Thank you received: 5
9 years 9 months ago #189598

Hello Nicolas,
I followed the steps , this way
1.And add the line:


2.verify "order listing"

3. add ",d.*"

4. Add "d.order_product_code"


The result is the " product_code " column blank








thanks

Last edit: 9 years 9 months ago by dvddvd.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 9 months ago #189696

Hi,

In the screenshot 3 (and 4) I see a little problem because there is already a table in the query with the "d" alias ; and it's the address table.
So I don't understand how the query can work properly.
I think it should be better to use another alias for the table order_product.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: dvddvd

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

  • Posts: 267
  • Thank you received: 5
9 years 9 months ago #189709

Hello Jerome,
I have made ​​the following changes.

1.- modify d.* by e.*



2.- modify d.order_product_code by e.order_product_code



3.- result, all fields blank

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 9 months ago #189713

Hi,

You also need to modify the INNER JOIN where there is the alias on the table order_product.
But the best for you will be to activate the debug mode so you will see the SQL query error message and not see an empty result for the query error.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: dvddvd

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

  • Posts: 267
  • Thank you received: 5
9 years 9 months ago #189763

Hi Jerome ,

Thanks for your patience and your knowledge .
this is the error:
JDatabaseMySQL::query: 1051 - Unknown table 'f' SQL=SELECT a.*,b.*,c.*,f.*,IFNULL(c.name,CONCAT_WS(' ',d.address_firstname,d.address_middle_name,d.address_lastname)) AS hikashop_name FROM keap_hikashop_order AS b LEFT JOIN keap_hikashop_address AS d ON b.order_billing_address_id=d.address_id LEFT JOIN keap_hikashop_user AS a ON b.order_user_id=a.user_id LEFT JOIN keap_users AS c ON a.user_cms_id=c.id WHERE (b.order_type='sale') ORDER BY b.order_id desc LIMIT 0, 20

I placed the line:

$tables = ' INNER JOIN '.hikashop_table('order_product').' AS f ON b.order_id = f.order_id';

Just after:

$tables= ' '

And working properly. I do not know if it's the right solution.

Thank you so much, Jerome.

Last edit: 9 years 9 months ago by dvddvd. Reason: possible solution

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

  • Posts: 13201
  • Thank you received: 2322
9 years 9 months ago #189772

Hi,

It seems to be the correct solution.

The following user(s) said Thank You: dvddvd

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

  • Posts: 267
  • Thank you received: 5
7 years 9 months ago #263310

Hi Xavier,

When you upgrade Hikashop 3, this solution has stopped working correctly.
When selecting payment methods or statements, the result is not appropriate.

In payment methods, only results appear when you mark "all payment methods".
The rest goes blank.

In the case of status, they only appear in the case of enrollment (paid), as of the day of the update.
There are also results in reinstatement and in the waiting and waiting list.

In unrealized and accredited payment, they do not show results.

Is it possible to recover that functionality?

Best regards and thanks.

Attachments:
Last edit: 7 years 9 months ago by Jerome.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 9 months ago #263313

Hi,

I'm sorry but this thread is two pages long, more than 2 years old and hard to read.
Can you explain precisely what you modified where ?
Because the dropdowns work just fine on my end with HikaShop 3 without any modifications.
Please understand that this is custom coding. I'm happy to help a bit, but if I have to search for you for 2 hours just to give you a solution for something which isn't a bug but some customization you want on your end, that's outside user support.

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

  • Posts: 267
  • Thank you received: 5
7 years 9 months ago #263448

Hi Nicolas,

how I can replace the column "method of payment" for "product code" and that at the top:


echo $ this-> payment-> display ("filter_payment", $ this-> PageInfo-> filter-> filter_payment, false);


To output the filter by "Product Code" instead of "payment method".

My orders only have one product for each of them.

With the new version does not work the differentiator the sliding tabs as you can see in the attached image.

Of the previous post.

thanks

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 9 months ago #263453

Hi,

I am sorry but it would require a pretty big development.
You can't just put a dropdown filter like that ; you also need to create the corresponding code to read the filter value and modify dynamically the SQL query to do your filtering.

For the payment method, that's "easy" because the value is directly in the "order" table.
Now if you want to filter on the product code ; it will be much more complicated because it need to look in other tables.

So the best looks like to create a custom plugin to perform the addition of the filter and the modification of the SQL query.
www.hikashop.com/support/documentation/6...r-documentation.html

function onBeforeOrderListing($paramBase, &$extrafilters, &$pageInfo, &$filters, &$tables, &$searchMap) {}

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 267
  • Thank you received: 5
7 years 8 months ago #263630

Hi, Jerome

My partner has explained himself wrong. The changes that have been made in the panel are as follows:

- Added a column with the product code. As you can see in the following image.



- The top filter works properly.



The error happens when you select the payment method and the status on the sliders in the top right of the panel:



In the first case only appear: all forms of payment. The rest of the selections result in a blank page.



In the second case only appear:

- some results that are the post-upgrade in Enrollment.



- some results that are the ones after the update in Payment not realized.

- all results in reintegrated.



- all results on waiting list

- all the results in derelict

- all results in admission

- no results on requested

Thanks very much Jerome

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 8 months ago #263651

Hi,

I'm not sure if you mean that the problem you have come from your modifications you added for the support of the product_code, and thus you're asking how you should properly do the modifications to avoid that,
or if you're saying that even without your modifications you have that problem with the dropdowns at the top and yo'ure telling us that there is a bug.
If it's the first one, well it depends on how you did your modifications. Probably the problem is that the way the MySQL query has been changed is not correct when the filters of the dropdowns are added to it.

The following user(s) said Thank You: dvddvd

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

Time to create page: 0.157 seconds
Powered by Kunena Forum