Jump to content

l2phmode

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by l2phmode

  1. Не первый раз работаю с Elcommerce.com.ua Что сказать... Меня все устраивает, все нравится. Хорошая поддержка, лицензия стоит своих денег на любой платный продукт. Есть защита своего ПО, что означает если какой нибудь "фрилансер" захочет нажиться на вашем лицензионном ПО, то у него не выйдет, а вы избежите потенциальных проблем. Ребята порядочные и отзывчивые, принимают во внимание пожелания клиентов в функционале своих модулей, если таковые действительно необходимы не только вам разумеется). Всем рекомендую к сотрудничеству
  2. There is a need to write questions and answers for each product. The solution is very simple. In admin panel go to the products -> customization. Adding 2 Text Fields. First question. The second answer Fill them. Then, edit the current template file Product.tpl Find {if isset($product) && $product->customizable} ..... {/if} and paste this code {if isset($product) && $product->customizable} <div class="answer_question"> <div class="w"> <h2>Answer and Question</h2> <div class="list"> <div class="li"> <!--Customization --> <section class="page-product-box"> <!-- Customizable products --> {if $product->text_fields|intval} <div> <ul id="text_fields"> {counter start=0 assign='customizationField'} {foreach from=$customizationFields item='field' name='customizationFields'} {if $field.type == 1} <li class="customizationUploadLine{if $field.required} required{/if}" style="{if ($smarty.foreach.customizationFields.iteration)%2 == 0}margin-bottom:30px;{else}margin-top:30px;{/if}"> <p>{if ($smarty.foreach.customizationFields.iteration)%2 == 0}Ansfer{else}Question{/if}</p> <p> {assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field} {if !empty($field.name)} {$field.name} {/if} </p> </li> {counter} {/if} {/foreach} </ul> </div> {/if} </section> <!--end Customization --> </div> </div> </div> </div> {/if} You can modify this to a conclusion. Add CSS. As a result, I went like this.
  3. public function preparePosts($nb = 6, $from = null) { $featured = false; $order_by = 'sbp.date_add'; if($from == 'featured') { $from = null; $featured = true; } elseif($from == 'recent'){ $link = mysqli_connect('localhost', 'user', 'qwerty', 'dbname'); $id = (int)Tools::getValue('id_category'); $sql =" SELECT news_category_id FROM ps_category_lang WHERE id_category = '$id' and id_shop = '1' and id_lang = '2'"; $res = mysqli_query($link, $sql); mysqli_close($link); while($row = mysqli_fetch_array($res)) $from = $row['news_category_id']; } elseif($from == 'viewed') { $from = null; $order_by = 'sbp.views'; } elseif($from == 'liked') { $from = null; $order_by = 'sbp.likes'; } else $from = (int)$from; if(!Module::isInstalled('ph_simpleblog') || !Module::isEnabled('ph_simpleblog')) return false; require_once _PS_MODULE_DIR_ . 'ph_simpleblog/models/SimpleBlogPost.php'; $id_lang = $this->context->language->id; $posts = SimpleBlogPost::getPosts($id_lang, (int)$nb, $from, null, true, $order_by, 'DESC', null, (bool)$featured); return $posts; } Thanks
  4. I guess that must be in php module file to initialize variables and get them out of msql. I think there must be something like that. Who will answer both pass a variable from Сategory.php AdminCategoriesController.php in php module file.??? public function initContent() { parent::initContent(); $this->setTemplate(_PS_THEME_DIR_.'category.tpl'); if (!$this->customer_access) { return; } if (isset($this->context->cookie->id_compare)) { $this->context->smarty->assign('compareProducts', CompareProduct::getCompareProducts((int)$this->context->cookie->id_compare)); } // Product sort must be called before assignProductList() $this->productSort(); $this->assignScenes(); $this->assignSubcategories(); $this->assignProductList(); $this->context->smarty->assign(array( 'category' => $this->category, 'description_short' => Tools::truncateString($this->category->description, 350), 'products' => (isset($this->cat_products) && $this->cat_products) ? $this->cat_products : null, 'id_category' => (int)$this->category->id, 'id_category_parent' => (int)$this->category->id_parent, 'return_category_name' => Tools::safeOutput($this->category->name), 'path' => Tools::getPath($this->category->id), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'categorySize' => Image::getSize(ImageType::getFormatedName('category')), 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), 'thumbSceneSize' => Image::getSize(ImageType::getFormatedName('m_scene')), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'allow_oosp' => (int)Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int)Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'suppliers' => Supplier::getSuppliers(), 'body_classes' => array($this->php_self.'-'.$this->category->id, $this->php_self.'-'.$this->category->link_rewrite) )); }
  5. {if isset($subcategories)} <!-- Subcategories --> <div id="subcategories"> <ul class="row clearfix"> {foreach from=$subcategories item=subcategory} <li class="col-xs-4 col-md-4"> <div class="subcategory-image"> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}" class="img"> {if $subcategory.id_image} <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'category_thumbs')|escape:'html':'UTF-8'}" alt="" /> {else} <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-category_thumbs.jpg" alt="" /> {/if} </a> </div> <h5><a class="subcategory-name" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}">{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'|truncate:350}</a></h5> {if $subcategory.description} <div class="cat_desc">{$subcategory.description}</div> {/if} </li> {/foreach} {include file="./static-seo-page.tpl"} </ul> </div> {/if} You need chenge category.tpl. Chenge class in subcategories col-xs-2 col-sm-2 to col-..-4
  6. <div class="content_scene_cat"> <div class="content_scene_cat_bg col-xs-12 col-sm-6 col-md-6 col-lg-6" style="min-height: 217px; background: url("http://hp-projects.nl/img/c/4-category_default.jpg") right center / cover;"></div> <div class="cat_desc col-xs-12 col-sm-6 col-md-6 col-lg-6"></div> </div> To do this, you must change a little Category.tpl file. Print <div class=" cat_desk"> beyond <div class=" content_scene_cat_bg">. When Babe add classes col
  7. Display the picture should look like , and do not understand the problem . Display the picture should look like , and do not understand the problem .
  8. Modification module ph_blog_column_custom, display-specific blog category in certain categories. The following actions were taken to address this problem. Add to DB ALTER TABLE `ps_category_lang` ADD `news_category_id` text AFTER `description`; In controllers/admin/AdminCategoriesController.php array( 'type' => 'text', 'label' => $this->l('News Category ID:'), 'name' => 'news_category_id', 'autoload_rte' => true, 'lang' => true, 'rows' => 10, 'cols' => 100, 'hint' => $this->l('Invalid characters:').' <>;=#{}' ), In classes/Category.php /** @var string News Category ID */ public $news_category_id; And 'news_category_id' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'), In Category.tpl varible display ok. For Display CMS news in Left column add in Tools.php public static function getCMSTitle($id_cms,$id_lang){ $cms = new CMS($id_cms, $id_lang); return $cms->meta_title; } public static function getCMSDescription($id_cms,$id_lang){ $cms = new CMS($id_cms, $id_lang); return $cms->content; } Output in header.tpl {if isset ($category->news_category_id)} <a class="list-group-item" href="{$link->getCMSLink($category->news_category_id, $cmspages.link_rewrite)|escape:'html':'UTF-8'}"> {Tools::getCMSTitle($category->news_category_id,$cookie->id_lang)}</a> {Tools::getCMSDescription($category->news_category_id,$cookie->id_lang)} {/if} This solution works well. But there is a problem specific module to display news. In module ph_blog_column_custom.php Part of the code for the withdrawal of a certain module category. public function preparePosts($nb = 6, $from = null) { $featured = false; $order_by = 'sbp.date_add'; if($from == 'featured') { $from = null; $featured = true; } elseif($from == 'recent') $from = null; elseif($from == 'viewed') { $from = null; $order_by = 'sbp.views'; } elseif($from == 'liked') { $from = null; $order_by = 'sbp.likes'; } else $from = (int)$from; if(!Module::isInstalled('ph_simpleblog') || !Module::isEnabled('ph_simpleblog')) return false; require_once _PS_MODULE_DIR_ . 'ph_simpleblog/models/SimpleBlogPost.php'; $id_lang = $this->context->language->id; $posts = SimpleBlogPost::getPosts($id_lang, (int)$nb, $from, null, true, $order_by, 'DESC', null, (bool)$featured); return $posts; } It is necessary to bring in the code variable. if($from == 'featured') { // $from = null;- number category // chenge $from = $category->news_category_id; $featured = true; } But this design refuses to work. Help solve the problem.
  9. {if isset($combinationImages)} {foreach from=$combinationImages item='combination' key='combinationId' name='f_combinationImages'} {foreach from=$combination item='image' name='f_combinationImage'} {if $previd != $image.id_image} {assign (to array) $color_image = $image.id_image} {/if} {/foreach} {assign var="previd" value=$image.id_image} {/foreach} {/if} //// Outpu background-image:url({$link->getImageLink($product->link_rewrite, $color_image.number, 'small_default')|escape:'html':'UTF-8'}) I think this design would help . I think this design would help .
  10. Thank you for example. But it is not really suitable for the variant with multiple attributes. I made one more example but it shows the 2 different images for different color. How can bind to ps_attribute_image? What would be the correct operation. <ul id="color_to_pick_list" class="clearfix"> {assign var="default_colorpicker" value=""} {foreach from=$group.attributes key=id_attribute item=group_attribute} {assign var='img_color_exists' value=file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')} {foreach from=$combinationImages item='combination' key='combinationId' name='f_combinationImages'} {foreach from=$combination item='image' name='f_combinationImage'} {if $previd != $image.id_image} <li{if $group.default == $id_attribute} class="selected"{/if}> <a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" id="color_{$id_attribute|intval}" name="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}"{if !$img_color_exists && isset($colors.$id_attribute.value) && $colors.$id_attribute.value} style="background-image:url({$link->getImageLink($product->link_rewrite, $image.id_image, 'small_default')|escape:'html':'UTF-8'});width:100px;height:100px;"{/if} title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" {if $img_color_exists}style="background: url({$img_col_dir}{$id_attribute|intval}.jpg) repeat;"{/if}></a> </li> {/if} {/foreach} {assign var="previd" value=$image.id_image} {/foreach} {if ($group.default == $id_attribute)} {$default_colorpicker = $id_attribute} {/if} {/foreach} </ul>
  11. It is necessary to solve this problem. Instead, the product color display images of the combination product. How Get $attribute.id_image? <ul id="color_to_pick_list" class="clearfix"> {assign var="default_colorpicker" value=""} {foreach from=$group.attributes key=id_attribute item=group_attribute} {assign var='img_color_exists' value=file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')} <li{if $group.default == $id_attribute} class="selected"{/if}> <a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" id="color_{$id_attribute|intval}" name="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}" {if !$img_color_exists && isset($colors.$id_attribute.value) && $colors.$id_attribute.value} style="background-image:url({$link->getImageLink($product->link_rewrite, $attribute.id_image, 'small_default')|escape:'html':'UTF-8'});"{/if} title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" {if $img_color_exists}style="background: url({$img_col_dir}{$id_attribute|intval}.jpg) repeat;"{/if}></a> </li> {if ($group.default == $id_attribute)} {$default_colorpicker = $id_attribute} {/if} {/foreach} </ul> Please tell me how to do?
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More