News:

AbanteCart v1.4.2.1 is released.

Main Menu
support

sku problem

Started by ygalbrami, April 12, 2013, 07:22:25 AM

Previous topic - Next topic

ygalbrami

hello,
i need help,
when a buyer make an order - i get an email with all the detail of items he buy
i need in this email to see the sku, but i don't know how to do that

i have see that when buyer make an order it will post the order to the database in ab_order_products
now i have added a sku row and i have added
this line -  sku = '" . $this->db->escape($product['sku']) . "',
on the order.php file
but the sku don't send to the database and i really need any help.

thanks

abantecart

I assume you edit admin section. There is no array $product in order.php now. There is $this->data['products']
You can use echo_array($product); function to get content of the array.

ygalbrami

i need help to get the sku row that in ab_products table
so when i will press on the admin panel - sales - order and i will press on invoice i will see the sku in the rows of the products
i have try to insert some code in the order_invoice.tpl but no luck

can you please please help me?

thank you

abantecart

Please post the snippet of the code you try to edit.

ygalbrami

ok now it's work and i do it all by myself

on the file - order_confirm.tpl

i make some change.

before the line -- foreach ($products as $product) {

i have put this lines :

$connect_this = mysql_connect("sql_server", "user_name", "password") or die("error connect");
$mysql_db = mysql_select_db("my_db")or die("error db");
$get_orderid = $order['order_id'];

$select_ab_order_products = mysql_query ("SELECT * FROM ab_order_products INNER JOIN ab_products ON ab_order_products.product_id = ab_products.product_id WHERE ab_order_products.order_id='$order_id'") or die ("can't select");


and after this line: foreach ($products as $product) {
i put this line: $get_row_product_id = mysql_fetch_array ($select_ab_order_products);

and before that line : <td align="left"><?php echo $product'model' ]; ?></td>
i insert this to get the data:  <td align="left"><?php echo $get_row_product_id['sku']; ?></td>

and this work, when a buyers make an order i will see the sku of the items he buy.

and i did the same in the invoice file in admin panel (order_invoice.tpl)

but why this not come in the system? if i can't see the sku anywhere so for what is there?


   


abantecart

I do not understand the problem. Do you see SKU in product edit section?

FYI.
I suggest to use abantecart API to connect to database.

ygalbrami

I have need to see the sku when buyer make and order and to see it on invoice.

now i do it and i make some change

Forum Rules Code of conduct
AbanteCart.com 2010 -