Post by juanrapma » Sat Sep 12, 2015 1:54 am

Hola, quisiera saber si se puede colocar el SKU en el Cart???

Saludos

Newbie

Posts

Joined
Thu Aug 06, 2015 7:40 am

Post by viethemes » Sat Sep 12, 2015 11:57 pm

Are you using a custom theme or the default theme?

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by Time111 » Sun Sep 13, 2015 3:08 am

viethemes wrote:Are you using a custom theme or the default theme?
Im using custom theme. Interested to know how to add SKU in shopping cart, order history and order confirmation email

~Time
Version 2.0.3.1

New member

Posts

Joined
Tue Aug 11, 2015 7:46 am

Post by Time111 » Mon Sep 14, 2015 5:24 am

hi,

there is no problem, I just want to know is there any code i can modify so that we can put SKU not just model.

~Time
Version 2.0.3.1

New member

Posts

Joined
Tue Aug 11, 2015 7:46 am

Post by straightlight » Mon Sep 14, 2015 7:13 am

One quick way would be to modify the catalog/controller/checkout/confirm.php file:

Find:

Code: Select all

$products = $this->cart->getProducts();
Add after:

Code: Select all

$this->load->model('catalog/product');
Then, find:

Code: Select all

foreach ($products as $product) {
add after:

Code: Select all

$store_product = $this->model_catalog_product->getProduct($product['product_id']);
Then, find twice:

Code: Select all

'model'      => $product['model'],
add after both:

Code: Select all

'sku'        => $store_product['sku'],
Then, find:

Code: Select all

foreach ($this->cart->getProducts() as $product) {
add after:

Code: Select all

$store_product = $this->model_catalog_product->getProduct($product['product_id']);
In catalog/model/checkout/order.php file,

find:

Code: Select all

model = '" . $this->db->escape($product['model']) . "',
add after (same line):

Code: Select all

sku = '" . $this->db->escape($product['sku']) . "',
In PHPMyAdmin SQL tab console, in your Opencart database, execute:

Code: Select all

ALTER TABLE `oc_order_product` ADD `sku` VARCHAR(64) NOT NULL AFTER `model`;
Note: Replace oc_ with your current database table prefix of Opencart.

This should resolved the problem.

While I do agree with the fact that SKU strings should be entered along with the model within each orders, previous SKU strings that has not been entered into the orders should rather be considered as a chronnologic task from the back-end or on the store-front end; order product by order product query.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by clorne » Wed Sep 16, 2015 12:41 am

Try a new FREE extension from ocextensions - Display Product SKU

http://www.opencart.com/index.php?route ... n_id=23901

Active Member

Posts

Joined
Fri Dec 23, 2011 6:03 pm

Post by Time111 » Wed Sep 16, 2015 2:14 am

clorne wrote:Try a new FREE extension from ocextensions - Display Product SKU

http://www.opencart.com/index.php?route ... n_id=23901
Hi,

thanx it work. anyone know any tweak to this so that we can see SKU in Admin > Products List also

And want to say the above long code also work given by @straightlight

~Time
Version 2.0.3.1

New member

Posts

Joined
Tue Aug 11, 2015 7:46 am

Post by straightlight » Wed Sep 16, 2015 4:59 am

And want to say the above long code also work given by @straightlight
Thanks for the update. One quick way regarding your request would be to duplicate all instances of: filter_model into the:

- admin/controller/catalog/product.php
- admin/model/catalog/product.php file (inside the: getProducts paragraph)
- admin/view/template/catalog/product_list.tpl

Then, rename the duplicated variable names of: filter_model to: filter_sku. Otherwise, posting such modifications on the forum could resolved in very long steps to follow.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 45 guests