Display Product Custom Field in Order Backend View

  • Posts: 18
  • Thank you received: 0
12 years 2 weeks ago #72346

When you click on an order in the backend, we would like the Product List to show our product ID's that are a custom field. How can we customize that? We have the Business Edition.

Thanks.

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

  • Posts: 82795
  • Thank you received: 13353
  • MODERATOR
12 years 2 weeks ago #72580

You will have to edit the file "form" of the view "order" of your backend template via the menu Display->Views and add such code:
<?php $class = hikashop_get('class.product');
$productData = $class->get($product->product_id);
echo $productData->CUSTOM_FIELD_COLUMN_NAME;
?>

before the line:
<p class="hikashop_order_product_custom_item_fields">

The following user(s) said Thank You: Robertson

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

  • Posts: 241
  • Thank you received: 5
11 years 9 months ago #88016

Is there a easy way to display the product name in the Order backend view?

Seems like I could filter or sort my orders by their associated product... guessing it is in there somewhere.

Thanks.

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

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

Hi,

It's actually not possible to filter orders by products by default in HikaShop.
Many changes are required to display the products in the order listing, or to filter by products.

We have on our TODO list a thing to develop which will allow to display everything with many filters and apply different actions on it.

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

  • Posts: 241
  • Thank you received: 5
11 years 9 months ago #88105

Ok. I am a little confused as to how I can see who ordered what if I only have a list of the names with no product along side them.

Please advise.

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

  • Posts: 241
  • Thank you received: 5
11 years 9 months ago #88159

Your product is awesome but this one leaves me scratching my head.

How do i answer the question from a boss of "who bought x"? or a customer calling in to say "I think I bought x, can you check?" ?

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

  • Posts: 82795
  • Thank you received: 13353
  • MODERATOR
11 years 9 months ago #88261

Hi,

As Xavier said we'll develop a feature to be able to get such data easily.
Until then if you want to get a list of user names of who bought a product, you can run the SQL query below via phpmyadmin :

SELECT d.name,d.username,d.email FROM #__hikashop_order_product AS a LEFT JOIN #__hikashop_order AS b ON a.order_id=b.order_id LEFT JOIN #__hikashop_user AS c ON b.order_user_id=c.user_id LEFT JOIN #__users AS d ON c.user_cms_id=d.id WHERE a.product_id=XXX ORDER BY b.order_created;
You need to replace XXX by the id of the product and #__ by the prefix of your tables.

Last edit: 11 years 9 months ago by nicolas.
The following user(s) said Thank You: cberry1971

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

  • Posts: 241
  • Thank you received: 5
11 years 9 months ago #88314

Thank you very much. I need a little change.

For a given product, I need user_cms_id of users who have ordered ALL products (parent and child products) where product_alias = XXX (from hikashop_product).

That is where I need the help.

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

  • Posts: 82795
  • Thank you received: 13353
  • MODERATOR
11 years 9 months ago #88462

Hi,

Here it is:

SELECT c.user_cms_id FROM #__hikashop_product AS alpha LEFT JOIN #__hikashop_product AS beta ON alpha.product_id=beta.product_parent_id #__hikashop_order_product AS a ON beta.product_id=a.product_id LEFT JOIN #__hikashop_order AS b ON a.order_id=b.order_id LEFT JOIN #__hikashop_user AS c ON b.order_user_id=c.user_id WHERE alpha.product_alias=XXX ORDER BY b.order_created;
You can't buy a main product which has variants. So that gives all the users who purchased one of the child products of the product with the alias XXX.

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

  • Posts: 73
  • Thank you received: 2
11 years 7 months ago #95363

Hi, regarding this issue, I was wondering if I can edit the back end order view; under the Product List block, basically removing the double spacing of my custom fields and vertical align top the last 4 columns. see attached. Just want a more compressed view.

thanks

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #95414

Hi,

Yes you can edit this view in Display > Views, backend template.
And if you have errors when editing, you can still delete the modifications by clicking on the dustbin in the views listing.

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

  • Posts: 73
  • Thank you received: 2
11 years 7 months ago #95483

Thanks Xaviar but kindly tell me which back end view (i'm using bluestork) I was able to fix my backend invoice and shipping view but I've can't find the one for the screenshot submitted earlier. this the view when I select a specific order from order tab in the backend.

thank you.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #95569

The view to edit is "order / form".

The following user(s) said Thank You: aheng5

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

  • Posts: 73
  • Thank you received: 2
11 years 7 months ago #95653

Success. Finally found your file under blue stork template rather than my template. All works the way I want. Thank you.

Attachments:
Last edit: 11 years 7 months ago by aheng5. Reason: my error in finding the file

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

Time to create page: 0.109 seconds
Powered by Kunena Forum