Opencart - how do i add submenu in admin panel - opencart

I want to add a sub-menu in Opencart admin panel .
I was saw this link, but it didn't really help .
any help will be appropriated .

I just find it out and here the solution :
because we should not modify the core and only solution is VQMOD , you should add some line to your xml file witch there is in xml folder :
<file name="admin/controller/common/header.php">
<operation>
<search position="after"><![CDATA[$this->data['text_backup'] = $this->language->get('text_backup');]]></search>
<add><![CDATA[ $this->data['text_export'] = "sms";]]></add>
</operation>
<operation>
<search position="after"><![CDATA[$this->data['backup'] = $this->url->link('tool/backup', 'token=' . $this->session->data['token'], 'SSL');]]></search>
<add><![CDATA[ $this->data['export'] = $this->url->link('tool/export', 'token=' . $this->session->data['token'], 'SSL');]]></add>
</operation>
</file>
it add menu to system menu .
Hope it Helps.

Related

Opencart 3 Add Additional Delivery Detail

I need to add additional delivery option in the delivery detail of Opencart 3's checkout page.
I found the file in > catalog/view/theme/default/template/checkout/shipping_address.twig
I tried modify but not visual change in the checkout page.
Can anyone guide me to the correct file ?
Note: currently im using default template.
Create a file, named "install.xml" and then zip it. Then install it as module from extension upload. And then refresh cache from "Modifications".
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Additional Delivery Detail</name>
<code>delivery</code>
<version>1.0</version>
<author>white coffeee</author>
<link></link>
<file path="catalog/view/theme/default/template/checkout/shipping_address.twig">
<operation>
<search><![CDATA[ **CODE TO BE SEARCHED** ]></search>
<add position="after"><![CDATA[
**CODE TO BE ADDED**
]]></add>
</operation>
</file>
</modification>

Product price excl tax in order histroy info page (Opencart 1.5.6.4)

Is there a simple way to show the price without tax instead of incl on the order histroy page in opencart 1.5.6.4? I Managed to "fix" it everywhere else.
Screendump opencart 1.5.6.4.
Can anybody tell me how to change this?
Thank you!
<file name="catalog/controller/account/order.php">
<operation>
<search position="replace"><![CDATA['price' => $this->currency->format($product['price'] + ($this->config->get('config_tax') ? $product['tax'] : 0), $order_info['currency_code'], $order_info['currency_value']),]]></search>
<add><![CDATA['price' => $this->currency->format($product['price'], $order_info['currency_code'], $order_info['currency_value']),]]></add>
</operation>
<operation>
<search position="replace"><![CDATA['total' => $this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value']),]]></search>
<add><![CDATA['total' => $this->currency->format($product['total'], $order_info['currency_code'], $order_info['currency_value']),]]></add>
</operation>
</file>
Done :)

how to display future products in opencart

products in open cart script doesn't show up in front end page when i add product and set the date to the future
am trying to display future products S i want to know how can i do that is there anyway i can do that,i do search a lot for answer to that question but all i found is xml file need vqmod system but it's not working too . so please guys am trying to display future products on homepage
here's then answer which didn't work
<modification>
<id><![CDATA[Products with future available date become able to show in store and be purchased]]></id>
<version><![CDATA[1.0.0]]></version>
<vqmver><![CDATA[2.0.0]]></vqmver>
<author><![CDATA[angeloop]]></author>
<file name="catalog/model/catalog/product.php">
<operation>
<search position="after"><![CDATA['p.date_added']]></search>
<add><![CDATA[, 'p.date_available']]></add>
</operation>
<operation>
<search position="replace"><![CDATA[AND p.date_available <= NOW()]]> </search>
<add><![CDATA[]]></add>
</operation>
</file>
<file name="system/library/cart.php">
<operation>
<search position="replace"><![CDATA[AND p.date_available <= NOW()]]></search>
<add><![CDATA[]]></add>
</operation>
</file>
</modification>
I have created a module for it.
Go to the link below
Coming soon products module for OpenCart
Download the modules and set the modules which will show future products or coming soon products

Proper way to work using the real image of a product on OpenCart 2

I'm currently looking for the proper way to work on a theme using the real image of a product and not its thumbnail (identified as $thumb in the default theme).
I have found a abrupt trick by adding a line in the controller file:
$this->data['cover'] = $product_info['image'];
But does anybody have experienced a better method (eg with vqmod) to retrieve these real image data without changing controller content (for using in template pages, such as product.tpl or category.tpl for example)?
With help from members of OpenCart forum, I managed to find a functional solution (using vQmod).
It is thus require to create an .xml file placed in the vqmod/xml folder and containing, for example:
<?xml version="1.0" encoding="utf-8"?>
<modification>
<id>Recover Real Image</id>
<version></version>
<vqmver></vqmver>
<author></author>
<email></email>
<website></website>
<file name="catalog/controller/product/product.php">
<operation>
<search position="after"><![CDATA[
$data['points'] = $product_info['points'];
]]></search>
<add><![CDATA[
$data['picture'] = HTTP_SERVER.'/image/'.$product_info['image'];
]]></add>
</operation>
</file>
</modification>
If product image can not be found and assuming a <default.jpg> is put the root of the <image> folder, the <add> element can be replaced by:
if(empty($product_info['image'])){
$data['picture'] = HTTP_SERVER.'image/default.jpg';
}
else{
$data['picture'] = HTTP_SERVER.'image/'.$product_info['image'];
}
Other possible suggestions, by using:
OCmod can be found here
Image Autosize extension can be found here

How to add custom words behind product price

I am trying to figure out how to add "Per Square Feet" behind the Product Price. It should be only applied to selected products - not to all. Any help is appreciated.
This is the screenshot for reference
Thank you for the photo it helped a lot. I suggest adding this into vqmod/vqcache. For more information on VQmod look here: https://code.google.com/p/vqmod/. If not you can just take the HTML, PHP, and Query code and put it directly in your core files.
View:
<file name="catalog/view/theme/*/template/product/product.tpl"> // where it will insert the below code
<operation>
<search position="before"><![CDATA[<?php if ($tax) { ?>]]></search> // this places your code before the code in the CDATA[....what ever is here....]
<add><![CDATA[ // the below code is what you are adding
<?php if isset($pricePerSqFt) { ?>
<p><?php echo $pricePerSqFt; ?></p>]]></add>
</operation>
</file>
Controller:
$this->load->model('catalog/product');
$this->data['pricePerSqFt'] = $this->model_catalog_product->getData();
Model:
<file name="catalog/model/catalog/product.php">
<operation>
<search position="after"><![CDATA[class ModelCatalogProduct extends Model {]]></search>
<add>
<![CDATA[
public function getData() {
$query = $this->db->query("SELECT what_data_you_want FROM table_name"); // will grab the data from database
if (isset($query)) {
return $query;
}else{
return NULL;
}
}
]]>
</add>
</operation>
</file>