Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Add One More Images Group To Product? Rate Topic   - - - - -

  • avklimin
  • Newbie
  • Members
  • Join Date: 04-Dec 17
  • 1 posts

Posted 04 December 2017 - 10:08 AM #1

Hi evryone! I need to add some new images group to product. It's not default image, and not additional images for main product image. I need to add absolutely diferent images group. In practic it's floor plans for building. I found this: https://www.cs-cart...._subsystem.html, but can't understand how to make it for product page. In my module I have this 2 files: update_detailed_images.post.tpl as template, and hook for controller - products.post.php. 


In first file I put this: 

{include file="common/attach_images.tpl" image_name="a_parser" image_object_type="a_parser" image_pair=$a_parser.main_pair image_object_id=$a_parser.product_id no_detailed=true hide_titles=true}

In second I can't to understood what I must to write, now it's:

$a_parser_images_links = fn_attach_image_pairs('a_parser', 'a_parser', 0, 'a_parser');
$a_parser_images_links['main_pair'] = fn_get_image_pairs($a_parser, 'a_parser', 'M', 'a_parser');
Tygh::$app['view']->assign('a_parser_images_links', $a_parser);

And in addon.xml I put this:

        <item>DROP TABLE IF EXISTS ?:a_parser_images;</item>
        <item>DROP TABLE IF EXISTS ?:a_parser_images_links;</item>
            CREATE TABLE IF NOT EXISTS `?:a_parser_images_links` (
            `pair_id` mediumint(8) unsigned NOT NULL,
            `object_id` int(11) unsigned NOT NULL DEFAULT '0',
            `object_type` varchar(24) NOT NULL DEFAULT '',
            `image_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
            `detailed_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
            `type` char(1) NOT NULL DEFAULT 'M',
            `position` int(11) NOT NULL DEFAULT '0'
            CREATE TABLE `?:a_parser_images` (
            `a_parser_image_id` mediumint(8) unsigned NOT NULL auto_increment,
            `a_parser_id` mediumint(8) unsigned NOT NULL default 0,
            `lang_code` char(2) NOT NULL default '',
            PRIMARY KEY  (`a_parser_image_id`),
            UNIQUE KEY  `a_parser` (`a_parser_id`,`lang_code`)
            ) Engine=MyISAM DEFAULT CHARSET UTF8;
        <item for="uninstall">DROP TABLE IF EXISTS ?:a_parser_images;</item>
        <item for="uninstall">DROP TABLE IF EXISTS ?:a_parser_images_links;</item>

GURU, plese help me!!!  :confused: