The Sales > Order in OpenCart (ver 2.3) admin shows orders with statuses, e.g. Completed, Failed. I also need to view orders that were checked out but were not processed at all. These are orders with order_status_id equal to 0?
Is there a settings anywhere where I can opt to view unprocessed orders?
I've created a free vQmod script that displays unfinished orders:
Unsuccessful orders
<modification>
<id>Unsuccessfull Orders</id>
<version>1.0</version>
<vqmver>2.x</vqmver>
<author>darbaze.com</author>
<file name="admin/model/sale/order.php">
<operation>
<search position="replace"><![CDATA[$sql .= " WHERE o.order_status_id > '0'";]]></search>
<add><![CDATA[$sql .= " WHERE o.order_status_id >= '0'";]]></add>
</operation>
</file>
<file name="admin/view/template/dashboard/recent.tpl">
<operation>
<search position="replace" offset="1"><![CDATA[<?php foreach ($orders as $order) { ?>]]></search>
<add><![CDATA[<?php foreach ($orders as $order) { ?>
<tr class="<?php if($order['status']){ echo 'successfull'; } else { echo 'unsuccessfull'; } ?>">]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[<td><?php echo $order['status']; ?></td>]]></search>
<add><![CDATA[<td><?php if($order['status']){ echo $order['status']; } else { echo '---'; } ?></td>]]></add>
</operation>
</file>
<file name="admin/view/template/sale/order_list.tpl">
<operation>
<search position="replace" offset="1"><![CDATA[<?php foreach ($orders as $order) { ?>]]></search>
<add><![CDATA[<?php foreach ($orders as $order) { ?>
<tr class="<?php if($order['status']){ echo 'successfull'; } else { echo 'unsuccessfull'; } ?>">]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[<td class="text-left"><?php echo $order['status']; ?></td>]]></search>
<add><![CDATA[<td class="text-left"><?php if($order['status']){ echo $order['status']; } else { echo '---'; } ?></td>]]></add>
</operation>
</file>
<file name="admin/view/template/common/header.tpl">
<operation>
<search position="before"><![CDATA[<?php foreach ($styles as $style) { ?>]]></search>
<add><![CDATA[<style>.successfull td{color:green;font-weight:bold} .unsuccessfull td{color:red}</style>]]></add>
</operation>
</file>
</modification>
Related
I am trying to add a variable in language file using opencart extension, but there is no change in the file.
My code:
<file path="admin/language/english/catalog/product.php">
<operation>
<search><![CDATA[// Error]]></search>
<add position="before"><![CDATA[
$_['entry_a_start_date'] = 'Start Date/Time';
]]>
</add>
</operation>
</file>`
Please let me know what is wrong with the code.
Thanks in advance
When you want to call a single file use name not path.
This should work:
<file name="admin/language/english/catalog/product.php">
<operation>
<search position="before"><![CDATA[// Error]]></search>
<add><![CDATA[
$_['entry_a_start_date'] = 'Start Date/Time';
]]>
</add>
</operation>
</file>
Why does this opencart 2 OCMod not work?
<modification>
<file name="catalog/language/english/english.php">
<operation>
<search><![CDATA[
$_['text_home'] = '<i class="fa fa-home"></i>';
]]></search>
<add position="replace"><![CDATA[
$_['text_home'] = 'Home';
]]></add>
</operation>
</file>
</modification>
I upload it and refresh the mods cache, but my changes do not appear.
Add Search Tag "<search position="replace">"
<modification>
<file name="catalog/language/english/english.php">
<operation>
<search position="replace"><![CDATA[
$_['text_home'] = '<i class="fa fa-home"></i>';
]]></search>
<add position="replace"><![CDATA[
$_['text_home'] = 'Home';
]]></add>
</operation>
</file>
Try this,
<modification>
<name><![CDATA[<font color="#0000"><b>Home link</font>]]></name>
<version><![CDATA[<b>1.0</b>]]></version>
<code>home_link</code>
<author><![CDATA[<font color="#CC0000"><b>zec Blackbeard</b></font>]]></author>
<link><![CDATA[abcd.com]]></link>
<file path="catalog/language/english/english.php">
<operation>
<search><![CDATA[$_['text_home'] = '<i class="fa fa-home"></i>';]]></search>
<add position="replace"><![CDATA[$_['text_home'] = 'Home';]]></add>
</operation>
</file>
</modification>
You have mode sily mistake. In ocmod, file name attribute does not work. You need to replace with path.
You need to change following line.
Find
<file name="catalog/language/english/english.php">
Replace with
<file path="catalog/language/english/english.php">
I am trying to get value of special $date_start and $date_end on product page. I'm using opencart version 2.0x. please help manually thank you.
For Special price date
create you own ocmod file for ex. special_price.ocmod.xml, Paste the following code and install from extension installer
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<name><![CDATA[<font color="#0000"><b>Special Price</font>]]></name>
<version><![CDATA[<b>1.0</b>]]></version>
<code>specialprice_dates</code>
<author><![CDATA[<font color="#CC0000"><b>A2bizz Blogs</b></font>]]></author>
<link><![CDATA[http://blogs.a2bizz.com]]></link>
<file path="catalog/controller/product/product.php">
<operation error="skip">
<search><![CDATA[ $data['discounts'] = array(); ]]></search>
<add position="before" ><![CDATA[
if($data['special']){
$special_info = $this->model_catalog_product->getSpecialPriceInfo($this->request->get['product_id']);
}else{
$special_info = '';
}
]]></add>
</operation>
<operation error="skip">
<search><![CDATA[ 'special' => $special, ]]></search>
<add position="after" ><![CDATA[
'special_info' => $special_info,
]]></add>
</operation>
</file>
<file path="catalog/model/catalog/product.php">
<operation error="skip">
<search><![CDATA[ public function getLatestProducts($limit) { ]]></search>
<add position="before" ><![CDATA[
public function getSpecialPriceInfo($product_id){
$sql = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "product_special WHERE product_id = '".$product_id."'");
return $sql->row;
}
]]></add>
</operation>
</file>
</modification>
Add following code in product.tpl
<?php if ($product['special_info']) { ?>
<p><?php echo "<pre>"; print_r($product['special_info']); exit;?></p>
<?php } ?>
Here you can get the special price information.
I am trying to create Sub menu under Product menu using VQMOD, but unfortunately i couldn't able to display it in admin. Please see below for the code i used to create menu using VQMOD.
<modification>
<id>Add a link</id>
<version>1.5.4</version>
<vqmver>0.1</vqmver>
<author>Nagamani Naresh</author>
<!-- edit header controller -->
<file name="admin/controller/common/header.php">
<!-- create link to your page -->
<operation error="log">
<search position="after"><![CDATA[$this->data['setting'] = $this->url->link('setting/store', 'token=' . $this->session->data['token'], 'SSL');]]></search>
<add><![CDATA[
$this->data['hello_world'] = $this->url->link('custom/helloworld', 'token=' . $this->session->data['token'], 'SSL');
]]></add>
</operation>
<!-- / -->
</file>
<!-- edit header template -->
<file name="admin/view/template/common/header.tpl">
<!-- add link to your page -->
<operation error="log">
<search position="before" offset="1"><![CDATA[<ul class="right">]]></search>
<add><![CDATA[
<li><a class="top">Your link</a>
<ul>
<li>Hello World</li>
</ul>
</li>
]]></add>
</operation>
<!-- / -->
</file>
</modification>
Please share your Suggestions.
for opencart 2.0.X
save this code as name.ocmod.xml and uplaod from admin
<?xml version="1.0" encoding="utf-8"?>
<modification>
<code>extra admin menu</code>
<name>test admin menu</name>
<version>2.0</version>
<author>codertj</author>
<link>codertj.com</link>
<!-- edit header controller -->
<file name="admin/controller/common/menu.php">
<!-- create link to your page -->
<operation error="log">
<search><![CDATA[$data['setting'] = $this->url->link('setting/store', 'token=' . $this->session->data['token'], 'SSL');]]></search>
<add position="after"><![CDATA[
$data['hello_world'] = $this->url->link('custom/helloworld', 'token=' . $this->session->data['token'], 'SSL');
]]></add>
</operation>
</file>
<!-- edit header template -->
<file name="admin/view/template/common/menu.tpl">
<!-- add link to your page -->
<operation error="log">
<search><![CDATA[<li><?php echo $text_product; ?></li>]]></search>
<add position="after"><![CDATA[
<li>Hello World</li>
]]></add>
</operation>
</file>
I want to add some content in footer file using VQMod my XML file has the following content but it's not working
<code>
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>VQMOD CODE test data</id>
<version>1.0</version>
<vqmver>2.0.1</vqmver>
<author>authore name</author>
<file name="catalog/view/theme/default/template/common/footer.tpl">
<operation error="skip">
<search position="after"><![CDATA[
</footer>
]]></search>
<add><![CDATA[
this is test content
]]></add>
</operation>
</file>
</modification>
</code>
what is version of your opencart ?
it's dependent of your footer.tpl content. you need to make sure that </footer> is available in footer.tpl
and also you need to check in vqmod/logs you will see error log there.
Can you tell me if any custom theme is applied on top of your default opencart theme?
Edit :
Try this code, it'll work for you.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE modification [
<!ENTITY adminFolder "admin">
<!ENTITY themeFolder "default">
]>
<modification>
<version>1.0</version>
<vqmver>2.X</vqmver>
<author>umesh</author>
<file name="catalog/view/theme/&themeFolder;/template/common/footer.tpl">
<operation info="To add custom data at footer">
<search position="after" ><![CDATA[
</footer>
]]></search>
<add><![CDATA[
test content
]]></add>
</operation>
</file>