opencart

Display block HTML only on main page?

谁说胖子不能爱 提交于 2019-12-10 11:15:26
问题 I tried to modify home controller adding new variable: $data["header_home"] = true; Then I try to check this in header.twig tetmplate like as: {% if header_home %} <div>Home</div> {% else %} <div>Not Home</div> {% endif %} When I open home page by index.php or just url address it does not work, I mean I dont see <div>Home</div> . How to fix it, what do wrong? This is home controller: <?php class ControllerCommonHome extends Controller { public function index() { $this->document->setTitle(

How do I post some variables to a file using opencart?

此生再无相见时 提交于 2019-12-10 10:57:27
问题 I'm having some trouble posting variables within opencart. What I'm trying to do is to grab two variables from text fields on the checkout/login page, called name and address. I want the values entered into these two fields to be stored when the continue button is clicked, and then sent to the checkout/guest page, where i want to echo out these variables. Here is what i have done: Here is my checkout.tpl file, where I am attempting to send the name and address variables to the checkout/guest

How to change theme layout in Opencart?

狂风中的少年 提交于 2019-12-10 10:42:12
问题 Help me on how do i change the layout theme for opencart. I want to have my layout of my site. Thank you. I've tried changing the CSS but it didn't work. 回答1: First of all, check, are you which is theme layout using in your store? Go to Admin > System > Settings > Edit your store > Store Tab > & then check, you are which template selected here. (default or any other template..) Go to your site source > catalog > view > theme > default(the previously selected template) > stylesheet > & then

How to configure Opencart Live site Dynamically?

旧城冷巷雨未停 提交于 2019-12-10 10:35:30
问题 I have an opencart site, which is moved from Local server to Live. How to configure the site path in config.php file 回答1: This is a slight modification we make to Opencart config file to save us time and effort when moving store from development to live server with different paths. Change config.php files with this code // HTTP define('HTTP', $_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/'); define('HTTP_SERVER', 'http://'.HTTP); define('HTTP_IMAGE', 'http://'.HTTP.'image/'); define(

Resource interpreted as Font but transferred with MIME type text/html in Opencart

▼魔方 西西 提交于 2019-12-10 10:09:10
问题 I have seen a lot of answers in stackoverflow about this issue but none of them solve my issue. I am using Opencart Store with custom typography and I see this error: Resource interpreted as Font but transferred with MIME type text/html: "[http://www.11maguen11.com/catalog/view/theme/default/stylesheet/miller-textroman-webfont.woff]". Resource interpreted as Font but transferred with MIME type text/html: "[http://www.11maguen11.com/catalog/view/theme/default/stylesheet/miller-textroman

Get parent category for product page Opencart

China☆狼群 提交于 2019-12-09 17:05:02
问题 is there a way to get the parent category of a product, in the product page for Opencart? Thanks 回答1: Yes you can. I've tested my code in OpenCart 1.5.1.x First, you must modify the file /catalog/controller/product/product.php to add after the line 94: $product_info = $this->model_catalog_product->getProduct($product_id); ADD this: $categories = $this->model_catalog_product->getCategories($product_info['product_id']); if ($categories){ $categories_info = $this->model_catalog_category-

Blank Page At Opencart Admin Side

旧时模样 提交于 2019-12-09 13:11:13
问题 I have setup opencart store at locahost then i uploaded the all stuff to online hosting and changed paths in config.php file in root opencart folder and Admin folder . Front is working fine but Admin side not working . It just shows a blank white page. I debug My Index.php file by placing echo at some places by echo numbers to check it is executing upto that point or not . I was trying to solve this error . I updated my Files code given here. One change is My Log has recently generated this

How to add new module to opencart administration?

喜你入骨 提交于 2019-12-09 05:04:25
问题 I want to add a sub menu item "Locations" to "Catalog" menu item in opencart administration. On selecting locations, I want to see my own location management view page which inetracts with my own locations table in the opencart database. Please let me know where and what mvc's to create to achieve this functionality in open cart. Thank you. 回答1: How to create a opencart admin module?? You can simply do this by adjusting: Admin > controller > view > template > common > header.tpl You can

Can't disable error reporting in OpenCart (PHP)

自古美人都是妖i 提交于 2019-12-09 04:55:07
问题 I can't seem to disable error reporting in PHP - I have tried everything but "Notice" errors are still displayed. My php.ini has display_errors = Off; error_reporting = 0; My .htaccess has php_value error_reporting 0 And my script has ini_set('display_errors', 'Off'); ini_set('log_errors', 1); ini_set('error_reporting', 0); ini_set('display_startup_errors', 'Off'); php_info(); echo $my_undefined_var; The php_info() output confirms that display_errors and error_reporting are indeed off and 0,

opencart - How to manually display a module inside a template file?

一世执手 提交于 2019-12-08 23:59:01
问题 Let's say I want to display the specials module on the homepage in a position different than $content_top, $content_bottom, $column_left or $column_right. How do I do that? If you have some experience with this, could you give me some pointers? The module will be display in home.tpl but I'm assuming I would need to edit the controller file home.php 回答1: To do this, you will need to make edits to two files Firstly, you will need to edit the controller. In this example, I'm going to add the