Post by jasar » Fri May 13, 2016 1:54 am

id like to know how can i make the admin order include can add disabled products
becouse there is some products that i only sell in my physical store not online.
what file verify that product is disabled on autocomplet and add buton on admin new order products page?

New member

Posts

Joined
Thu May 05, 2016 9:29 pm

Post by straightlight » Fri May 13, 2016 2:05 am

In order for this request to work, an additional question would need to be added into the admin products form page so that each products could either be defined as a physical or virtual product. Then, from the admin orders, merchants could then identify if each products that can be completed via the admin orders API and can be sold as a physical or virtual product. Since day 1, I have been wondering myself how or why would merchants be able to complete a request order from the admin without knowing the product structure especially if the store itself would contain hundreds or thousands of products.

If there are no contributions on this subject, I hope this would be an integrated feature in the future as part of the core.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by jasar » Fri May 13, 2016 2:16 am

i didint understand , i only want to add disabled products on cart only in adm manual new orders

New member

Posts

Joined
Thu May 05, 2016 9:29 pm

Post by jasar » Sat May 14, 2016 4:51 am

did you understand my problen?

New member

Posts

Joined
Thu May 05, 2016 9:29 pm

Post by daniGo » Sat May 14, 2016 6:20 pm

For OC2.2 find system/library/cart/cart.php and in line 41 try replace

Code: Select all

$product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_store p2s LEFT JOIN " . DB_PREFIX . "product p ON (p2s.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND p2s.product_id = '" . (int)$cart['product_id'] . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.date_available <= NOW() AND p.status = '1'");
with

Code: Select all

if (isset($this->session->data['api_id'])) {
$product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_store p2s LEFT JOIN " . DB_PREFIX . "product p ON (p2s.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND p2s.product_id = '" . (int)$cart['product_id'] . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
} else {
$product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_store p2s LEFT JOIN " . DB_PREFIX . "product p ON (p2s.product_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND p2s.product_id = '" . (int)$cart['product_id'] . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.date_available <= NOW() AND p.status = '1'");
}






http://www.gombac.si


Active Member

Posts

Joined
Wed Mar 20, 2013 4:49 pm
Location - Slovenia

Post by jasar » Sun May 15, 2016 6:56 am

im using 2.0.3.1

New member

Posts

Joined
Thu May 05, 2016 9:29 pm

Post by daniGo » Sun May 15, 2016 3:03 pm

For OC2.0.3.1 find system/library/cart.php and in line 43 try replace

Code: Select all

$product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.date_available <= NOW() AND p.status = '1'");
with

Code: Select all

if (isset($this->session->data['api_id'])) {
    $product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
} else {
    $product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.date_available <= NOW() AND p.status = '1'");
}

http://www.gombac.si


Active Member

Posts

Joined
Wed Mar 20, 2013 4:49 pm
Location - Slovenia

Post by jasar » Mon May 16, 2016 8:15 am

it dont worked
Product can not be bought from the store you have choosen!
that it says.

New member

Posts

Joined
Thu May 05, 2016 9:29 pm

Post by daniGo » Mon May 16, 2016 7:28 pm

jasar

I try to upload ocmod file, but the site blocking me. If PM me your mail i will send you the file, so you can test it.

http://www.gombac.si


Active Member

Posts

Joined
Wed Mar 20, 2013 4:49 pm
Location - Slovenia

Post by ddpneu » Wed Aug 23, 2017 4:22 am

Hello,
could you please share the solution? I need the same thing.

Thanks

New member

Posts

Joined
Sat Sep 14, 2013 4:54 am
Who is online

Users browsing this forum: No registered users and 20 guests