Add new features to cmsproducts module and update version to 1.6.5
- Implement methods for returning customer gallery by product and category - Update blog template for improved formatting and readability - Add new exception log for January 2025 and remove outdated log from September 2024 - Introduce CSS styles for blog detail layout
This commit is contained in:
@@ -17,7 +17,7 @@ class cmsproducts extends Module
|
||||
$this->name = 'cmsproducts';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->author = 'MyPresta.eu';
|
||||
$this->version = '1.6.4';
|
||||
$this->version = '1.6.5';
|
||||
$this->bootstrap = 1;
|
||||
$this->mypresta_link = 'https://mypresta.eu/modules/front-office-features/products-on-cms-pages.html';
|
||||
parent::__construct();
|
||||
|
||||
12
modules/cmsproducts/config_pl.xml
Normal file
12
modules/cmsproducts/config_pl.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>cmsproducts</name>
|
||||
<displayName><![CDATA[Products on CMS pages]]></displayName>
|
||||
<version><![CDATA[1.6.4]]></version>
|
||||
<description><![CDATA[Module allows to display lists of products on your shop CMS pages]]></description>
|
||||
<author><![CDATA[MyPresta.eu]]></author>
|
||||
<tab><![CDATA[front_office_features]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
BIN
modules/cmsproducts/logo.webp
Normal file
BIN
modules/cmsproducts/logo.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@@ -350,6 +350,30 @@ class CmsController extends CmsControllerCore
|
||||
return $this->noModuleMessage("<a href=\"https://mypresta.eu/modules/front-office-features/last-product-reviews.html\">[Last Product Reviews by Mypresta]</a>");
|
||||
}
|
||||
|
||||
public function returnCustomersGalleryProduct($id_product=0) {
|
||||
if ($id_product == 0 || !is_int($id_product)) {
|
||||
$customersgallery = Module::getInstanceByName('customersgallery');
|
||||
if ($customersgallery != false) {
|
||||
if (method_exists($customersgallery, 'shortcode_by_product')) {
|
||||
return $customersgallery->shortcode_by_product($id_product);
|
||||
}
|
||||
}
|
||||
return $this->noModuleMessage("<a href=\"https://mypresta.eu/modules/front-office-features/customer-photo-gallery.html\">[CustomersGallery by Mypresta]</a>");
|
||||
}
|
||||
}
|
||||
|
||||
public function returnCustomersGalleryCategory($id_category=0) {
|
||||
if ($id_category == 0 || !is_int($id_category)) {
|
||||
$customersgallery = Module::getInstanceByName('customersgallery');
|
||||
if ($customersgallery != false) {
|
||||
if (method_exists($customersgallery, 'shortcode_by_category')) {
|
||||
return $customersgallery->shortcode_by_category($id_category);
|
||||
}
|
||||
}
|
||||
return $this->noModuleMessage("<a href=\"https://mypresta.eu/modules/front-office-features/customer-photo-gallery.html\">[CustomersGallery by Mypresta]</a>");
|
||||
}
|
||||
}
|
||||
|
||||
public function returnContent($contents)
|
||||
{
|
||||
preg_match_all('/\[ccarousel\:[(0-9\,)]+\]/i', $contents, $matches);
|
||||
@@ -405,6 +429,18 @@ class CmsController extends CmsControllerCore
|
||||
$contents = str_replace($match, $this->returnProductsDiffTool(str_replace("}", "", $explode[1])), $contents);
|
||||
}
|
||||
|
||||
preg_match_all('/\{customersgallery\-product\:[(0-9)]+\}/i', $contents, $matches);
|
||||
foreach ($matches[0] as $index => $match) {
|
||||
$explode = explode(":", $match);
|
||||
$contents = str_replace($match, $this->returnCustomersGalleryProduct(str_replace("}", "", $explode[1])), $contents);
|
||||
}
|
||||
|
||||
preg_match_all('/\{customersgallery\-category\:[(0-9)]+\}/i', $contents, $matches);
|
||||
foreach ($matches[0] as $index => $match) {
|
||||
$explode = explode(":", $match);
|
||||
$contents = str_replace($match, $this->returnCustomersGalleryCategory(str_replace("}", "", $explode[1])), $contents);
|
||||
}
|
||||
|
||||
return $contents;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
{*
|
||||
{*
|
||||
* @Module Name: Leo Blog
|
||||
* @Website: leotheme.com.com - prestashop template provider
|
||||
* @author Leotheme <leotheme@gmail.com>
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="alert alert-warning">{l s='Sorry, We are updating data, please come back later!!!!' mod='leoblog'}</div>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
{else}
|
||||
<div id="blogpage">
|
||||
<article class="blog-detail">
|
||||
{if $is_active}
|
||||
@@ -31,31 +31,31 @@
|
||||
{/if}
|
||||
|
||||
{if $config->get('item_show_category','1')}
|
||||
<span class="blog-cat">
|
||||
<i class="material-icons">list</i> <span>{l s='In' mod='leoblog'}: </span>
|
||||
<span class="blog-cat">
|
||||
<i class="material-icons">list</i> <span>{l s='In' mod='leoblog'}: </span>
|
||||
<a href="{$blog->category_link|escape:'html':'UTF-8'}" title="{$blog->category_title|escape:'html':'UTF-8'}">{$blog->category_title|escape:'html':'UTF-8'}</a>
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
{if $config->get('item_show_created','1')}
|
||||
<span class="blog-created">
|
||||
<i class="material-icons"></i> <span>{l s='On' mod='leoblog'}: </span>
|
||||
<time class="date" datetime="{strtotime($blog->date_add)|date_format:"%Y"|escape:'html':'UTF-8'}">
|
||||
<i class="material-icons"></i> <span>{l s='On' mod='leoblog'}: </span>
|
||||
<time class="date" datetime="{strtotime($blog->date_add)|date_format:"%Y"|escape:'html':'UTF-8'}">
|
||||
{assign var='blog_date' value=strtotime($blog->date_add)|date_format:"%A"}
|
||||
{l s=$blog_date mod='leoblog'}, <!-- day of week -->
|
||||
{assign var='blog_month' value=strtotime($blog->date_add)|date_format:"%B"}
|
||||
{l s=$blog_month mod='leoblog'} <!-- month-->
|
||||
{assign var='blog_day' value=strtotime($blog->date_add)|date_format:"%e"}
|
||||
{l s=$blog_day mod='leoblog'} <!-- day of month -->
|
||||
{assign var='blog_year' value=strtotime($blog->date_add)|date_format:"%Y"}
|
||||
{l s=$blog_month mod='leoblog'} <!-- month-->
|
||||
{assign var='blog_day' value=strtotime($blog->date_add)|date_format:"%e"}
|
||||
{l s=$blog_day mod='leoblog'} <!-- day of month -->
|
||||
{assign var='blog_year' value=strtotime($blog->date_add)|date_format:"%Y"}
|
||||
{l s=$blog_year mod='leoblog'} <!-- year -->
|
||||
</time>
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
|
||||
{if isset($blog_count_comment)&&$config->get('item_show_counter','1')}
|
||||
<span class="blog-ctncomment">
|
||||
<i class="material-icons">comment</i> <span>{l s='Comment' mod='leoblog'}:</span>
|
||||
<i class="material-icons">comment</i> <span>{l s='Comment' mod='leoblog'}:</span>
|
||||
{$blog_count_comment|intval}
|
||||
</span>
|
||||
{/if}
|
||||
@@ -79,8 +79,8 @@
|
||||
{/if}
|
||||
{$blog->content nofilter}{* HTML form , no escape necessary *}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{if trim($blog->video_code)}
|
||||
<div class="blog-video-code">
|
||||
@@ -96,11 +96,11 @@
|
||||
{if $tags}
|
||||
<div class="blog-tags">
|
||||
<span>{l s='Tags:' mod='leoblog'}</span>
|
||||
|
||||
|
||||
{foreach from=$tags item=tag name=tag}
|
||||
<a href="{$tag.link|escape:'html':'UTF-8'}" title="{$tag.tag|escape:'html':'UTF-8'}"><span>{$tag.tag|escape:'html':'UTF-8'}</span></a>
|
||||
{/foreach}
|
||||
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -150,11 +150,11 @@
|
||||
{include file="module:leoblog/views/templates/front/default/_facebook_comment.tpl"}
|
||||
{elseif $config->get('item_comment_engine','local')=='diquis'}
|
||||
{include file="module:leoblog/views/templates/front/default/_diquis_comment.tpl"}
|
||||
|
||||
|
||||
{else}
|
||||
{include file="module:leoblog/views/templates/front/default/_local_comment.tpl"}
|
||||
{/if}
|
||||
|
||||
|
||||
{elseif $config->get('item_show_listcomment','1') == 0 && $config->get('item_show_formcomment','1') == 1}
|
||||
<div class="blog-comment-block clearfix">
|
||||
{include file="module:leoblog/views/templates/front/default/_local_comment.tpl"}
|
||||
@@ -169,7 +169,7 @@
|
||||
{hook h='displayApSC' sc_key=sc3749181901}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="hidden-xl-down hidden-xl-up datetime-translate">
|
||||
{l s='Sunday' mod='leoblog'}
|
||||
{l s='Monday' mod='leoblog'}
|
||||
@@ -178,7 +178,7 @@
|
||||
{l s='Thursday' mod='leoblog'}
|
||||
{l s='Friday' mod='leoblog'}
|
||||
{l s='Saturday' mod='leoblog'}
|
||||
|
||||
|
||||
{l s='January' mod='leoblog'}
|
||||
{l s='February' mod='leoblog'}
|
||||
{l s='March' mod='leoblog'}
|
||||
@@ -191,7 +191,7 @@
|
||||
{l s='October' mod='leoblog'}
|
||||
{l s='November' mod='leoblog'}
|
||||
{l s='December' mod='leoblog'}
|
||||
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user