AbanteCart Community

Shopping Cart Operations => Support => General Support => Topic started by: ygalbrami on April 12, 2013, 07:22:25 AM

Title: sku problem
Post by: ygalbrami on April 12, 2013, 07:22:25 AM
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
Title: Re: sku problem
Post by: abantecart on April 16, 2013, 06:35:04 AM
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.
Title: Re: sku problem
Post by: ygalbrami on April 16, 2013, 07:53:51 AM
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
Title: Re: sku problem
Post by: abantecart on April 16, 2013, 11:54:59 AM
Please post the snippet of the code you try to edit.
Title: Re: sku problem
Post by: ygalbrami on April 17, 2013, 02:27:27 PM
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?


   

Title: Re: sku problem
Post by: abantecart on April 18, 2013, 07:23:22 AM
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.
Title: Re: sku problem
Post by: ygalbrami on April 19, 2013, 04:17:18 AM
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