opencart

Clean URL's using OpenCart's router class

随声附和 提交于 2021-02-19 01:14:36
问题 How do you write clean URL's in OpenCart using their built in Router class? Here is my .htaccess file: RewriteEngine On RewriteRule ^(system) - [F,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] 回答1: The work is very hard To modify more than 3 files catalog\controller\common\seo_url.php catalog\model\tool\seo_url.php Add this line to your file to modify $this->load->model('tool/seo_url') and used $this->model_tool_seo_url->rewrite(

Clean URL's using OpenCart's router class

大兔子大兔子 提交于 2021-02-19 01:08:52
问题 How do you write clean URL's in OpenCart using their built in Router class? Here is my .htaccess file: RewriteEngine On RewriteRule ^(system) - [F,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] 回答1: The work is very hard To modify more than 3 files catalog\controller\common\seo_url.php catalog\model\tool\seo_url.php Add this line to your file to modify $this->load->model('tool/seo_url') and used $this->model_tool_seo_url->rewrite(

Opencart get category_id in category page

纵然是瞬间 提交于 2021-02-11 09:22:32
问题 Trying to get "new" sticker in category page. For example if product have category 219 it would have sticker. What I have added in controller category.php $product_info = $this->model_catalog_product->getProduct($product_id); $categories = $this->model_catalog_product->getCategories($product_info['$product_id']); $categories_info = $this->model_catalog_category->getCategory($categories[0]['category_id']); $this->data['category_id'] = $categories_info['category_id']; In category.tpl <?php if(

Opencart get category_id in category page

最后都变了- 提交于 2021-02-11 09:21:26
问题 Trying to get "new" sticker in category page. For example if product have category 219 it would have sticker. What I have added in controller category.php $product_info = $this->model_catalog_product->getProduct($product_id); $categories = $this->model_catalog_product->getCategories($product_info['$product_id']); $categories_info = $this->model_catalog_category->getCategory($categories[0]['category_id']); $this->data['category_id'] = $categories_info['category_id']; In category.tpl <?php if(

Opencart get category_id in category page

别来无恙 提交于 2021-02-11 09:21:09
问题 Trying to get "new" sticker in category page. For example if product have category 219 it would have sticker. What I have added in controller category.php $product_info = $this->model_catalog_product->getProduct($product_id); $categories = $this->model_catalog_product->getCategories($product_info['$product_id']); $categories_info = $this->model_catalog_category->getCategory($categories[0]['category_id']); $this->data['category_id'] = $categories_info['category_id']; In category.tpl <?php if(

Opencart get category_id in category page

房东的猫 提交于 2021-02-11 09:20:31
问题 Trying to get "new" sticker in category page. For example if product have category 219 it would have sticker. What I have added in controller category.php $product_info = $this->model_catalog_product->getProduct($product_id); $categories = $this->model_catalog_product->getCategories($product_info['$product_id']); $categories_info = $this->model_catalog_category->getCategory($categories[0]['category_id']); $this->data['category_id'] = $categories_info['category_id']; In category.tpl <?php if(

OpenCart .twig file not showing changes

我们两清 提交于 2021-02-10 22:04:36
问题 I've been trying to change the product/catalog.twig file, to remove some unnecessary buttons such as the "add to wishlist" and "compare product" options, which are just useless for the store I'm attempting to make. On the theme editor, I've removed the two buttons from the .twig file, yet the changes aren't showing on the store. I've heard it might be an issue with caching, like it's bringing up the old site. So I deleted the cache from the storage folder, yet the problem still persists. 回答1:

How to clear cache in Opencart from PHP

本秂侑毒 提交于 2021-01-27 06:59:23
问题 I need to clear cache on certain condition from PHP code. How can I do so. I know that there is object Cache exists in opencart engine, but how do delete cache correctly. Or it is possible to delete just folders ? Please give advice. 回答1: In OpenCart there are 3 places that store cache image cache is located at public_html/image/cache if you have vQmod public_html/vqmod/vqcache system (data) cache public_html/system/cache You can delete files within these folders - do not delete the cache

opencart 2.0 SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data OK

一曲冷凌霜 提交于 2021-01-27 03:50:40
问题 I looked all over the internet and found no answer. Basically my problem is whenever I try to edit orders and change stores I get the SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data OK in firefox and in chrome I get SyntaxError: Unexpected end of input OK. Has anyone found a "real" solution for this because I tried all that was suggested but they don't work. From changing the api_id to making a secondary API. And even the .htaccess method. 回答1: I got the

Opencart 3.0.2.0 and Journal 3 theme customer name in Top Menu

家住魔仙堡 提交于 2021-01-06 07:20:48
问题 I want to add customer first name on Journal theme top menu module. I am adding {{ text_logged }} in top-menu.twig but it can not get text_logged from controller. How can I get text_logged from catalog/controller/common/header.php? {% if logged %} {{ text_logged }} {% endif %} $data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/account', '', true), $this->customer->getFirstName(), $this->url->link('account/logout', '', true)); I want to see "Hello