Posts

Showing posts with the label Opencart

How to remove Security Notification of renaming "admin" folder name in opencart version 4.x

Image
 If you are facing issue like  "Please type in a new admin directory name in the field below."  as a   " Important Security Notification! "   in opencart admin panel like this given below screenshot.  Solutions:          1. Go to this File:- admin  =>   controller => common  =>            2. Edit this file " security.php "          3. Find this line  return $this->load->view('common/security', $data);                   probabally you can find this line in Line No: 50           4. Replace this line with  return ' ';         Now everything is fine and working great.           Happy Coding !!! 😅

Openart 3.0.3.3 Error " Notice: Trying to access array offset on value of type null in vendor\scss.inc.php on line 1753"

Image
 Hi, I was getting a lots of errors while doing disable the cache from opencart admin by clicking on this button. like this "Notice: Trying to access array offset on value of type null in vendor\scss.inc.php on line 1753" to fix this error. I did change this code in the following files storage->vendor->scss.inc.php $key = $key[1]; to $key = isset($key[1]) ? $key[1] : null; Now everything is fine and working great 😅

Opencart 3.0.2.0 While refereshing Theme cache and SASS cache

I was getting error : Trying to access array offset on value of type null in C:\xampp\htdocs\testoc3020\storage\vendor.scss.inc.php on line 1753 Solution : I changed the code in following file in [your opencart storage folder] /vendor/scss.inc.php in following function. code changed is orange color. protected function sortArgs($prototype, $args) { $keyArgs = array(); $posArgs = array(); foreach ($args as $arg) { if(is_array($arg)){ list($key, $value) = $arg; } else { $value = ""; } $key = (is_array($key) && isset($key[1])) ? $key[1] : null; if (empty($key) || is_null($key)) { $posArgs[] = $value; } else { $keyArgs[$key] = $value; } } if (!isset($prototype)) return $posArgs; $finalArgs = array(); foreach ($prototype as $i => $names) { if (isset($posArgs[$i])) { $finalArgs[] = $posArgs[$i]; continue; } $set = false; foreach ((array)$names as $name) { if (isset($k

Opencart Checkout Error iso_code_2 Undefined or iso_code_3 Undefined regarding UPS and USPS shipping method

Hi, if you getting any error like  iso_code_2 Undefined or iso_code_3 Undefined in opencart version 2.3.0.2 regarding UPS and USPS shipping method. or like this error Notice: Undefined index: iso_code_2 in /home/aromis5/public_html/catalog/model/extension/shipping/usps.php on line 36Notice: Undefined index: iso_code_2 in /home/aromis5/public_html/catalog/model/extension/shipping/usps.php on line 286Notice: Undefined index: iso_code_2 in /home/aromis5/public_html/catalog/model/extension/shipping/ups.php on line 147Notice: Undefined index: iso_code_2 in /home/aromis5/public_html/catalog/model/extension/shipping/ups.php on line 147 ------------------------------------------ Notice: Undefined index: iso_code_2 in /home/aromis5/public_html/catalog/model/extension/shipping/usps.php on line 36Notice: Undefined index: iso_code_2 in /home/aromis5/public_html/catalog/model/extension/shipping/usps.php on line 286Notice: Undefined index: iso_code_2 in /home/aromis5/public_html/catalog/model

how to get value from CDATA with simplexmlelement in XML in php

it is a very simple thing. just get cast the value in string that's it see the example below:- <Product_Model> <![CDATA[WH4-P2649]]> </Product_Model> you must have all xml value in given below variale. $productsxml = simplexml_load_string($productsxml); now cast the tag like this . (string) $product->Product_Model; you will surely get your disered result. enjoy 😆😇

Cant use dump() function in twig files or how to enable debug in opencart twig or print_r alternate use dump() in opencart 3.0

if you are facing the following problem. Cant use dump() function in twig files  or  how to enable debug in opencart twig  or  print_r alternate use dump() in opencart 3.0 for fixing this problem follow these steps You can activate dump() function for twig environment by following these steps in opencart 3.0 : Go to system/library/template/Twig/Environment.php Here in the constructor function, you can find $options array . Set 'debug' option to 'true' . Now we need to include debug extension, so add $this->addExtension(new Twig_Extension_Debug()); below. Now you can use  {{ dump(your_variable_name) }} as print_r variable in php That's all 😅😆😛

Opencart version 3.0.2.0 session logout issue

/Hey This is the problem detail written by someone else. ----------------------------------- I'm running my new online store on version 3.0.2.0 and the majority appears to be running smoothly however when I log out I am seeing the following; Account You have been logged off your account. It is now safe to leave the computer. Your shopping cart has been saved, the items inside it will be restored whenever you log back into your account. And then finding I can access my account (as if I was still logged in) by simply clicking on 'My Account' without entering any login information. I'm certain it shouldn't be doing that but haven't got any idea how to go about resolving the problem. Hope someone can help because it's driving my mad trying to fix it!!!! ??? Thanks everyone ;D ----------------------------------- so I found the latest version session file and add this code and problem solved File Name : system->library->session.php

Opencart Version 2.3.0.2 Order Status Update Error

Image
Hi, if you get the same message on order status update in admin <b>Fatal error</b>:  Call to a member function check() on a non-object in <b>/home/storerpg/public_html/vqmod/vqcache/vq2-catalog_model_checkout_order.php</b> on line <b>274</b><br /> and screenshot alert like this. this is the opencart code error. I solved this by changing this line in  catalog -> model -> checkout ->  order.php  SOLUTIONS:  Before Code Line:  $fraud_status_id = $this->{'model_fraud_' . $extension['code']}->check($order_info); Changed Code Line :  $fraud_status_id = $this->{'model_extension_fraud_' . $extension['code']}->check($order_info); Now it is working fine. Enjoy Fixing I did fix this code for opencart Version 2.3.0.2

Opencart Version 3.x UPS shipping method error

Image
Hi, if you getting same message like me for the shipping method UPS Warning: No Shipping options are available. Please contact us for assistance! SOLUTIONS: I found the problem in UPS shipping method code was incorrect. Before Code Line:  if ($this->config->get('ups_' . strtolower($this->config->get('shipping_ups_origin')) . '_' . $code)) { Changed Code Line:   if ($this->config->get(' shipping_ ups_' . strtolower($this->config->get('shipping_ups_origin')) . '_' . $code)) { Now it is working fine. Enjoy Fixing I did fix this code for opencart Version 3.0.2.0

How to test Ocmod extension or module xml file code in Opencart without installing?

Image
Answer : We can simply put our ocmod xml file in ROOT- > SYSTEM(folder) it will work. later on developer can install it in admin Extension->Extensioin Installer

Javascript Error: Uncaught ReferenceError: ga is not defined at HTMLImageElement.onload

Image
Hi, I found this error on my Jquery Page.  Uncaught ReferenceError: ga is not defined     at HTMLImageElement.onload  I added this below script now it has been solved  window['GoogleAnalyticsObject'] = 'ga';   window['ga'] = window['ga'] || function() {     (window['ga'].q = window['ga'].q || []).push(arguments)   };

maximum execution time error when importing sql data file since php.ini has been already set max execution time 3000

I am trying to import a large SQL data file using PHPMyAdmin in localhost This the config file for php.ini  max_exection_time : 30000 already set. but I still getting this problem. so I follow this step and now the problem has been solved. Solution:   There's a configuration variable within the phpMyAdmin directory that I find in  libraries\config.default.php  called  $cfg['ExecTimeLimit']  that I set according to my requirement now it has been fixed.

Remove/Hide/Disable Add to Wishlist and Add to Compare button and links from Openart page from Journal theme

Image
I want to Remove/Hide/Disable Add to Wishlist and Add to Compare button from my Opencart page. I had installed Journal theme. so I found this page and it is working now.

Code Difference between vqmod and ocmod in Opencart

   Vqmod Necessary Code Tags are:-         <id> Extension Name </id>    <version> 1.0.0 </version>    <vqmver> 2.1.5 </vqmver>    <author> Ravi </author>    2.  Ocmod Necessary Code Tags are:-          <name> Extension Name </name>    <version> 1.0.0 </version>    <link> http://opencart.devinlabs.com </link>    <author> Ravi </author>    <code> extension_uniq_code_name </code> ******** Major Differences between Vqmod and Ocmod *********** In Vqmod we Use  "Name" for the file full path but for Ocmod we Use "Path"                             i.e:- Vqmod =      <file name="catalog/controller/common/seo_url.php" error="skip">                          Ocmod =     <file path="admin/view/template/catalog/product_form.tpl">                                        in Ocmod and Vqmod

Opencart Vqmod TPL Problem

Image
Hi after upgradation my vqmod was not working on tpl file. so then I tried this vqmod file and it was fixed. https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=22378&filter_search=vqmod

Change Image size in Opencart for Product image,category image and all image in Opencart version 2.2.0.0 and version 2.3.0.2

Image
Early version of opencart 2.2.0.0,  2.3.0.2  has option of changing the image size in Admin->setting>Image tab but now it has been moved to Admin->Extension->Edit theme before it was in earliest version here:- 

Memory size exhausted Error in PHP, Opencart, Wordpress

Hi, I getting below error in my opencart website. :  Allowed memory size of 67108864 bytes exhausted (tried to allocate 20000 bytes) in  /home/xxx/example.com/system/library/image.php to solving this error. I added these below code after  placing it at the beginning of the file. and problem has been solved. ini_set ( 'memory_limit' , - 1 ); For detail information. I also followed this Q/A. http://stackoverflow.com/questions/1948561/problem-using-imagecreatefromjpeg-and-imagejpeg

Opencart Vqmod Attribute,Position

Vqmod Attributes: 1.  attribute "error"  = this is three types  log|skip|abort .  skip  =  skip means it will simply ignore this file. log =  log is the same as skip. but logs the error. (default) abort   =  abort means to log the error and cancel the remaining operations in that particular xml script. 2.  attribute "position"  = this is seven types  before|after|replace|top|bottom|ibefore|iafter .  before  =  before will insert the add data before the search data. after  =  after will insert the add data after the search data replace  =  replace will replace the data in the search tag with the data in the add tag. (default) top  =  top will insert the add data at the top of the file. The search data is ignored. bottom  =  bottom will insert the add data at the bottom of the file. The search data is ignored. ibefore  =  ibefore will insert the code before the search inline instead of the line before iafter  =  iafter will insert the code after

Opencart and Opebay Pro Error with Ebay,Amazon,Etsy, on Viewing Order

Image
I was Getting this error on Viewing Order on Openbay Pro Fatal error: Class 'Controllerpayment' not found in /home/xxxx/public_html/vqmod/vqcache/vq2-system_storage_modification_system_engine_loader.php on line 36 This error was coming Opencart Version 2.1.0.2 . so I found this is opencart default error. and its solution is already given in Openart Latest Version 2.3.02.  It was Default Opencart Error for Openbay Pro. This error has been solved in Opencart Version 2.3.0.2 so I modified the code according to that. See Code Details here OLD CODE: --------------------------------- // Additional Tabs $data['tabs'] = array(); $this->load->model('extension/extension'); $content = $this->load->controller('payment/' . $order_info['payment_code'] . '/order'); if ($content) { $this->load->language('payment/' . $order_info['payment_code']); $data['tabs'][] = array

opencart 2.0.3.1 to 2.3.0.2 upgradation error

I got this error after up-gradation from opencart 2.0.3.1 to 2.3.0.2. Fatal error: Uncaught exception 'Exception' with message 'Error: Could not load model total!' in C:\xampp\htdocs\deleteme\system\engine\loader.php:169 Stack trace: #0 [internal function]: Loader->{closure}(Array, Array) #1 C:\xampp\htdocs\deleteme\system\engine\proxy.php(25): call_user_func_array(Object(Closure), Array) #2 C:\xampp\htdocs\deleteme\catalog\controller\common\cart.php(37): Proxy->__call('getTotal', Array) #3 C:\xampp\htdocs\deleteme\catalog\controller\common\cart.php(37): Proxy->getTotal(Array) #4 [internal function]: ControllerCommonCart->index(Array) #5 C:\xampp\htdocs\deleteme\system\engine\action.php(51): call_user_func_array(Array, Array) #6 C:\xampp\htdocs\deleteme\system\engine\loader.php(24): Action->execute(Object(Registry), Array) #7 C:\xampp\htdocs\deleteme\catalog\controller\common\header.php(129): Loader->controller('common/cart') #8 [inte