[Skip to main content](#vessel-content)

#   Question about the admin email..

##

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

8 years 6 months ago -  8 years 6 months ago [\#291275](#291275) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#291275 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")* was created by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")*

[ ![screenshotcartjj.jpg](/forum/attachment/43329) ](/forum/attachment/43329 "...shotcartjj.jpg")

-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.6
-- PHP version -- : 6.x.x

Hello,

I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that.
I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin.
Can you help?
The upload of files doesn't work at the moment the screenshot i have is only 140kb?

- [ ![screenshotcartjj.jpg](/forum/attachment/43329) ](/forum/attachment/43329 "...shotcartjj.jpg") [ ](/forum/attachment/43329?download=1 "...shotcartjj.jpg")

Last edit: 8 years 6 months ago by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile"). Reason: trying to the attachement in .. and succes.! :)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Philip](/forum/user/34318-philip "View Philip's Profile")**
- [![Philip's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34318_2015-11-18-2.png)](/forum/user/34318-philip "View Philip's Profile")
- [ Offline](/forum/user/34318-philip)

Less More

- Posts: 4820
- Thank you received: 654
-
-

8 years 6 months ago -  8 years 6 months ago [\#291292](#291292) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#291292 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Hello,

You can custom your Emails, for this :
- Go to **Main HikaShop Configuration** =&gt; **System** =&gt; **Emails**
- Then select your concerned Emails and click on the its name to edit it
- Here, you will be able to custom your Emails Display

image missing https://cdn.pbrd.co/images/HgoB2Rx.png

And, use the Help button to display **documentation** that will guide you to better understand the way to proceed your customization.
Hope this will help you.

Regards

Last edit: 8 years 6 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

8 years 6 months ago [\#291304](#291304) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#291304 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Hello i think you missunderstood me a little, how to customize the display is clear to me .. we also did customize the email.. see attachtement.  *This attachment is hidden for guests.
Please log in or register to see it.*

As you can see i am able to get the product category name next to the product from that particular category, how can i group the products by category and not as it is shown in the pdf.. the product are now on the list in the way that they have been put in the cart.

Do you have an idea??

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

8 years 6 months ago [\#291320](#291320) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#291320 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Hi,

Well, in the preload of the email, you need to add a new foreach on the products, before the one that already exists where you load the categories of each product, and reorder the products array based on these categories.
You can use such PHP function to sort the products array with a specific algorithm of your making:
[ www.php.net/manual/en/function.uasort.php](http://www.php.net/manual/en/function.uasort.php)
Once the products are in the order you want them in, the second foreach that is already there by default will display the products in your order.

Now, if you want to group them in different tables, that's also possible but more complex as you need to go through the templating of the email system. So you'll have to duplicate the LINEVAR tags and in fact the whole products listing table into several listings and have your preload add the products into different arrays of objects so that they can be displayed separately.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

8 years 6 months ago [\#291583](#291583) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#291583 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

To understand correctly, in the cart views i have made an array and foreach to get the products in category and together as shown in my first attachment of the cart (Winkelwagen) Can i use the same foreach to get the products to be shown in that particular way on the mail?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

8 years 6 months ago [\#291584](#291584) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#291584 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Hi,

The variables in the preload and the variables in the cart view are not the same and not with the same name. So you can use the exact same code.
However, you can use roughly the same code, by adapting it to the situation.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

8 years 6 months ago -  8 years 6 months ago [\#291658](#291658) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#291658 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Hello,

As you can see in the pdf i sent earlier i managed to get the category name in the email.. But had to that with this code .. Code:

//$jsonItem = json_encode($item-&gt;order_product_id); $con = mysqli_connect('localhost', 'janjongerius_mvdmbp', '3F0S3e^tq2Ql', 'janjongerius_JO45BP', 3306); $query_product = mysqli_query($con,"SELECT * FROM pa8ju_hikashop_product_category WHERE product_id = ".$item-&gt;product_id." LIMIT 1"); while($run_query_product = mysqli_fetch_array($query_product)){ $product_Category = $run_query_product['category_id']; } $query_category = mysqli_query($con,"SELECT * FROM pa8ju_hikashop_category WHERE category_id = ".$product_Category." LIMIT 1"); while($run_query_category = mysqli_fetch_array($query_category)){ $product_Category_name = $run_query_category['category_name']; asort($product_Category_name); } ?&gt; &lt;?php $unit_category = $item-&gt;order_product_category; $cartProduct['PRODUCT_CATEGORY'] = $product_Category_name;

Had to query the database because where the preload gets his data from is no database table..
But how can i sort this one ?? i am still struggling..
Or when i sent you the code i use in the cart view is it possible then that you can help me with the right variables?

THanks.
Mark

Last edit: 8 years 6 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile"). Reason: add code tags for better readability.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

8 years 6 months ago [\#291665](#291665) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#291665 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

As I said, you need to have a first foreach where you do the sorting on top of the foreach which already exists...
You can't put all your code in the foreach already there since you can't sort an array that's already being processed.
So you need something like that: Code:

//an array where you'll have the products being sorted $sortingArray = array(); foreach($data-&gt;cart-&gt;products as $item) { // your code to load the category name // .... $sortingArray[$product_Category_name] = $item; } // sort the whole array based on the category name ksort($sortingArray); // replace the array of products by your sorted array $data-&gt;cart-&gt;products = $sortingArray; // then, the normal foreach of the preload which uses the data of the products. // ...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

8 years 6 months ago -  8 years 6 months ago [\#291804](#291804) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#291804 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Struggling a bit with the array to sort.. i now got this: Code:

//an array where you'll have the products being sorted $sortingArray = array(); foreach($data-&gt;cart-&gt;products as $item) { $sortingArray[] = array("name"=&gt;"$productCategory-&gt;category_name","id"=&gt;"$productCategory-&gt;category_id.", "productInCategory"=&gt; $productCategory-&gt;product_id); $sortingArray[$product_Category_name] = $item; } // sort the whole array based on the category name ksort($sortingArray); // replace the array of products by your sorted array $data-&gt;cart-&gt;products = $sortingArray; //End of sortingarray

But when i want to put my code into this array to sort it as in the cart..
This peace of code is the one i use in the cart.. Code:

$categoryArray = array(); $previousCategoryName = ""; $productInCategory = ""; foreach($this-&gt;cart-&gt;products as $opt_p =&gt; $product) { foreach($product-&gt;categories as $opt_k =&gt; $productCategory) { $categoryArray[] = array("name"=&gt;"$productCategory-&gt;category_name","id"=&gt;"$productCategory-&gt;category_id.", "productInCategory"=&gt; $productCategory-&gt;product_id); } } asort($categoryArray); //print_r($categoryArray); foreach($categoryArray as $index =&gt; $data) { //print_r($data); foreach($data as $index2 =&gt; $data2) { if($index2 == 'name'){ $categoryName = $data2; } if($index2 == 'id'){ $categoryID = $data2; } if($index2 == 'productInCategory'){ $productInCategory = $data2; } } if ($categoryName != $previousCategoryName) { ?&gt; &lt;tr&gt;&lt;td&gt;&lt;?php echo $categoryName; ?&gt;&lt;/td&gt;&lt;/tr&gt; &lt;?php } $previousCategoryName = $categoryName; foreach($this-&gt;cart-&gt;products as $k =&gt; $product) { if ($product-&gt;product_id == $productInCategory) { $cart_product = $this-&gt;cart-&gt;cart_products[$opt_p];

But with the array now i only get this on the mail see pdf.

*This attachment is hidden for guests.
Please log in or register to see it.*

Last edit: 8 years 6 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

8 years 6 months ago [\#291815](#291815) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#291815 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Hi,

Please use the code tags in your messages, otherwise, it's much harder to read...

In your first piece of code, you've added the code: Code:

$sortingArray[] = array("name"=&gt;"$productCategory-&gt;category_name","id"=&gt;"$productCategory-&gt;category_id.", "productInCategory"=&gt; $productCategory-&gt;product_id);

where I said that you should load the product category name. I don't know what this code is about but it's not what I said you should do.
First, the $productCategory variable doesn't exist yet.
Second, you already had the code: Code:

$con = mysqli_connect('localhost', 'janjongerius_mvdmbp', '3F0S3e^tq2Ql', 'janjongerius_JO45BP', 3306); $query_product = mysqli_query($con,"SELECT * FROM pa8ju_hikashop_product_category WHERE product_id = ".$item-&gt;product_id." LIMIT 1"); while($run_query_product = mysqli_fetch_array($query_product)){ $product_Category = $run_query_product['category_id']; } $query_category = mysqli_query($con,"SELECT * FROM pa8ju_hikashop_category WHERE category_id = ".$product_Category." LIMIT 1"); while($run_query_category = mysqli_fetch_array($query_category)){ $product_Category_name = $run_query_category['category_name']; }

So if you replace my comment by that code, you should have then the products properly sorted $data-&gt;cart-&gt;products and you can just leave the standard way of displaying the products after that, as I wrote my my previous message.
So I don't understand what you're trying to do in the second piece of code.

Finally, please understand that this is a user support forum. I'm already going way beyond what I'm supposed to do here to help you.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

8 years 6 months ago [\#292080](#292080) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#292080 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Thanks for you answer. I understand that this is a support forum.
I will try to load the category name with a foreach as you said.
In the second peace of my precious message i had put the code i use in the checkout to get he category name and sort it ..
it does not seem to work. Thanks for so far on this support..
I think i can find the way to load the product category name.

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

8 years 5 months ago [\#292642](#292642) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#292642 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Unfortnatly i can not figure it out.
The only way to get the category names in the email is what is did in my second peace of code which you did not understand
This peace of code: Code:

$con = mysqli_connect('localhost', 'janjongerius_mvdmbp', '3F0S3e^tq2Ql', 'janjongerius_JO45BP', 3306); $query_product = mysqli_query($con,"SELECT * FROM pa8ju_hikashop_product_category WHERE product_id = ".$item-&gt;product_id." LIMIT 1"); while($run_query_product = mysqli_fetch_array($query_product)){ $product_Category = $run_query_product['category_id']; } $query_category = mysqli_query($con,"SELECT * FROM pa8ju_hikashop_category WHERE category_id = ".$product_Category." LIMIT 1"); while($run_query_category = mysqli_fetch_array($query_category)){ $product_Category_name = $run_query_category['category_name']; } ?&gt; &lt;?php $cartProduct['PRODUCT_CATEGORY'] = $product_Category_name;

But i can not get sorted then on category.
So how does the foreach work then?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

8 years 5 months ago [\#292644](#292644) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#292644 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Hi,

It should be easy will all the pointers I already gave.
You just have to replace that line of code: Code:

foreach($data-&gt;cart-&gt;products as $item) {

with that code: Code:

//an array where you'll have the products being sorted $sortingArray = array(); foreach($data-&gt;cart-&gt;products as $item) { // your code to load the category name $con = mysqli_connect('localhost', 'janjongerius_mvdmbp', '3F0S3e^tq2Ql', 'janjongerius_JO45BP', 3306); $query_product = mysqli_query($con,"SELECT * FROM pa8ju_hikashop_product_category WHERE product_id = ".$item-&gt;product_id." LIMIT 1"); while($run_query_product = mysqli_fetch_array($query_product)){ $product_Category = $run_query_product['category_id']; } $query_category = mysqli_query($con,"SELECT * FROM pa8ju_hikashop_category WHERE category_id = ".$product_Category." LIMIT 1"); while($run_query_category = mysqli_fetch_array($query_category)){ $product_Category_name = $run_query_category['category_name']; $sortingArray[$product_Category_name] = $item; } } // sort the whole array based on the category name ksort($sortingArray); // replace the array of products by your sorted array $data-&gt;cart-&gt;products = $sortingArray; // then, the normal foreach of the preload which uses the data of the products. foreach($data-&gt;cart-&gt;products as $item) {

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

8 years 4 months ago [\#293544](#293544) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#293544 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Hi,

I followed all off your pointers. And the category names are being sorted. But I only got now 1 issue left.. If i have mutliple products from one category it will only show 1 product from that category. But i can not figure out why?
Is it because of this? Code:

$sortingArray[$product_Category_name] = $item;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

8 years 4 months ago [\#293545](#293545) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#293545 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Hi,

Yes. it's because of that line.

The simplest is to change that line to: Code:

$sortingArray[$product_Category_name.'_'.$item-&gt;order_product_id] = $item;

The following user(s) said Thank You: [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")**
- [![BluepointWebdesign's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile") Topic Author
- [ Offline](/forum/user/34929-bluepointwebdesign)

Less More

- Posts: 424
- Thank you received: 11
-
-

8 years 4 months ago [\#293594](#293594) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[Question about the admin email..](/forum/32-content-creation/894433-question-about-the-admin-email#293594 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 6.x.x  Hello,  I would like that the products are shown in the email in the same way as in the view of the cart. How can i do that. I made some modifications in the cart so that the products are grouped on category with category name.. See attachment. I would like to know how i can change the admin email so i will have the same look in the email that is send to the admin. Can you help? The upload of files doesn't work at the moment the screenshot i have is only 140kb?")*

Thanks, It works super now! ![:)](/media/kunena/emoticons/3.png ":)")
I am verry happy

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODk0NDMzLXF1ZXN0aW9uLWFib3V0LXRoZS1hZG1pbi1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.263 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
