Post by mtjhost » Tue Jul 25, 2017 2:39 am

Fatal error: Uncaught exception 'Exception' with message 'Error: Duplicate entry '63-1' for key 'PRIMARY'<br />Error No: 1062<br />INSERT INTO oc_information_description SET information_id = '63', language_id = '1', title = 'Hi fdfdfd', description = '&lt;p&gt;dfdfdf dfdf dfd fd f df h ghghghg gh ghghghgh ghgghh&lt;/p&gt;\r\n', meta_title = 'Hi fdfdfd', meta_description = '', meta_keyword = ''' in /home/store/public_html/vqmod/vqcache/vq2-system_library_db_mysqli.php:40 Stack trace: #0 /home/store/public_html/vqmod/vqcache/vq2-system_storage_modification_system_library_db.php(73): DB\MySQLi->query('INSERT INTO oc_...', Array) #1 /home/store/public_html/vqmod/vqcache/vq2-admin_model_catalog_information.php(15): DB->query('INSERT INTO oc_...') #2 [internal function]: ModelCatalogInformation->addInformation(Array) #3 /home/store/public_html/system/vendor/multimerchlib/module/autogenerated/system/engine/oc_loader-2.3.php(179): call_user_func_array(Array, Array) #4 [internal function]: oc_loader->{closure}(Array, Arr in /home/store/public_html/vqmod/vqcache/vq2-system_library_db_mysqli.php on line 40


OC version 2.3.0.2 and having Multimerch installed with custom theme

New member

Posts

Joined
Wed Apr 30, 2014 12:37 am

Post by daniil_oc » Mon Oct 23, 2017 5:13 am

Hello!

I'm using shortcode for adding description to the similar products by using information pages

So, here's the code:

Code: Select all

<?php class ShortcodesCustom extends Controller {
  function info_content($atts) {
    extract($this->shortcodes->shortcode_atts(array(
       'id' => '',
    ), $atts));

    if ($id) {
      $this->load->model('catalog/information');
      $information_info = $this->model_catalog_information->getInformation($id);     
      if ($information_info) {
                $infotext = html_entity_decode($information_info['description'], ENT_QUOTES, 'UTF-8');
                return $infotext;
                }
            } else {
                return $content;
            }
  
    }
  }
?>
I'm doubtfull about the final part I took from the xml file. Is it legit? What $content should show? Maybe return ''; would be better?

Newbie

Posts

Joined
Mon Aug 19, 2013 4:05 am
Who is online

Users browsing this forum: No registered users and 13 guests