Hello all !
I am trying to add field SKU in to the email which goes to the customer after the checkout. Basically field Model already avialable there, so my part is just to add additional field SKU.
So far I found file: webstore/catalog/model/checkout/order.php
Iside of it there is a part where we iserting in to the order_product table some info about the prouct.
I simply added there the following:
........................., sku = '" . $this->db->escape($product['sku']) . "'");
And of course I created 'sku' in the table.
My problem is that I can not find where $product['sku'] should be defined. In my case when customer check out now it does not insert anything in to the 'sku' field of the table. But as soon as I change 'sku' to for example 'model' like this:
sku = '" . $this->db->escape($product['model']) . "'");
it copies MODEL in to the new SKU field.
Please help me where, in which file (probably under Library folder) should I define $product['sku']. I understand that this SKU value should be copied from the product table, similar how it done with model field.
Thank you,
Vlad
I am trying to add field SKU in to the email which goes to the customer after the checkout. Basically field Model already avialable there, so my part is just to add additional field SKU.
So far I found file: webstore/catalog/model/checkout/order.php
Iside of it there is a part where we iserting in to the order_product table some info about the prouct.
I simply added there the following:
........................., sku = '" . $this->db->escape($product['sku']) . "'");
And of course I created 'sku' in the table.
My problem is that I can not find where $product['sku'] should be defined. In my case when customer check out now it does not insert anything in to the 'sku' field of the table. But as soon as I change 'sku' to for example 'model' like this:
sku = '" . $this->db->escape($product['model']) . "'");
it copies MODEL in to the new SKU field.
Please help me where, in which file (probably under Library folder) should I define $product['sku']. I understand that this SKU value should be copied from the product table, similar how it done with model field.
Thank you,
Vlad
or simply explain to me please what does it mean:
$this->db->escape($product['sku'])
I understand that there is localy decalred DB, it is under /system/library and it is described in db.php
But what about escape($product['sku']) ?
For example I understand that $product['model'] will return MODEL field of the product table.
How can I get SKU field of the product table ?
When I am trying to request like this -- $product['sku'] it returns nothing which means that I have somewhere to describe that field SKU should be requested from the DB.
Help me please.
$this->db->escape($product['sku'])
I understand that there is localy decalred DB, it is under /system/library and it is described in db.php
But what about escape($product['sku']) ?
For example I understand that $product['model'] will return MODEL field of the product table.
How can I get SKU field of the product table ?
When I am trying to request like this -- $product['sku'] it returns nothing which means that I have somewhere to describe that field SKU should be requested from the DB.
Help me please.
I assume you've entered a value for SKU in the product edit area?
If you want to add sku to the email you can do this:
1. EDIT: catalog/model/checkout/order.php
2. FIND:
'model' => $product['model'],
3. AFTER, ADD:
'sku' => $product['sku'],
4. EDIT: catalog/view/theme/default/template/mail/order_confirm.tpl
5. FIND:
6. REPLACE WITH:
If you want to add sku to the email you can do this:
1. EDIT: catalog/model/checkout/order.php
2. FIND:
'model' => $product['model'],
3. AFTER, ADD:
'sku' => $product['sku'],
4. EDIT: catalog/view/theme/default/template/mail/order_confirm.tpl
5. FIND:
Code: Select all
<td align="left"><?php echo $product['model']; ?></td>
Code: Select all
<td align="left"><?php echo $product['model']; ?><br/><?php echo $product['sku']; ?></td>
SKU value in the product area is entered.
I tried your suggestion but it came wit empty result
Basically what I did and what I understand:
3. AFTER, ADD:
'sku' => $product['sku'],
Here we just define SKU for template, BUT $product['sku'] is not defined, I mean it has no value at this point
6. REPLACE WITH:
Code: Select all
<td align="left"><?php echo $product['model']; ?><br/><?php echo $product['sku']; ?></td>
Here we just display the SKU value in the template, but again value SKU comes EMPTY due to the fact that in the order.php we did not assigned any value to this 'sku'.
Please tell me where should 'sku' be defined ? I am under 1.4.6
My SKU field is defined for each product inside the table: product
Thank you,
Vlad
I tried your suggestion but it came wit empty result
Basically what I did and what I understand:
3. AFTER, ADD:
'sku' => $product['sku'],
Here we just define SKU for template, BUT $product['sku'] is not defined, I mean it has no value at this point
6. REPLACE WITH:
Code: Select all
<td align="left"><?php echo $product['model']; ?><br/><?php echo $product['sku']; ?></td>
Here we just display the SKU value in the template, but again value SKU comes EMPTY due to the fact that in the order.php we did not assigned any value to this 'sku'.
Please tell me where should 'sku' be defined ? I am under 1.4.6
My SKU field is defined for each product inside the table: product
Thank you,
Vlad
ah, yea sorry.
try this. Leave the above changes
1. EDIT: catalog/model/checkout/order.php
2. FIND:
3. AFTER, ADD:
4. FIND:
5. REPLACE WITH:
try this. Leave the above changes
1. EDIT: catalog/model/checkout/order.php
2. FIND:
Code: Select all
$order_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_product_id = '" . (int)$product['order_product_id'] . "'");
Code: Select all
$order_product_info = $this->db->query("SELECT * FROM " . DB_PREFIX . "product WHERE product_id = '" . (int)$product['product_id'] . "'");
Code: Select all
'sku' => $product['sku'],
Code: Select all
'sku' => $order_product_info->row['sku'],
I found this thread during a search. I'd like to suggest that SKU's be included automatically in the catalogue and also in the notification emails. (Well, perhaps in the catalogue it should be optional.) Many retailers like their customers to identify products by their SKU's, so SKU's are not just an internal thing. In my case, I don't use SKU's. However, in the SKU field I intent to put the bin number where the product can be found, and I would like that bin number to appear in the notification emails (from which I'll be picking the orders). I haven't tried the fix above yet, but I will this evening.
Qphoria, I just want to say that I found TWO instances of the above code, and I added the additional code after both of them. Is that what I should have done? Or should I have added the additional code after just the first instance?Qphoria wrote: 1. EDIT: catalog/model/checkout/order.php
2. FIND:3. AFTER, ADD:Code: Select all
$order_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_product_id = '" . (int)$product['order_product_id'] . "'");
Code: Select all
$order_product_info = $this->db->query("SELECT * FROM " . DB_PREFIX . "product WHERE product_id = '" . (int)$product['product_id'] . "'");
Thanks Qphoria, this was very handy!
Google Analytics Expert - Advanced e-commerce tracking, Product & options reporting, transaction/conversion reporting, Google Adwords conversion & profit reporting, goal & funnel reporting, event tracking, site search tracking, multi-store compatibility, EU Cookie Law compliance and works with any theme or checkout! Easy vqmod install. Get it here
Who is online
Users browsing this forum: No registered users and 58 guests