Hello,
is there any way that orders products in orders page (admin) can be as link, I mean that orders products linked to product_info page or to product preview page (admin)
thank you in advance for your help
Omar
products links (orders.php)
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: products links (orders.php)
It would be a core edit, but change https://github.com/CE-PhoenixCart/Phoen ... s/edit.php to add the link.
-
Omar_one
- Senior Contributor
- Posts: 679
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: products links (orders.php)
I meant without editing the coreecartz wrote: ↑Thu Aug 25, 2022 12:04 pm It would be a core edit, but change https://github.com/CE-PhoenixCart/Phoen ... s/edit.php to add the link.
-
Omar_one
- Senior Contributor
- Posts: 679
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: products links (orders.php)
I got working by change the line 95
ecartz wrote: ↑Thu Aug 25, 2022 12:04 pm It would be a core edit, but change https://github.com/CE-PhoenixCart/Phoen ... s/edit.php to add the link.
-
raiwa
- Certified Developer
- Posts: 1640
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Has thanked: 70 times
- Been thanked: 152 times
Re: products links (orders.php)
Enhance Orders has this and more without core changes
https://phoenixcart.org/forum/app.php/ ... nce_orders
https://phoenixcart.org/forum/app.php/ ... nce_orders
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
Omar_one
- Senior Contributor
- Posts: 679
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: products links (orders.php)
Thank you @raiwa for your suggestions, but your module didn't say anything about the products link on the orders(admin)raiwa wrote: ↑Tue Sep 13, 2022 11:20 am Enhance Orders has this and more without core changes
https://phoenixcart.org/forum/app.php/ ... nce_orders
-
raiwa
- Certified Developer
- Posts: 1640
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Has thanked: 70 times
- Been thanked: 152 times
Re: products links (orders.php)
Sorry, you are right. My confusion. I thought you were talking about the customers account order_history_info.php
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
Omar_one
- Senior Contributor
- Posts: 679
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Re: products links (orders.php)
Maybe this could be helpful:
Note:
-This is written quickly in my attempt to learn more JS
-There are things that are specific for our needs here and I will probably revise many things at some point
-instead of adding to the JS for every product, it may be worth creating the links as php-arrays and put them into JS-arrays and then make a JS-loop on the products that adds the link.
//Daniel
Code: Select all
<?php
class hook_admin_orders_productLink {
function listen_injectSiteEnd(){
global $order;
if(!empty($order)){
$js = '';
$counter = 0;
foreach ($order->products as $product) {
$text = '[' . str_pad($product['id'], 5, '0', STR_PAD_LEFT) . ']';
$link = $GLOBALS['Admin']->catalog('product_info.php', ['products_id' => $product['id']]);
$js .= <<<EOS
<script>
var productsTable = document.getElementById("section_products_content");
var tableBody = productsTable.getElementsByTagName("tbody")[0];
var products = tableBody.getElementsByTagName("tr");
products[{$counter}].getElementsByTagName("td")[0].innerHTML += " <a class='badge badge-primary badge-pill' target=blank href=" + "{$link}" + ">" + "{$text}" + "</a>";
</script>
EOS;
$counter ++;
}
return $js;
}
}
}-This is written quickly in my attempt to learn more JS
-There are things that are specific for our needs here and I will probably revise many things at some point
-instead of adding to the JS for every product, it may be worth creating the links as php-arrays and put them into JS-arrays and then make a JS-loop on the products that adds the link.
//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide