Skip to content

Commit

Permalink
Maintenance by Magepow.com
Browse files Browse the repository at this point in the history
  • Loading branch information
magiccart committed Jun 3, 2021
1 parent fa5a1c1 commit fddbef3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 31 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magiccart/testimonial",
"description": "Testimonial magento 2.",
"require": {
"magiccart/community" : ">=1.0"
"magepow/core" : ">=1.0"
},
"type": "magento2-module",
"license": [
Expand All @@ -12,8 +12,8 @@
"authors": [
{
"name": "Alothemes",
"email": "support@alothemes.com",
"homepage": "https://alothemes.com",
"email": "support@magepow.com",
"homepage": "https://magepow.com",
"role": "Technical Support"
}
],
Expand Down
52 changes: 24 additions & 28 deletions view/frontend/templates/testimonial-center-mode.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if(!count($testimonials)) return;
<div class="content sub-text zoomIn"><?php echo $testimonial->getText(); ?></div>
<div class="product-reviews-summary short">
<div class="rating-summary">
<span class="label"><span>Rating:</span></span>
<span class="label"><span><?php echo __('Rating')?>:</span></span>
<div class="rating-result" title="<?php echo ceil($testimonial->getRatingSummary() * 20) ?>%">
<span style="width:<?php echo ceil($testimonial->getRatingSummary() * 20) ?>%"><span><?php echo ceil($testimonial->getRatingSummary() * 20) ?>%</span></span>
</div>
Expand All @@ -44,33 +44,29 @@ if(!count($testimonials)) return;
</div>

<script type="text/javascript">
require([
'jquery',
'magiccart/slick'
], function($){
var el = $('.<?php echo $selector ?> .testimonial');
if(!el.length) return;
var options = el.data();
var iClass = '.alo-item';
el.children().addClass(iClass);
iClass = '.alo-item';
var selector = el.selector;
var classes = selector + ' '+ iClass;
var padding = options.padding;
var slider;
var style = padding ? classes + '{float: left; padding-left: '+padding+'px; padding-right:'+padding+'px} ' + selector + '{margin-left: -'+padding+'px; margin-right: -'+padding+'px}' : '';
if(options.slidesToShow){
if(el.hasClass('slick-initialized')) el.slick("refresh");
else $(el).slick(options);
var caption = $('.<?php echo $selector ?> .testimonial-caption');
var testimonial_text = el.find('.slick-current.slick-center .testimonial_text');
require(['jquery', 'slick'], function($){
var el = $('.<?php echo $selector ?> .testimonial');
if(!el.length) return;
var options = el.data();
var iClass = '.alo-item';
el.children().addClass(iClass);
iClass = '.alo-item';
var selector = el.selector;
var classes = selector + ' '+ iClass;
var padding = options.padding;
var slider;
var style = padding ? classes + '{float: left; padding-left: '+padding+'px; padding-right:'+padding+'px} ' + selector + '{margin-left: -'+padding+'px; margin-right: -'+padding+'px}' : '';
if(options.slidesToShow){
if(el.hasClass('slick-initialized')) el.slick("refresh");
else $(el).slick(options);
var caption = $('.<?php echo $selector ?> .testimonial-caption');
var testimonial_text = el.find('.slick-current.slick-center .testimonial_text');
if(testimonial_text.length) caption.html(testimonial_text.html());
el.on('afterChange', function (event, slick, currentSlide, nextSlide) {
testimonial_text = $(slick.$slides.get(currentSlide)).find('.testimonial_text');
if(testimonial_text.length) caption.html(testimonial_text.html());
el.on('afterChange', function (event, slick, currentSlide, nextSlide) {
testimonial_text = $(slick.$slides.get(currentSlide)).find('.testimonial_text');
if(testimonial_text.length) caption.html(testimonial_text.html());
});
}
$('head').append('<style type="text/css">'+style+'</style>'); // return '<style type="text/css">'+style+'</style>';

});
}
$('head').append('<style type="text/css">'+style+'</style>');
});
</script>

0 comments on commit fddbef3

Please sign in to comment.