Hello guys,
Is that possible to add a new page (from the top menu) to Opencart 1.4.9.5 like "offer of the month" for promotional offers that would take place for a particular month?
I am aware of "specials" but I am not keen to use it unless the "specials" do have a page from the menu.
Any help would be much appreciated.
Thanks a lot in advance
little update: I have successfully created a module from the featured module.
I tried to route it through the index.php so that I can call it from a new URL that can be added to the menu, but there's always this error indicating that such page is not found.
Is there any possible way to do that?
Any help would be much appreciated.
Thanks.
I tried to route it through the index.php so that I can call it from a new URL that can be added to the menu, but there's always this error indicating that such page is not found.
Is there any possible way to do that?
Any help would be much appreciated.
Thanks.
hi friend, can you explain how to do it for version 1.5.1.1 / 2 OC
http://elitps.karadev.net/ - test address
http://elitps.karadev.net/ - test address
hi, this is great but and also what will happen in version 1.5.1.1 / 2 because this is the last version of the OC and now use it to test address razgeldah page for additives not found such a module or help make this
Hello theo,
Sorry for the late reply.
The steps 1-6 below are to ensure that you can add a new URL link and page to opencart as "offer"
1. Make a copy of catalog/controller/common/home.php (e.g., catalog/controller/common/offer.php)
2. Edit new offer.php (replacing 'home' to 'offer')
3. Make a copy of catalog/language/english/common/home.php (e.g., catalog/language/english/common/offer.php
4. Edit new offer.php (changing the text associated to '$_['text_latest']')
5. Make a copy of catalog/view/theme/your template/template/common/home.tpl (e.g., catalog/view/theme/your template/template/common/offer.tpl)
6. Edit your header.tpl to include this
Now step 7 to 13:
7. Make a copy of catalog/controller/module/featured.php (e.g., catalog/controller/module/offer.php)
8. Edit new offer.php (replacing 'featured' to 'offer')
9. Make a copy of catalog/language/english/module/featured.php (e.g., catalog/language/english/module/offer.php
10. Edit new offer.php (changing the text associated to '$_['heading_title']', e.g., to "offer of the month")
11. Make a copy of catalog/view/theme/your template/template/module/featured_home.tpl (e.g., catalog/view/theme/your template/template/module/offer_home.tpl)
12. Go to dashboard>extensions>modules
13. Enable your newly created module
Do not forgot to edit catalog/model/catalog/product.php.
Find:
Add BEFORE:
Now you just have to alter your database for the new module.
1. Go to phpmyadmin and select your opencart database
2. Create a table "product_offer" with 1 field "product_id"
To test if everything is fine, go to dashboard>extensions>modules>offer and edit. Add some products and selection position "offer"
You should see on your home page a new menu has appeared in red "offer of the month".
You can change the color of the menu to whatever you want.
Hope this helps getting your "offer of the month page"
Cheers.
Sorry for the late reply.
The steps 1-6 below are to ensure that you can add a new URL link and page to opencart as "offer"
1. Make a copy of catalog/controller/common/home.php (e.g., catalog/controller/common/offer.php)
2. Edit new offer.php (replacing 'home' to 'offer')
3. Make a copy of catalog/language/english/common/home.php (e.g., catalog/language/english/common/offer.php
4. Edit new offer.php (changing the text associated to '$_['text_latest']')
5. Make a copy of catalog/view/theme/your template/template/common/home.tpl (e.g., catalog/view/theme/your template/template/common/offer.tpl)
6. Edit your header.tpl to include this
Code: Select all
<li><a href="<?php echo str_replace('&', '&', $offer); ?>" id="tab_offer" style="color: #ff0000"><?php echo $text_offer; ?></a></li>
7. Make a copy of catalog/controller/module/featured.php (e.g., catalog/controller/module/offer.php)
8. Edit new offer.php (replacing 'featured' to 'offer')
9. Make a copy of catalog/language/english/module/featured.php (e.g., catalog/language/english/module/offer.php
10. Edit new offer.php (changing the text associated to '$_['heading_title']', e.g., to "offer of the month")
11. Make a copy of catalog/view/theme/your template/template/module/featured_home.tpl (e.g., catalog/view/theme/your template/template/module/offer_home.tpl)
12. Go to dashboard>extensions>modules
13. Enable your newly created module
Do not forgot to edit catalog/model/catalog/product.php.
Find:
Code: Select all
public function getFeaturedProducts($limit) {
$product_data = $this->cache->get('product.featured.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . $limit);
if (!$product_data) {
$query = $this->db->query("SELECT *, pd.name AS name, p.image, m.name AS manufacturer, ss.name AS stock, (SELECT AVG(r.rating) FROM " . DB_PREFIX . "review r WHERE p.product_id = r.product_id GROUP BY r.product_id) AS rating FROM " . DB_PREFIX . "product_featured f LEFT JOIN " . DB_PREFIX . "product p ON (f.product_id=p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (f.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN " . DB_PREFIX . "stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE p.status = '1' AND p.date_available <= NOW() AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND ss.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY p.date_added ASC LIMIT " . (int)$limit); //original code "' ORDER BY p.sort_order ASC LIMIT " . (int)$limit);
$product_data = $query->rows;
$this->cache->set('product.featured.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . $limit, $product_data);
}
return $product_data;
}
Code: Select all
//Offer of the Month
public function getOfferProducts($limit) {
$product_data = $this->cache->get('product.Offer.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . $limit);
if (!$product_data) {
$query = $this->db->query("SELECT *, pd.name AS name, p.image, m.name AS manufacturer, ss.name AS stock, (SELECT AVG(r.rating) FROM " . DB_PREFIX . "review r WHERE p.product_id = r.product_id GROUP BY r.product_id) AS rating FROM " . DB_PREFIX . "product_offer f LEFT JOIN " . DB_PREFIX . "product p ON (f.product_id=p.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (f.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN " . DB_PREFIX . "stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE p.status = '1' AND p.date_available <= NOW() AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND ss.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY p.sort_order ASC LIMIT " . (int)$limit);
$product_data = $query->rows;
$this->cache->set('product.Offer.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . $limit, $product_data);
}
return $product_data;
}
1. Go to phpmyadmin and select your opencart database
2. Create a table "product_offer" with 1 field "product_id"
To test if everything is fine, go to dashboard>extensions>modules>offer and edit. Add some products and selection position "offer"
You should see on your home page a new menu has appeared in red "offer of the month".
You can change the color of the menu to whatever you want.
Hope this helps getting your "offer of the month page"
Cheers.
Who is online
Users browsing this forum: Google [Bot] and 352 guests