PHP experts - Custom Field and Listing Orders
- unlockalicante
-
Topic Author
- Offline
Less
More
12 years 8 months ago - 12 years 8 months ago #139990
by unlockalicante
PHP experts - Custom Field and Listing Orders was created by unlockalicante
-- url of the page with the problem -- :
www.apli.movil-plus.com
-- HikaShop version -- : 2.0.0
-- Joomla version -- : 3.1.5
Good afternoon ,
Request help to display a custom field ( table "item" ) in the list of orders ( listing.php ) .
My PHP skills are scarce, manuals have searched the net and the most I 've gotten is to show the contents of the entire table in the list of orders, however, my only desire is to show the contents of the custom field based on logged user .
By using the following code:
The result in each row of the column shows ALL records shown in the screenshot , I just like to put the associated order number shown .
I hope someone help me with this problem took a long time and can not find solution.
Greetings and thanks in advance.
-- HikaShop version -- : 2.0.0
-- Joomla version -- : 3.1.5
Good afternoon ,
Request help to display a custom field ( table "item" ) in the list of orders ( listing.php ) .
My PHP skills are scarce, manuals have searched the net and the most I 've gotten is to show the contents of the entire table in the list of orders, however, my only desire is to show the contents of the custom field based on logged user .
By using the following code:
<?php
$conexion=mysql_connect("localhost","XXXXX","")
or die("Problemas en la conexion");
mysql_select_db("base1",$conexion)
or die("Problemas en la selección de la base de datos");
$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product",$conexion) or
die("Problemas en el select:".mysql_error());
while ($reg=mysql_fetch_array($registros))
{
echo $reg."<br>";
}
mysql_close($conexion)."<br>";
?>
$conexion=mysql_connect("localhost","XXXXX","")
or die("Problemas en la conexion");
mysql_select_db("base1",$conexion)
or die("Problemas en la selección de la base de datos");
$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product",$conexion) or
die("Problemas en el select:".mysql_error());
while ($reg=mysql_fetch_array($registros))
{
echo $reg."<br>";
}
mysql_close($conexion)."<br>";
?>
The result in each row of the column shows ALL records shown in the screenshot , I just like to put the associated order number shown .
I hope someone help me with this problem took a long time and can not find solution.
Greetings and thanks in advance.
Last edit: 12 years 8 months ago by unlockalicante.
Please Log in or Create an account to join the conversation.
12 years 8 months ago #140022
by nicolas
Replied by nicolas on topic PHP experts - Custom Field and Listing Orders
The line:
$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product",$conexion) or
die("Problemas en el select:".mysql_error());
is not correct.
You would need instead something like that:
$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product WHERE order_id="(int).$row->order_id,$conexion) or
die("Problemas en el select:".mysql_error());
$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product",$conexion) or
die("Problemas en el select:".mysql_error());
is not correct.
You would need instead something like that:
$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product WHERE order_id="(int).$row->order_id,$conexion) or
die("Problemas en el select:".mysql_error());
The following user(s) said Thank You: unlockalicante
Please Log in or Create an account to join the conversation.
- unlockalicante
-
Topic Author
- Offline
12 years 8 months ago #140027
by unlockalicante
Replied by unlockalicante on topic PHP experts - Custom Field and Listing Orders
Hi, thanks for the reply,
I changed the line you and not charge you indicate page is completely blank.
I changed the line you and not charge you indicate page is completely blank.
Please Log in or Create an account to join the conversation.
12 years 8 months ago #140055
by nicolas
Replied by nicolas on topic PHP experts - Custom Field and Listing Orders
Turn on the debug mode and error reporting options of the joomla configuration and try again. You should see an error message telling you what's wrong.
The following user(s) said Thank You: unlockalicante
Please Log in or Create an account to join the conversation.
- unlockalicante
-
Topic Author
- Offline
12 years 8 months ago #140071
by unlockalicante
Replied by unlockalicante on topic PHP experts - Custom Field and Listing Orders
Hi Nicolas,
This is the error:
Parse error: syntax error, unexpected T_INT_CAST in /hosting/www/movil-plus.com/apli/templates/rt_paradigm/html/com_hikashop/order/listing.php on line 143
And the line number 143:
$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product WHERE order_id="(int).$row->order_id,$conexion) or die("Problemas en el select:".mysql_error());
Thx
This is the error:
Parse error: syntax error, unexpected T_INT_CAST in /hosting/www/movil-plus.com/apli/templates/rt_paradigm/html/com_hikashop/order/listing.php on line 143
And the line number 143:
$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product WHERE order_id="(int).$row->order_id,$conexion) or die("Problemas en el select:".mysql_error());
Thx
Please Log in or Create an account to join the conversation.
12 years 8 months ago - 12 years 8 months ago #140076
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic PHP experts - Custom Field and Listing Orders
Hi,
Using the code tag is better for code display.
At this moment you will see that there was a point between the (int) and the $row->order_id.
Code fixed:
Regards,
Using the code tag is better for code display.
At this moment you will see that there was a point between the (int) and the $row->order_id.
Code fixed:
Code:
$registros=mysql_query("SELECT imei2 FROM jos_hikashop_order_product WHERE order_id=".(int)$row->order_id,$conexion) or die("Problemas en el select:".mysql_error());
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 12 years 8 months ago by Jerome.
The following user(s) said Thank You: unlockalicante
Please Log in or Create an account to join the conversation.
- unlockalicante
-
Topic Author
- Offline
12 years 8 months ago #140078
by unlockalicante
Replied by unlockalicante on topic PHP experts - Custom Field and Listing Orders
Perfect!!
Thank you!, This part was essential for my project.
Really, thanks for your attention and speed in the solution.
Thank you!, This part was essential for my project.
Really, thanks for your attention and speed in the solution.
Please Log in or Create an account to join the conversation.
Time to create page: 0.176 seconds