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">
<operation>
<search trim="true" index="0">
<![CDATA[
$order_product_id = $this->db->getLastId();
]]>
</search>
<add position="after">
<![CDATA[
if($product['variation_detail_id']){
$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'].")");
}
]]>
</add>
</operation>
</file>
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?
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"
Second, Are you sure index start with 0?
try remove index="0"
Who is online
Users browsing this forum: No registered users and 72 guests