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
Related
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>
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
I need some advice in placing Google Tag Manager (assuming the API is already written) in OpenCart. I've thought of loading it straight from header.tpl, however I want to know what the cleanest implementation would be.
I've found this solution to be optimal for me. Tested and it works. You will need Vqmods installed (https://github.com/vqmod/vqmod/wiki).
I used an edited version of this script (http://www.opencart.com/index.php?route=extension/extension/info&extension_id=18200). Basically, what you want to do is replace the search query so that it matches your body tag's class.
Keep in mind that you should check your header.tpl to make sure you place the GTM code right at the beginning of your body tag.
Finally, my edited xml:
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id><![CDATA[Google Tag Manager]]></id>
<version><![CDATA[1.0]]></version>
<vqmver><![CDATA[]]></vqmver>
<author><![CDATA[hany.mesbah#gadalla.com]]></author>
<file name="catalog/view/theme/*/template/common/header.tpl">
<operation error="log">
<search position="after"><![CDATA[<body class="fs<?php echo $themeConfig['fontsize'];?> <?php echo $helper->getPageClass();?> <?php echo $helper->getParam('body_pattern','');?>">]]></search>
<add><![CDATA[your GTM code snippet]]></add>
</operation>
</file>
</modification>
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>
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.