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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user