opencart

Remove the image resize ratio in OpenCart

爱⌒轻易说出口 提交于 2019-12-03 08:22:39
I've look everywhere on how I could remove the image resizing in OpenCart but haven't find nothing about that. I need that it resize but don't keep the ratio. I want the image to be just like I set it. Here's the resize code in the system/library/image.php public function resize($width = 0, $height = 0) { if (!$this->info['width'] || !$this->info['height']) { return; } $xpos = 0; $ypos = 0; $scale = min($width / $this->info['width'], $height / $this->info['height']); if ($scale == 1) { return; } $new_width = (int)($this->info['width'] * $scale); $new_height = (int)($this->info['height'] *

OpenCart load Model outside Controller

你说的曾经没有我的故事 提交于 2019-12-03 03:32:38
I'm working on an OpenCart project, that requires a lot of customization. for my project I have to change something in the cart library (system/library/cart.php). I would have to call a custom function that's defined inside the product model (catalog/model/catalog/product.php). In a controller, loading a Model and using its functions is easy: $this->load->model("catalog/product"); $this->model_catalog_product->customFunction(); But how do you load a model outside a controller? You can't create a new instance of the model, I already tried that: require_once("catalog/model/catalog/product.php");

Opencart 3.x category id in product page

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using opencart 3.0.2.0 I'm trying to get category id in the product page. Any suggestions ? 回答1: If you just want to get category id in the product page Open product.php file from catalog/controller/product and search for $product_info = $this->model_catalog_product->getProduct($product_id); replace it with $product_info = $this->model_catalog_product->getProduct($product_id); $query_categories = $this->model_catalog_product->getCategories($product_id); $categories = array(); foreach ($query_categories as $cat) { $ocb_category = $this-

Why is OpenCart 2.3 custom theme not showing?

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I've read through some guides and watched a YouTube video on how to create a custom theme for OpenCart. After trying various things it still doesn't seem to be working right. If I go to 'Extensions > Themes > Edit Store' I can switch the theme directory but this doesn't seem right. The question bubble there says changing the theme directory here is only for legacy support of older themes. Current themes should be available through 'System > Settings > Edit Store > General Tab (Select Theme Dropdown). Why doesn't this seem to work?

Opencart minimum order price exclude one category

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using opencart and successfully added minimum order price for all transactions. This is the code I used: <?php if ($this->cart->getSubtotal() >= 10) { ?> <div id="payment"><?php echo $payment; ?></div> <?php } else { ?> <div class="warning">Minimum 10 Euro to checkout</div> <?php } ?> Now I want to exclude one category out of it so that $9 product from that category can be bought. Update 1: Thank you so much for the help shadyyx I tried shadyyx method but I am getting this error: unexpected T_BOOLEAN_OR in this line <?php if ($this-

Check module position in OpenCart 2.0

匿名 (未验证) 提交于 2019-12-03 00:50:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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. This is working like charm. Step 1 in .tpl file.

OpenCart商城开发 OpenCart App开发 OpenCart微信小程序开发

匿名 (未验证) 提交于 2019-12-02 23:52:01
OpenCart商城开发 OpenCart App开发 OpenCart微信小程序开发 珠海艺诚网络科技有限公司 更多业务请百度和淘宝搜索: 艺诚网络 www.skillcredit.com 艺诚网络 | 山高人为峰,艺精诚为本! 艺诚网络 我们是一群怀揣着一点点梦想的年轻人; 我们相信技术和创新的力量; 我们倾向于组建小而精悍的团队; 我们喜欢快速反应的工作节奏; 我们热爱正在从事的工作,那是我们相当一部分的乐趣所在; 我们会不自觉的尝试各种新潮互联网技术; 我们相信网络「改变世界」! 联系人:符××× 微信:13226056807 QQ:865500666 What's OpenCart? Opencart is an easy to-use, powerful, Open Source online store management program that can manage multiple online stores from a single back-end. Administrative area simply by filling in forms and clicking “Save”. There are many professionally-written extensions available to customize the store to

网站运维:opencart 3.0安装中文语言包

匿名 (未验证) 提交于 2019-12-02 23:40:02
版权声明:原创内容,欢迎转载 https://blog.csdn.net/weixin_43731793/article/details/91420249 1、下载安装包 OpenCart 3.x版本语言包的安装遵循OCMOD模式,步骤如下: 从如下网站其一下载本语言包,下载后名称为: oc_3x.ocmod.zip https://www.opencart.com/index.php?route=marketplace/download&extension_id=15172&member_token=7WgTQEYRSYSsklrFvstAJbKa9qUjXyD7 PS:需要注册账号 2、 登录您的网站后台,打开如下路径:【extensions】->【installer】,如下界面: 3、添加成功 4、安装完毕后,访问后续路径【system】->【localisation】->[languages],点击界面右上角的新增按钮,如下图所示: 5、新增页面如下图所示填写相关信息: Language Name: 简体中文 Code: zh-cn Locale: zh-CN,zh-CN.UTF-8,zh-cn Status: Enabled Sort Order: 随意数字 6、设定后台默认显示语言 设置路径为【system】->【settings】,点 action ,如下图所示: 7

OpenCart - View alternate product template based on arbitrary product field

你。 提交于 2019-12-02 22:56:18
问题 There is another post on Stack Overflow that includes the following code for serving multiple product templates based on product ID //42 is the id of the product if ($this->request->get['product_id'] == 42) { if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/customproduct.tpl')) { $this->template = $this->config->get('config_template') . '/template/product/customproduct.tpl'; } else { $this->template = 'default/template/product/customproduct.tpl'; } }

Specific template for category and product page in OpenCart 2.2.0.0

柔情痞子 提交于 2019-12-02 18:39:30
问题 I am using OpenCart version 2.2.0.0 and trying to set different template for each category and product page. Searching online I found following code: if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category_' . $category_id . '.tpl')) { $this->template = $this->config->get('config_template') . '/template/product/category_' . $category_id . '.tpl'; } elseif (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category