Source? Forum rules.I did this in version 2.3.0.2
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
find all instances of:
Code: Select all
foreach ($products as $product) {
Code: Select all
$this->load->model('catalog/product');
Code: Select all
foreach ($products as $product) {
Code: Select all
$product_info = $this->model_catalog_product->getProduct($product['product_id']);
Code: Select all
'model' => $product['model'],
Code: Select all
'mpn' => $product_info['mpn'],
find:
Code: Select all
$_['column_model'] = 'Model';
Code: Select all
$_['column_mpn'] = 'MPN';
find:
Code: Select all
<td class="text-left">{{ column_model }}</td>
Code: Select all
<td class="text-left">{{ column_mpn }}</td>
Code: Select all
<td class="text-left">{{ order_product.mpn }}</td>
Then, find:
Code: Select all
<td class="text-center" colspan="X">{{ text_no_results }}</td>
In catalog/controller/api/order.php file,
find all instances of:
Code: Select all
foreach ($this->cart->getProducts() as $product) {
Code: Select all
$this->load->model('catalog/product');
Code: Select all
foreach ($this->cart->getProducts() as $product) {
Then, find all instances of:
Code: Select all
'model' => $product['model'],
Code: Select all
'mpn' => $product['mpn'],
find:
Code: Select all
$data['text_model'] = $language->get('text_model');
Code: Select all
$data['text_mpn'] = $language->get('text_mpn');
Code: Select all
foreach ($order_products as $order_product) {
Code: Select all
$this->load->model('catalog/product');
Code: Select all
foreach ($order_products as $order_product) {
Code: Select all
$product_info = $this->model_catalog_product->getProduct($order_product['product_id']);
Code: Select all
'model' => $order_product['model'],
Code: Select all
'mpn' => $product_info['mpn'],
find:
Code: Select all
$_['text_model'] = 'Model';
Code: Select all
$_['text_mpn'] = 'MPN';
find all instances of:
Code: Select all
<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; background-color: #EFEFEF; font-weight: bold; text-align: left; padding: 7px; color: #222222;">{{ text_model }}</td>
Code: Select all
<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; background-color: #EFEFEF; font-weight: bold; text-align: left; padding: 7px; color: #222222;">{{ text_mpn }}</td>
Code: Select all
<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: left; padding: 7px;">{{ product.model }}</td>
Code: Select all
<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: left; padding: 7px;">{{ product.mpn }}</td>
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
LE. You are programmer..
I am a hardware guy...
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
If you are the hardware guy, then since Opencart is not a hardware, different development have been defined.I am a hardware guy...
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dear,straightlight wrote: ↑Mon Aug 06, 2018 8:13 pmIt is quite easy to change, indeed. In admin/controller/sale/order.php file,
find all instances of:
add above each:Code: Select all
foreach ($products as $product) {
Then, below each instances of:Code: Select all
$this->load->model('catalog/product');
add below each:Code: Select all
foreach ($products as $product) {
Then, find all instances of:Code: Select all
$product_info = $this->model_catalog_product->getProduct($product['product_id']);
add below each:Code: Select all
'model' => $product['model'],
Then, in your admin/language/en-gb/sale/order_form.php file,Code: Select all
'mpn' => $product_info['mpn'],
find:
add below:Code: Select all
$_['column_model'] = 'Model';
Then, in your admin/view/template/sale/order_form.twig file,Code: Select all
$_['column_mpn'] = 'MPN';
find:
add below:Code: Select all
<td class="text-left">{{ column_model }}</td>
Then, find:Code: Select all
<td class="text-left">{{ column_mpn }}</td>
Code: Select all
<td class="text-left">{{ order_product.mpn }}</td>
Then, find:
Increment the X value that you see by 1.Code: Select all
<td class="text-center" colspan="X">{{ text_no_results }}</td>
In catalog/controller/api/order.php file,
find all instances of:
add above each:Code: Select all
foreach ($this->cart->getProducts() as $product) {
Then, below all instances of:Code: Select all
$this->load->model('catalog/product');
$product_info = $this->model_catalog_product->getProduct($product['product_id']);Code: Select all
foreach ($this->cart->getProducts() as $product) {
Then, find all instances of:
add below each:Code: Select all
'model' => $product['model'],
Then, in catalog/controller/mail/order.php file,Code: Select all
'mpn' => $product['mpn'],
find:
add below:Code: Select all
$data['text_model'] = $language->get('text_model');
Then, find all instances of:Code: Select all
$data['text_mpn'] = $language->get('text_mpn');
add above each:Code: Select all
foreach ($order_products as $order_product) {
Then, below all instances of:Code: Select all
$this->load->model('catalog/product');
add:Code: Select all
foreach ($order_products as $order_product) {
Then, find all instances of:Code: Select all
$product_info = $this->model_catalog_product->getProduct($order_product['product_id']);
add below each:Code: Select all
'model' => $order_product['model'],
Then, in catalog/language/en-gb/mail/order_add.php file,Code: Select all
'mpn' => $product_info['mpn'],
find:
add below:Code: Select all
$_['text_model'] = 'Model';
In catalog/view/theme/<your_theme>/template/mail/order_add , edit and alert.twig file (if applied),Code: Select all
$_['text_mpn'] = 'MPN';
find all instances of:
add below each:Code: Select all
<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; background-color: #EFEFEF; font-weight: bold; text-align: left; padding: 7px; color: #222222;">{{ text_model }}</td>
Then, still on each of these TWIG files, find (if applied):Code: Select all
<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; background-color: #EFEFEF; font-weight: bold; text-align: left; padding: 7px; color: #222222;">{{ text_mpn }}</td>
add below each:Code: Select all
<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: left; padding: 7px;">{{ product.model }}</td>
This should resolved the issue.Code: Select all
<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: left; padding: 7px;">{{ product.mpn }}</td>
I can't find this code in my file :
Code: Select all
<td class="text-left">{{ order_product.mpn }}</td>
Then, find:
Code: Select all
<td class="text-center" colspan="X">{{ text_no_results }}</td>
Yes, but still wanna try to help...for freestraightlight wrote: ↑Tue Aug 07, 2018 1:13 amIf you are the hardware guy, then since Opencart is not a hardware, different development have been defined.
@dun7ill
You want MPN on order info (extension and code posted), or MPN on order received on mail?
Code posted by @straightlight
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
WOW! it's work fine.xxvirusxx wrote: ↑Wed Aug 08, 2018 6:15 pmYes, but still wanna try to help...for freestraightlight wrote: ↑Tue Aug 07, 2018 1:13 amIf you are the hardware guy, then since Opencart is not a hardware, different development have been defined.
@dun7ill
You want MPN on order info (extension and code posted), or MPN on order received on mail?
Code posted by @straightlight
Yes I need to show MPN only in admin panel.
Thank you so much.
Users browsing this forum: No registered users and 219 guests