Hello, thanks @Sw!tch and @straightlight for taking time to answer my question. I have never used events on oc, so was not sure how to register them. Went thru quite a few tutorials, they have all the info but how to upload (bundle) ur code and install them. So i tried creating a module bu putting the file in appropriate folders as mentioned above and installed it. Got confirmation that module is installed but my events are not being registered.
Thats my first issue, both the files and location are listed above.
Now moving onto issue at hand, i am using "Related Product Options Pro" and this module is working fine. But we have one product that just needs little bit extra work to git right model. In this product we have some extra options that customer can add onto products , so you select all the options listed and model number is created and then there are some extra options like extra memory, usb connection etc that can be added onto the product. And this part works, model number is added to cart and extra options are also listed in product options. But we want to add extra options code at the end of the product model. It makes easier for production staff to assemble product based on model.
I have it working it by using ocmod
Code: Select all
<file path="catalog/model/checkout/order.php">
<operation error="log">
<search><![CDATA[foreach ($data['products'] as $product) {]]></search>
<add position="after"><![CDATA[
// Change eve model
//if(strpos($product['name'], 'EVE') === true){
if (strpos(html_entity_decode(strtoupper($product['name']), ENT_QUOTES, 'UTF-8'), 'EVE')) {
foreach ($product['option'] as $option) {
// compare options value thats added to model if it exist in model, if not add it at the end
if(strpos($product['model'], $option['value']) === false){
$product['model'] .= "-".$option['value'];
}
}
}
// end eve
]]></add>
</operation>
</file>
<file path="system/library/cart/cart.php">
<operation error="log">
<search><![CDATA[if ($option_value_query->num_rows) {]]></search>
<add position="before"><![CDATA[
// status chage eve model
if(strpos($product_query->row['name'], 'EVE3x') !== false){
// compare options value thats added to model if it exist in model, if not add it at the end
if(strpos($product_query->row['model'], $option_value_query->row['name']) === false){
$product_query->row['model'] .= "-".$option_value_query->row['name'];
}
}
// end eve
]]></add>
</operation>
</file>
This have solved my problem, but still if you can guide me how to register events that would be great. @Sw!tch had mentioned i can check in oc_event table and i can confirm after installing my module event was not in this table.
Thanks again for your time.