- Posts: 424
- Thank you received: 11
Question about the admin email..
- BluepointWebdesign
-
Topic Author
- Offline
-- 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?
Please Log in or Create an account to join the conversation.
You can custom your Emails, for this :
- Go to Main HikaShop Configuration => System => 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
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
Please Log in or Create an account to join the conversation.
- BluepointWebdesign
-
Topic Author
- Offline
- Posts: 424
- Thank you received: 11
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 or Create an account to join the conversation.
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
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 or Create an account to join the conversation.
- BluepointWebdesign
-
Topic Author
- Offline
- Posts: 424
- Thank you received: 11
Please Log in or Create an account to join the conversation.
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 or Create an account to join the conversation.
- BluepointWebdesign
-
Topic Author
- Offline
- Posts: 424
- Thank you received: 11
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 ..
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
Please Log in or Create an account to join the conversation.
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:
Please Log in or Create an account to join the conversation.
- BluepointWebdesign
-
Topic Author
- Offline
- Posts: 424
- Thank you received: 11
This peace of code is the one i use in the cart..
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
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:
First, the $productCategory variable doesn't exist yet.
Second, you already had the code:
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 or Create an account to join the conversation.
- BluepointWebdesign
-
Topic Author
- Offline
- Posts: 424
- Thank you received: 11
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 or Create an account to join the conversation.
- BluepointWebdesign
-
Topic Author
- Offline
- Posts: 424
- Thank you received: 11
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:
So how does the foreach work then?
Please Log in or Create an account to join the conversation.
It should be easy will all the pointers I already gave.
You just have to replace that line of code:
Please Log in or Create an account to join the conversation.
- BluepointWebdesign
-
Topic Author
- Offline
- Posts: 424
- Thank you received: 11
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?
Please Log in or Create an account to join the conversation.
Yes. it's because of that line.
The simplest is to change that line to:
Please Log in or Create an account to join the conversation.
- BluepointWebdesign
-
Topic Author
- Offline
- Posts: 424
- Thank you received: 11
I am verry happy
Please Log in or Create an account to join the conversation.