Jump to content

Rudolfo78

Members
  • Content count

    39
  • Joined

  • Last visited

2 Followers

About Rudolfo78

  • Rank
    PrestaShop Apprentice

Profile Information

  • Gender
    Not Telling
  • Location
    Slovakia
  • Activity
    Freelancer

Contact Methods

  • Website URL
    http://www.maclife.sk

Recent Profile Visitors

5,381,243 profile views
  1. Any ideas please?
  2. Hello, I have a weird problem on the checkout page - https://maclife.sk I have two currencies in my store - EUR, CZK A quick one-page checkout has been selected. When a customer is buying in EUR, everything is okay - carrier selection, terms and conditions checked and payment methods appear OK. But if the customer chooses CZK, the payment methods will not be displayed. They only appear after a checkout page has been refreshed. I have double checked permissions and countries - everything is checked and looks fine. Any ideas or help will be appreciated, thanks.
  3. It means that new 0.24 works between different versions 1.6 -> 1.7?? Or simply copy from 1.6 to 1.6 and 1.7 to 1.7? Thanks, for info.
  4. GLS Balikomat / Parcel shop

    Ak by sa niekto podujal na vývoj, vzal by som aj ja...
  5. Done, with your suggestion and result: Module CMS Products works fine Module Powerful Forms doesn't - blank page after using shortcode on CMS page Any suggestions? Thank you... Edit: ...after filling in some data in powerful form generator, it works fine as well! Thank you Vekia, you are my Hero!
  6. Hi Vekia, could you please merge these two files for me? <?php /** * PrestaShop module created by VEKIA, a guy from official PrestaShop community ;-) * * @author VEKIA https://www.prestashop.com/forums/user/132608-vekia/ * @copyright 2010-2016 VEKIA * @license This program is not free software and you can't resell and redistribute it * * CONTACT WITH DEVELOPER http://mypresta.eu * support@mypresta.eu */ class CmsController extends CmsControllerCore { public function init() { if ($id_cms = (int)Tools::getValue('id_cms')) { $this->cms = new CMS($id_cms, $this->context->language->id, $this->context->shop->id); } elseif ($id_cms_category = (int)Tools::getValue('id_cms_category')) { $this->cms_category = new CMSCategory($id_cms_category, $this->context->language->id, $this->context->shop->id); } if (Configuration::get('PS_SSL_ENABLED') && Tools::getValue('content_only') && $id_cms && Validate::isLoadedObject($this->cms) && in_array($id_cms, array( (int)Configuration::get('PS_CONDITIONS_CMS_ID'), (int)Configuration::get('LEGAL_CMS_ID_REVOCATION') )) ) { $this->ssl = true; } parent::init(); $this->canonicalRedirection(); if (Validate::isLoadedObject($this->cms)) { $adtoken = Tools::getAdminToken('AdminCmsContent' . (int)Tab::getIdFromClassName('AdminCmsContent') . (int)Tools::getValue('id_employee')); if (!$this->cms->isAssociatedToShop() || !$this->cms->active && Tools::getValue('adtoken') != $adtoken) { header('HTTP/1.1 404 Not Found'); header('Status: 404 Not Found'); } else { $this->assignCase = 1; } } elseif (Validate::isLoadedObject($this->cms_category) && $this->cms_category->active) { $this->assignCase = 2; } else { header('HTTP/1.1 404 Not Found'); header('Status: 404 Not Found'); } } public function setMedia() { parent::setMedia(); if ($this->assignCase == 1) { $this->addJS(_THEME_JS_DIR_ . 'cms.js'); } $this->addCSS(_THEME_CSS_DIR_ . 'product_list.css'); $this->addCSS(_THEME_CSS_DIR_ . 'cms.css'); $this->addCSS(_PS_MODULE_DIR_ . 'cmsproducts/cmsproducts.css'); } public function initContent() { parent::initContent(); $parent_cat = new CMSCategory(1, $this->context->language->id); $this->context->smarty->assign('id_current_lang', $this->context->language->id); $this->context->smarty->assign('home_title', $parent_cat->name); $this->context->smarty->assign('cgv_id', Configuration::get('PS_CONDITIONS_CMS_ID')); if ($this->assignCase == 1) { if (isset($this->cms->id_cms_category) && $this->cms->id_cms_category) { $path = Tools::getFullPath($this->cms->id_cms_category, $this->cms->meta_title, 'CMS'); } elseif (isset($this->cms_category->meta_title)) { $path = Tools::getFullPath(1, $this->cms_category->meta_title, 'CMS'); } $this->cms->content = $this->returnContent($this->cms->content); $this->context->smarty->assign(array( 'cms' => $this->cms, 'content_only' => (int)Tools::getValue('content_only'), 'path' => $path, 'body_classes' => array( $this->php_self . '-' . $this->cms->id, $this->php_self . '-' . $this->cms->link_rewrite ) )); if ($this->cms->indexation == 0) { $this->context->smarty->assign('nobots', true); } } elseif ($this->assignCase == 2) { $this->context->smarty->assign(array( 'category' => $this->cms_category, //for backward compatibility 'cms_category' => $this->cms_category, 'sub_category' => $this->cms_category->getSubCategories($this->context->language->id), 'cms_pages' => CMS::getCMSPages($this->context->language->id, (int)$this->cms_category->id, true, (int)$this->context->shop->id), 'path' => ($this->cms_category->id !== 1) ? Tools::getPath($this->cms_category->id, $this->cms_category->name, false, 'CMS') : '', 'body_classes' => array( $this->php_self . '-' . $this->cms_category->id, $this->php_self . '-' . $this->cms_category->link_rewrite ) )); } $this->setTemplate(_PS_THEME_DIR_ . 'cms.tpl'); } public static function getImagesByID($id_product, $limit = 0) { $id_image = Db::getInstance()->ExecuteS('SELECT `id_image` FROM `' . _DB_PREFIX_ . 'image` WHERE cover=1 AND `id_product` = ' . (int)$id_product . ' ORDER BY position ASC LIMIT 0, ' . (int)$limit); $toReturn = array(); if (!$id_image) { return null; } else { foreach ($id_image as $image) { $toReturn[] = $id_product . '-' . $image['id_image']; } } return $toReturn; } public function returnProduct($id_product) { $explode[] = $id_product; foreach ($explode as $tproduct) { if ($tproduct != '') { $x = (array)new Product($tproduct, true, $this->context->language->id); $productss[$tproduct] = $x; $productss[$tproduct]['id_product'] = $tproduct; $image = self::getImagesByID($tproduct, 1); $picture = explode('-', $image[0]); $productss[$tproduct]['id_image'] = $picture[1]; } } $products = Product::getProductsProperties($this->context->language->id, $productss); $this->context->smarty->assign('products', $products); $this->context->smarty->assign('feedtype', "cmsSingleProductFeed"); $contents = $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'cmsproducts/products.tpl'); return $contents; } public function returnProducts($id_product) { $explode_products = explode(",", $id_product); foreach ($explode_products AS $idp) { $explode[] = $idp; foreach ($explode as $tproduct) { if ($tproduct != '') { $x = (array)new Product($tproduct, true, $this->context->language->id); $productss[$tproduct] = $x; $productss[$tproduct]['id_product'] = $tproduct; $image = self::getImagesByID($tproduct, 1); $picture = explode('-', $image[0]); $productss[$tproduct]['id_image'] = $picture[1]; } } } $products = Product::getProductsProperties($this->context->language->id, $productss); $this->context->smarty->assign('products', $products); $this->context->smarty->assign('feedtype', "cmsProductsFeed"); $contents = $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'cmsproducts/products.tpl'); return $contents; } public function returnProductsHpp($block) { if (class_exists("Hpp")) { $hpp = new Hpp(); if (method_exists($hpp, 'returnProducts')) { return $this->displayHpp($hpp->returnProducts($block)); } else { return $this->noModuleMessage("Homepage Products Pro"); } } else { return $this->noModuleMessage("Homepage Products Pro"); } } public function returnProductsRpp($block) { if (class_exists("Ppb")) { $rpp = new Ppb(); if (method_exists($rpp, 'returnProducts')) { return $this->displayRpp($rpp->returnProducts($block)); } else { return $this->noModuleMessage("Related Products Pro"); } } else { return $this->noModuleMessage("Related Products Pro"); } } public function displayRpp($products) { if (count($products) <= 0) { $this->context->smarty->assign('feedtype', "noProducts"); } else { $this->context->smarty->assign('products', $products); $this->context->smarty->assign('feedtype', "rppfeed"); } $contents = $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'cmsproducts/products.tpl'); return $contents; } public function displayHpp($products) { if (count($products) <= 0) { $this->context->smarty->assign('feedtype', "noProducts"); } else { $this->context->smarty->assign('products', $products); $this->context->smarty->assign('feedtype', "hppfeed"); } $contents = $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'cmsproducts/products.tpl'); return $contents; } public function noModuleMessage($module) { $this->context->smarty->assign('products', $products); $this->context->smarty->assign('module', $module); $this->context->smarty->assign('feedtype', "error"); $contents = $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'cmsproducts/products.tpl'); return $contents; } public function returnContent($contents) { /** PRODUCTS **/ preg_match_all('/\{products\:[(0-9\,)]+\}/i', $contents, $matches); foreach ($matches[0] as $index => $match) { $explode = explode(":", $match); $contents = str_replace($match, $this->returnProducts(str_replace("}", "", $explode[1])), $contents); } /** PRODUCT **/ preg_match_all('/\{product\:[(0-9\,)]+\}/i', $contents, $matches); foreach ($matches[0] as $index => $match) { $explode = explode(":", $match); $contents = str_replace($match, $this->returnProduct(str_replace("}", "", $explode[1])), $contents); } /** HOMEPAGE PRODUCTS PRO FEED **/ preg_match_all('/\{hpp\:[(0-9)]+\}/i', $contents, $matches); foreach ($matches[0] as $index => $match) { $explode = explode(":", $match); $contents = str_replace($match, $this->returnProductsHpp(str_replace("}", "", $explode[1])), $contents); } /** RELATED PRODUCTS PRO FEED **/ preg_match_all('/\{rpp\:[(0-9)]+\}/i', $contents, $matches); foreach ($matches[0] as $index => $match) { $explode = explode(":", $match); $contents = str_replace($match, $this->returnProductsRpp(str_replace("}", "", $explode[1])), $contents); } return $contents; } } and this one: <?php /** * Powerful Form Generator * * This modules aims to provide for your customer any kind of form you want. * * If you find errors, bugs or if you want to share some improvments, * feel free to contact at contact@prestaddons.net ! * Si vous trouvez des erreurs, des bugs ou si vous souhaitez * tout simplement partager un conseil ou une amélioration, * n'hésitez pas à me contacter à contact@prestaddons.net * * @package modules * @author Cyril Nicodème <contact@prestaddons.net> * @copyright Copyright (C) April 2014 prestaddons.net <@email:contact@prestaddons.net>. All rights reserved. * @since 2014-04-15 * @version 2.7.2 * @license Nicodème Cyril */ require_once(_PS_MODULE_DIR_.'powerfulformgenerator/classes/PFGRenderer.php'); class CmsController extends CmsControllerCore { /* * module: powerfulformgenerator * date: 2017-04-21 20:54:49 * version: 2.7.2 */ public function initContent() { parent::initContent(); $parent_cat = new CMSCategory(1, $this->context->language->id); $this->context->smarty->assign('id_current_lang', $this->context->language->id); $this->context->smarty->assign('home_title', $parent_cat->name); $this->context->smarty->assign('cgv_id', Configuration::get('PS_CONDITIONS_CMS_ID')); if ($this->assignCase == 1) { if ($this->cms->indexation == 0) { $this->context->smarty->assign('nobots', true); } if (version_compare(Tools::substr(_PS_VERSION_, 0, 3), '1.7', '>=')) { $currentCms = $this->objectPresenter->present($this->cms); $currentCms['content'] = $this->returnContent($currentCms['content']); $this->context->smarty->assign(array( 'cms' => $currentCms, )); $this->setTemplate( 'cms/page', array('entity' => 'cms', 'id' => $this->cms->id) ); } else { if (isset($this->cms->id_cms_category) && $this->cms->id_cms_category) { $path = Tools::getFullPath($this->cms->id_cms_category, $this->cms->meta_title, 'CMS'); } elseif (isset($this->cms_category->meta_title)) { $path = Tools::getFullPath(1, $this->cms_category->meta_title, 'CMS'); } $this->cms->content = $this->returnContent($this->cms->content); $this->context->smarty->assign(array( 'cms' => $this->cms, 'content_only' => (int)Tools::getValue('content_only'), 'path' => $path, 'body_classes' => array($this->php_self.'-'.$this->cms->id, $this->php_self.'-'.$this->cms->link_rewrite) )); $this->setTemplate(_PS_THEME_DIR_.'cms.tpl'); } } elseif ($this->assignCase == 2) { if (version_compare(Tools::substr(_PS_VERSION_, 0, 3), '1.7', '>=')) { $this->context->smarty->assign($this->getTemplateVarCategoryCms()); $this->setTemplate('cms/category'); } else { $this->context->smarty->assign(array( 'category' => $this->cms_category, //for backward compatibility 'cms_category' => $this->cms_category, 'sub_category' => $this->cms_category->getSubCategories($this->context->language->id), 'cms_pages' => CMS::getCMSPages($this->context->language->id, (int)$this->cms_category->id, true, (int)$this->context->shop->id), 'path' => ($this->cms_category->id !== 1) ? Tools::getPath($this->cms_category->id, $this->cms_category->name, false, 'CMS') : '', 'body_classes' => array($this->php_self.'-'.$this->cms_category->id, $this->php_self.'-'.$this->cms_category->link_rewrite) )); $this->setTemplate(_PS_THEME_DIR_.'cms.tpl'); } } } /* * module: powerfulformgenerator * date: 2017-04-21 20:54:49 * version: 2.7.2 */ private function generatePFG($id_pfg) { $renderer = new PFGRenderer($id_pfg); if (!$renderer->isAllowed(true)) { $redirect_url = $renderer->getForm()->unauth_redirect_url[Context::getContext()->language->id]; if (!empty($redirect_url)) { Tools::redirect($redirect_url); } else { Controller::getController('PageNotFoundController')->run(); } exit(); } return $renderer->displayForm(); } /* * module: powerfulformgenerator * date: 2017-04-21 20:54:49 * version: 2.7.2 */ public function returnContent($contents) { preg_match_all('/\{powerfulform\:[(0-9\,)]+\}/i', $contents, $matches); foreach ($matches[0] as $index => $match) { $explode = explode(":", $match); $contents = str_replace($match, $this->generatePFG(str_replace("}", "", $explode[1])), $contents); } return $contents; } } Thank you very much!
  7. Unfortunately, I have no coding skills. How could I achieve your task?
  8. Hi Vekia, Today I've bought official addon powerfulformgenerator from addons.prestashop.com. When I'm trying to install this addon, it shows me error message, see attached screenshot. Is there any way how to install official addon next to your module "products on cms page"? Thanks for any advice.
  9. - I didn't make any other changes except for filling in the access data for the old shop. - In the new shop I've only imported and activated new (Slovak) language and deactivated and erased default (English) language. - I'll send you PM here shortly. Regards, R.
  10. Hi master, Yes ps_shop table is empty (see attached image 1) Error message I've got after entering "localhost/admin..." in browser (see attached image 2) Regards, R.
  11. Hi master, answers to your questions: 1) Development mode see attached screenshot 2) According to DiffMerge tool (which is similar to WinMerge), there are 199 changes between both SQL files old vs. new one - there is also significant difference in size of these files (11,8MB vs. 0,6MB) 3) I am not able to enter backoffice of old shop, new one works perfect but it is untouched (default data in products catalog etc.) Any suggestions? Thanks, R.
  12. Ok, today I will check your previous suggestions and I'll give you needed info. Regards, R.
  13. Hi musicmaster, Sorry for previous explanation. Mentioned "one file" is exim.php. Prestools folder contains it, as well as copy_shopdata folder contains it and as I know copy_shopdata files should be copyed to prestools folder. Right? My question: Is it necessary to overwrite files exim.php or not? Thanks, R.
  14. Hi musicmaster, beforehand I have one more question, whether is it ok to replace one file when I am copying copy_shopdata files to prestools folder or should I keep the original one? Thanks, R
  15. Hi musicmaster, results are the same with script v0.20. Step by step 1.6.1.4 –> 1.6.1.4 (MAMP, Sequel Pro, macOS Sierra) 1) source data installed to root folder on localhost - language ID 2 (only one language active), database name: "1614old" 2) new installation PS 1614 installed to subfolder "1614" with database name "1614new", folder "prestools" with copy_shopdata files copied to "admin..." folder, localization (Slovak) imported and activated as ID 2, default language English ID 1 deactivated and erased 3) script started with .../1614/admin.../copy_shopdata.php 4) after whole process, source/old installation corrupted and the new one untouched, screenshot of localhost attached Thanks
×