opencart2.x

Opencart how to related 2 options in a product

浪尽此生 提交于 2019-12-25 05:07:05
问题 Hello I have the following problem. I have a product with two different options, size and color. But I didn't know how to related this options when someone is buying a product. For example. I have 4 T-shirt on my inventory 2 Blue T-shirt size S 1 Green T-shirt size L 1 Yellow T-shirt size XL I configured the product with these requirement options (size and color), but for example a customer can buy a T-shirt size XL color blue and that's wrong because I didn't have a way to related the color

access session data of opencart through php file

陌路散爱 提交于 2019-12-24 22:26:19
问题 I am new to opencart. I have my basic php code at http://localhost/testphp and my opencart is installed at http://localhost/opencart . What I want to do is that in testphp , I have a page in which I want to check that if any user is logged in or not at opencart . If it is logged in then I want to perform x function and It not logged in then want to perform y function I have tried to logged in to opencart and tried to print_r($_SESSION) in testphp. It is returning blank. How can I perform this

OpenCart 2.0: How To Remove Billing Details from Chekout Page

荒凉一梦 提交于 2019-12-24 02:12:26
问题 Basically, I want to remove Step 2: Billing Details from the Checkout Page of OpenCart 2.0. My site will only be accepting bank deposits, cash on delivery, and pickup from store as methods of payment so I will not be needing Step 2. How do I go about this? I've seen a lot of how-tos but not for OpenCart 2.0. The code seems to have changed quite a bit from the previous releases and I'm at a lost. Thank you for the help! 回答1: I know this is quite old but i just got stuck with the same problem

How does free checkout work in Opencart 2?

老子叫甜甜 提交于 2019-12-23 20:14:08
问题 I am trying to make a development site where I can add products to my cart and delivery options - and then checkout. I want to be able to do dummy orders without using real cards or payment gateways I have enabled free checkout but it does not appear on the OpenCart admin panel? 回答1: In OpenCart, Free Checkout payment option only show up when order total equals to zero . To enable/disable Free Checkout: /Admin => Extensions => Payments => Free Checkout Remember, it's only show up when Total =

Add a Custom Field on Opencart admin 'Order Info' page

痴心易碎 提交于 2019-12-23 08:56:35
问题 I want to add custom field on opencart admin order pages. compare value like if oc_order.order_id = oc_custom_table.order_id then display oc_custom_table.comment on admin order list. display same thing on admin order info page. I added a custom function in admin_model_order.php page where there all all queries. public function getCustomTable($order_id) { $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "custom_table WHERE order_id = '" . (int)$order_id . "'"); return $query->rows; }

Accessing class properties and methods from template

拈花ヽ惹草 提交于 2019-12-23 00:51:17
问题 Prior to Opencart 2.0 class properties could be accessed directly from the template. For example, $this->config->get('config_language') or $this->request->get['route'] were both accessible from an admin template file. With the new method $this->load->view() , neither of these work. Is there a simple way to pass on class methods and properties which are available in the current controller to the tpl without explicitly adding them to the $data array? 回答1: In Opencart version 2, if you want

Opencart minimum order price

戏子无情 提交于 2019-12-19 04:49:08
问题 I am trying to implement below code from here in catalogue/view/theme/default/template/checkout/confirm.tpl <?php if ($this->cart->getSubtotal() >= 1000) { ?> <div id="payment"><?php echo $payment; ?></div> <?php } else { ?> <div class="warning">Minimum 10 Euro to checkout</div> <?php } ?> but i am getting an error Notice: Undefined property: Loader::$cart in C:\xampp\htdocs\optest\catalog\view\theme\default\template\checkout\confirm.tpl on line 51 Fatal error: Call to a member function

Send Attachment in PHP with OpenCart 2.1.1.1

扶醉桌前 提交于 2019-12-19 03:24:14
问题 Does anyone with knowledge of OpenCart 2.0.1.1 know how I could implement the following addAttachment function found in system/libary/mail.php: public function addAttachment($filename) { $this->attachments[] = $filename; } into catalog/controller/information/contact.php - so that the default contact form can also include an attachment upload feature? I tried this but no dice. if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) { unset($this->session->data['captcha']

How to insert module in header tpl file in opencart 2.0?

泪湿孤枕 提交于 2019-12-13 02:39:13
问题 How to insert a module in header.tpl file in opencart 2.0 ? I have a module. Does not have the layout position option for that module. So i need to place that manually in header.tpl file. I am already tried this but not working for opencart 2.0. Please any one help me. Thanks 回答1: In opencart 2.0 or above you can load the contoller of module :- $data['anyname'] = $this->load->controller('modulefolder/filename'); And In that module's controller file there should be a return of what it render

Check module position in OpenCart 2.0

荒凉一梦 提交于 2019-12-12 10:59:29
问题 I was using following code for Check module position. So, It is working fine in OpenCart 1.5.6. When module Enabled in Content left & right panel so I want to hide javascript code in OpenCart but, it is not working in Opencart 2.0 How can be achieved in Opencart 2.0? in .tpl file <?php if ($module['position'] == 'content_bottom' || $module['position'] == 'content_top') { ?> //add your code Here <?php } ?> add in .php file $this->data['module'] = $setting; 回答1: I have found simple solution.