Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.


  • Content Count

  • Joined

  • Last visited

Community Reputation

2 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. We get the wrong redirect with index.php?controller=AdminFeatures&id_feature=1&viewfeature&token=64b5166a96bdea51c7bb9a746b2dabfd on the index.php?controller=AdminFeatures&token=64b5166a96bdea51c7bb9a746b2dabfd&submitFilterfeature_value=2#feature_value Change the line in the AdminFeaturesController if (Tools::getIsset('submitFilter')) { on the if (Tools::getIsset('submitFilter'.$this->list_id)) { It works now.
  2. I agree. In my situation, I could not find a better solution than to write such overrides. Will have to live with them. Of course, it's better not to delete the small type 😞
  3. In the AdminProducts controller we have a small picture type. If this type is not or is it disabled for products? The initFormAttributes and initFormImages functions have a line that probably does not work correctly: $type = ImageType::getByNameNType('%', 'products', 'height'); //won't find anything it's better this way $type = ImageType::getByNameNType('*', 'products', 'height'); //will show first In initFormInformations (for inserting pictures in the description), the type small is also hardcoded: //type (small) as constant foreach ($images as $k => $image) { $images[$k]['src'] = $this->context->link->getImageLink($product->link_rewrite[$this->context->language->id], $product->id.'-'.$image['id_image'], ImageType::getFormatedName('small')); } it's better this way //better to find from what is $imageType = (ImageType::getImagesTypes('products'))[0]['name'] ?? 'Unknow'; foreach ($images as $k => $image) { $images[$k]['src'] = $this->context->link->getImageLink($product->link_rewrite[$this->context->language->id], $product->id.'-'.$image['id_image'], ImageType::getFormatedName($imageType)); } In my store (TB with the latest bleeding edge update) I do not use the "small" type. These fixes work for me. Maybe it should be for everyone.
  4. I want to redefine the templates for the default BO theme, for example _PS_BO_DEFAULT_THEME _. '/template / footer.tpl'. Then in AdminController :: display () the wrong folder paths are retrieved. // Check if header/footer have been overriden $dir = $this->context->smarty->getTemplateDir(1);//.'controllers'.DIRECTORY_SEPARATOR.trim($this->override_folder, '\\/').DIRECTORY_SEPARATOR; $moduleListDir = $this->context->smarty->getTemplateDir(1).'helpers'.DIRECTORY_SEPARATOR.'modules_list'.DIRECTORY_SEPARATOR;
  5. This is probably the wrong context for "this" inside the "each" function. If you return it as it was in Prestashop, then there will be no error: function updateInvoice(invoices) { // Update select on product edition line $('.edit_product_invoice').each(function () { var selected = $(this).children('option:selected').val(); $(this).children('option').remove(); //$.each(invoices, function (i) { for(i in invoices) { // Create new option var option = $('<option>' + invoices[i].name + '</option>').attr('value', invoices[i].id); if (invoices[i].id === selected) { option.attr('selected', true); } $(this).append(option); } //}); }); // Update select on product addition line $('#add_product_product_invoice').each(function () { var parent = $(this).children('optgroup.existing'); parent.children('option').remove(); $.each(invoices, function (i) { // Create new option var option = $('<option>' + invoices[i].name + '</option>').attr('value', invoices[i].id); parent.append(option); }); parent.children('option:first').attr('selected', true); }); // Update select on product addition line $('#payment_invoice').each(function () { $(this).children('option').remove(); //$.each(invoices, function (i) { for(i in invoices) { // Create new option var option = $('<option>' + invoices[i].name + '</option>').attr('value', invoices[i].id); $(this).append(option); } //}); }); } Whoever knows Javascript can confirm this?
  6. When I add or remove an item to a BO order I get the following Javascript error: In Chromium 79.0.3945.79 (Официальная сборка), Built on Ubuntu , running on Ubuntu 18.04 (64 бит) or Windows 7 Google Chrome 79.0.3945.130 jquery-1.11.0.min.js?ts=1564066310:3 Uncaught TypeError: Cannot read property 'createDocumentFragment' of undefined at eb (jquery-1.11.0.min.js?ts=1564066310:3) at Function.buildFragment (jquery-1.11.0.min.js?ts=1564066310:3) at e.fn.init.domManip (jquery-1.11.0.min.js?ts=1564066310:3) at e.fn.init.append (jquery-1.11.0.min.js?ts=1564066310:3) at Object.<anonymous> (orders.js?ts=1580215242:59) at Function.each (jquery-1.11.0.min.js?ts=1564066310:2) at HTMLSelectElement.<anonymous> (orders.js?ts=1580215242:52) at Function.each (jquery-1.11.0.min.js?ts=1564066310:2) at e.fn.init.each (jquery-1.11.0.min.js?ts=1564066310:2) at updateInvoice (orders.js?ts=1580215242:48) eb @ jquery-1.11.0.min.js?ts=1564066310:3 buildFragment @ jquery-1.11.0.min.js?ts=1564066310:3 domManip @ jquery-1.11.0.min.js?ts=1564066310:3 append @ jquery-1.11.0.min.js?ts=1564066310:3 (anonymous) @ orders.js?ts=1580215242:59 each @ jquery-1.11.0.min.js?ts=1564066310:2 (anonymous) @ orders.js?ts=1580215242:52 each @ jquery-1.11.0.min.js?ts=1564066310:2 each @ jquery-1.11.0.min.js?ts=1564066310:2 updateInvoice @ orders.js?ts=1580215242:48 success @ orders.js?ts=1580215242:557 j @ jquery-1.11.0.min.js?ts=1564066310:2 fireWith @ jquery-1.11.0.min.js?ts=1564066310:2 x @ jquery-1.11.0.min.js?ts=1564066310:4 b @ jquery-1.11.0.min.js?ts=1564066310:4 XMLHttpRequest.send (async) send @ jquery-1.11.0.min.js?ts=1564066310:4 ajax @ jquery-1.11.0.min.js?ts=1564066310:4 (anonymous) @ orders.js?ts=1580215242:542 dispatch @ jquery-1.11.0.min.js?ts=1564066310:3 r.handle @ jquery-1.11.0.min.js?ts=1564066310:3 In Firefox 72.0.1 (64-bit) on Ubuntu 18.10: TypeError: a is undefinedjquery-1.11.0.min.js:3:15071 jQuery 4 eb buildFragment domManip append updateInvoice http://tb110.local/js/admin/orders.js?ts=1580215242:59 each jQuery updateInvoice http://tb110.local/js/admin/orders.js?ts=1580215242:52 jQuery 2 each each updateInvoice http://tb110.local/js/admin/orders.js?ts=1580215242:48 success http://tb110.local/js/admin/orders.js?ts=1580215242:557 jQuery 4 j fireWith x b My shop is Thirtybees 1.1.x Bleeding Edge last release. Files are not modified. Someone can check the addition or removal of goods in your order.
  7. We have two ajax functions (ajaxProcessAddProductOnOrder, ajaxProcessEditProductOnOrder) to edit and add goods from BO that use the ./orders/_product_line.tpl template but do not define $product['customized_product_quantity']. Accordingly, we have such a message in the error log: 2020/01/28 13:29:47 [error] 675#675: *124 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: customized_product_quantity in /home/vagrant/public_html/cache/smarty/compile/7c/80/09/7c80093774885aab8180ca74c940683e358afd6d_0.file._product_line.tpl.php on line 133PHP message: PHP Notice: Undefined index: customized_product_quantity in /home/vagrant/public_html/cache/smarty/compile/7c/80/09/7c80093774885aab8180ca74c940683e358afd6d_0.file._product_line.tpl.php on line 133"
  8. Yes. My currently php version: PHP 7.3.10-1+0~20191008.45+debian9~1.gbp365209 (cli) (built: Oct 8 2019 05:48:14) ( NTS )
  9. My shop version 1.1.x Bleeding Edge last release The error log shows the following 2020/01/25 14:02:54 [error] 688#688: *1436 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined variable: currency in /home/vagrant/public_html/controllers/admin/AdminOrdersController.php on line 2713PHP message: PHP Notice: Trying to get property 'decimals' of non-object in /home/vagrant/public_html/controllers/admin/AdminOrdersController.php on line 2713"
  10. Quant


    When will MULTIPLEFEATURES from the kernel be implemented? How long to wait?
  11. There is a bug with displaying colors on the categories page when SmartyCache is enabled. It is not fixed in TB and PS (1.6.x). Here is an example of how to fix it. public function addColorsToProductList(&$products) { if (!is_array($products) || !count($products) || !file_exists(_PS_THEME_DIR_.'product-list-colors.tpl')) { return; } $productsNeedCache = []; foreach ($products as &$product) { if (!$this->isCached(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) { $productsNeedCache[] = (int) $product['id_product']; } else { $product['color_list'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product'])); } } unset($product); $colors = false; if (count($productsNeedCache)) { $colors = Product::getAttributesColorList($productsNeedCache); } else { return; } Tools::enableCache(); foreach ($products as &$product) { if (isset($colors[$product['id_product']])) { $tpl = $this->context->smarty->createTemplate(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product'])); $tpl->assign( [ 'id_product' => $product['id_product'], 'colors_list' => $colors[$product['id_product']], 'link' => $this->context->link, 'img_col_dir' => _THEME_COL_DIR_, 'col_img_dir' => _PS_COL_IMG_DIR_, ] ); $product['color_list'] = $tpl->fetch(_PS_THEME_DIR_.'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product'])); } if (in_array($product['id_product'], $productsNeedCache) && !isset($colors[$product['id_product']])) { $product['color_list'] = ''; } } Tools::restoreCacheSettings(); }
  12. The blocknewproducts module (ver 2.1.3) does not show products on the categories page when I enable Smarty cache. It seems to me that in hookRightColumn() the BlockNewProducts::$cache_new_products is not checked there. I changed the function a bit, and then everything works: public function hookRightColumn() { if (!$this->isCached('blocknewproducts.tpl', $this->getCacheId())) { if (!isset(BlockNewProducts::$cache_new_products)) BlockNewProducts::$cache_new_products = $this->getNewProducts(); if (!BlockNewProducts::$cache_new_products) { return false; } $this->smarty->assign([ 'new_products' => BlockNewProducts::$cache_new_products, 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), ]); } return $this->display(__FILE__, 'blocknewproducts.tpl', $this->getCacheId()); } Also in hookdisplayHomeTab(), the BlockNewProducts::$cache_new_products check should be used in the IF block, and in hookdisplayHomeTabContent(), the check is generally meaningless. public function hookdisplayHomeTab() { if (!$this->isCached('tab.tpl', $this->getCacheId('blocknewproducts-tab'))) { BlockNewProducts::$cache_new_products = $this->getNewProducts(); if (!BlockNewProducts::$cache_new_products) return false; } return $this->display(__FILE__, 'tab.tpl', $this->getCacheId('blocknewproducts-tab')); } public function hookdisplayHomeTabContent() { if (!$this->isCached( 'blocknewproducts_home.tpl', $this->getCacheId('blocknewproducts-home')) ) { $this->smarty->assign([ 'new_products' => BlockNewProducts::$cache_new_products, 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), ]); } return $this->display( __FILE__, 'blocknewproducts_home.tpl', $this->getCacheId('blocknewproducts-home') ); } Tell me, my corrections are correct?
  13. The problem disappears if you update the TB via CoreUpdater. Then the errors disappear. Ps. I use php5.6, only for the test, while I transfer PS1.6.1.23 to TB.
  14. The productscategory module gives errors if you enable FullPageCache and disable caching for displayFooterProduct. [Mon Apr 22 18:26:22.209248 2019] [:error] [pid 25072] [client] PHP Notice: Undefined index: product in /home/shop/www/modules/productscategory/productscategory.php on line 110, referer: http://tb.local/19-laki [Mon Apr 22 18:26:22.209278 2019] [:error] [pid 25072] [client] PHP Notice: Trying to get property of non-object in /home/shop/www/modules/productscategory/productscategory.php on line 110, referer: http://tb.local/19-laki [Mon Apr 22 18:26:22.209294 2019] [:error] [pid 25072] [client] PHP Notice: Undefined index: product in /home/shop/www/modules/productscategory/productscategory.php on line 111, referer: http://tb.local/19-laki [Mon Apr 22 18:26:22.209698 2019] [:error] [pid 25072] [client] PHP Notice: Trying to get property of non-object in /home/shop/www/modules/productscategory/productscategory.php on line 113, referer: http://tb.local/19-laki Im use TB ver 1.0.8 (community theme) and php5.6. How to fix it?
  • Create New...