- Posts: 6
- Thank you received: 2
Order notification: Show ALL product options, not only selected ones
- Typostudio_Buschbeck
-
Topic Author
- Offline
Less
More
4 years 1 week ago #345132
by Typostudio_Buschbeck
Order notification: Show ALL product options, not only selected ones was created by Typostudio_Buschbeck
-- HikaShop version -- : 4.6.1
-- Joomla version -- : 4.2.0
-- PHP version -- : 8.1.7
-- Browser(s) name and version -- : Chrome 104.0.5112.101
Dear HikaShop Team,
I want to make some changes in the "Preload-Email-Template" - but I'm missing the data I need to make my modifications and I hope you can give me a hint how to solve the problem.
The default source code is going through the ordered products and lists all the selected product options and characteristics. All UNSELECTED options/characteristics are not part of the collected data - but I need them because I want them to show, but greyed out.
I don't have problems to identify the source code row where I can add my changes, but I'm having problems to get the "not selected" checkboxes - of course because they are not part of the order (technically spoken).
Example:
I have a product with option "sauce" and four checkboxes for different sauces. If a customer is selecting 3 of the 4 checkboxes they will be shown in the order email. And now I want to add the missing checkbox "greyed out". But the fourth sauce is not part of any class/object/variable in the preload template.
How can I get these information?
Thanks in advance for your support and have a nice day
-- Joomla version -- : 4.2.0
-- PHP version -- : 8.1.7
-- Browser(s) name and version -- : Chrome 104.0.5112.101
Dear HikaShop Team,
I want to make some changes in the "Preload-Email-Template" - but I'm missing the data I need to make my modifications and I hope you can give me a hint how to solve the problem.
The default source code is going through the ordered products and lists all the selected product options and characteristics. All UNSELECTED options/characteristics are not part of the collected data - but I need them because I want them to show, but greyed out.
I don't have problems to identify the source code row where I can add my changes, but I'm having problems to get the "not selected" checkboxes - of course because they are not part of the order (technically spoken).
Example:
I have a product with option "sauce" and four checkboxes for different sauces. If a customer is selecting 3 of the 4 checkboxes they will be shown in the order email. And now I want to add the missing checkbox "greyed out". But the fourth sauce is not part of any class/object/variable in the preload template.
How can I get these information?
Thanks in advance for your support and have a nice day
Please Log in or Create an account to join the conversation.
4 years 1 week ago #345136
by nicolas
Replied by nicolas on topic Order notification: Show ALL product options, not only selected ones
Hi,
Indeed, that data is not available in the preload.
The line:
is displaying the name of the variant of the option.
So you probably want to add custom code around there to :
- load the data of the variant of the option from the hikashop_product table:
- load the data of the option from the hikashop_product table:
- load the data of the characteristics, values and variants of the option:
- then, in $option->variants you'll have an array of all the possible choices of $option and you can compare that with the variants available in the order to do the display.
Indeed, that data is not available in the preload.
The line:
Code:
$t .= '<p class="hikashop_order_option_name">' . $optionElement->order_product_name;
So you probably want to add custom code around there to :
- load the data of the variant of the option from the hikashop_product table:
Code:
$optionVariantSelected = $productClass->get($optionElement->product_id);
Code:
$option = $productClass->get($optionVariantSelected->product_parent_id);
Code:
$option = $productClass->loadProductVariants($option, array('user_id' => $data->cart->order_user_id, 'selected_variant_id' => $optionElement->product_id));
Please Log in or Create an account to join the conversation.
- Typostudio_Buschbeck
-
Topic Author
- Offline
Less
More
- Posts: 6
- Thank you received: 2
4 years 3 days ago #345351
by Typostudio_Buschbeck
Replied by Typostudio_Buschbeck on topic Order notification: Show ALL product options, not only selected ones
Hi Nicholas,
sorry for the late reply! I just want to thank you for your support. Your posted code helped me a lot to get what I wanted.
Thanks for the effort and you can close the topic
Best regards!
sorry for the late reply! I just want to thank you for your support. Your posted code helped me a lot to get what I wanted.
Thanks for the effort and you can close the topic
Best regards!
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
Time to create page: 0.173 seconds