Post by Umer.Farooq1993 » Tue Jul 11, 2017 2:57 pm

I want to place the code after the $order_product_id = $this->db->getLastId() which occur 2 times in order.php file. I want to place the code in both places. The OCMOD is placing the code as instructed but it is also adding the code third time and placing it in random place.

<file path="catalog/model/checkout/order.php">
<search trim="true" index="0">
$order_product_id = $this->db->getLastId();
<add position="after">
$this->db->query("INSERT INTO `oc_order_variation`( `order_id`, `order_product_id`, `product_variation_detail_id`) VALUES (".(int)$order_id.",".(int)$order_product_id.",".(int)$product['variation_detail_id'].")");


I have also tried using offset but it neglect the first occurrence and place the code in the second occurrence only. Is there a way to add the code in both places?


Mon Jul 10, 2017 6:27 pm

Post by opencartboost » Tue Jul 11, 2017 11:22 pm

First, please make you posting at right place. If you are using OC 2.x, you should section Opencart 2.x support.
Second, Are you sure index start with 0?
try remove index="0"

Active Member


Thu Jul 09, 2015 5:59 am
Who is online

Users browsing this forum: No registered users and 8 guests