Jump to content

rocky

Members
  • Posts

    11,253
  • Joined

  • Last visited

  • Days Won

    45

rocky last won the day on November 18 2023

rocky had the most liked content!

Profile Information

  • Location
    Townsville, QLD, Australia
  • Activity
    Freelancer

Recent Profile Visitors

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

rocky's Achievements

  1. I just encountered this issue. Changing all the file permissions didn't work, since one file admin/autoupgrade/ajax-upgradetab.php kept resetting to chmod 666 every time the page refreshed. I discovered the problem is on line 148 of modules/autoupgrade/AdminSelfUpgrade.php: @copy(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $this->autoupgradeDir . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php', $this->autoupgradePath . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php'); This overrides the file with chmod 644 with a new copy with chmod 666. I fixed the issue by adding the following line after it: @chmod($this->autoupgradePath . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php', 0644); This ensures the file permission is always chmod 644. No more error messages after I did this.
  2. I just encountered this issue when a customer asked me to install PrestaShop v1.7.6.9 on PHP 5.6.40. The problem in this case was that the PrestaShop Installer was trying to install the latest version of the PrestaShop Metrics module, which is incompatible with PHP 5.6.40. I fixed the issue by adding 'ps_metrics', to the $blacklist on line 931 of src/PrestaShopBundle/Install/Install.php.
  3. Thank you for your support of my PrestaShop modules over the past 13 years. After careful consideration, I have decided to discontinue my modules, though I will continue to support my existing customers through email. PrestaShop has been a big part of my life and I appreciate the opportunities they have provided me, but I feel like I need to stop development so I can move on to bigger and better things. These are my most popular modules, so if you have them installed, please be aware they are no longer supported: AJAX Dropdown Categories Image/Video Gallery Classic Theme Customizer
  4. Classic Theme Customizer 2.1.1 has been released. This update improves the module's compatibility with PrestaShop 1.7.8.
  5. Classic Theme Customizer 2.1.0 has been released. This update makes the module compatible with PrestaShop 1.7.8.0.
  6. Classic Theme Customizer 2.0.0 has been released. This major update includes redesigned background opacity and blur effects using modern CSS and makes the module compatible with PrestaShop 1.7.7.5. There are new options to specify the amount of opacity and blur to apply to content backgrounds. It also adds options to tile the background image and specify the content background color in light and dark modes. Updated demo available here.
  7. Classic Theme Customizer 1.2.1 has been released. This update includes some improvements to the CSS.
  8. Classic Theme Customizer 1.2.0 has been released. This update includes a redesigned progress popup with options to resume and abort. It also makes the module compatible with PrestaShop 1.7.7.
  9. Looks like PrestaShop moved it to line 34 of app/AppKernel.php since I wrote that.
  10. It's hard to help without checking the code on your website. I'm guessing the / is being added by your breadcrumb.tpl file and the > is being added using CSS. You'll have to either edit your breadcrumb.tpl to remove the / or edit your CSS to remove the >
  11. I'm not an SEO expert. After a quick Google search, I found this page that says that breadcrumbs are indirectly good for SEO and hiding them using CSS is a bad idea.
  12. You can add CSS like the following: @media (max-width: 767px) { .breadcrumb { display: none } } This will remove the breadcrumb when the browser width is less than 768px. You can adjust that number until you're happy with when the breadcrumb disappears.
  13. Unfortunately, I've never used that hook in any of my modules and it appears that none of the modules that come with PrestaShop use it either. I did a search over the entire PrestaShop v1.7.6 codebase and discovered the displayAdminProductsCombinationBottom hook was added in PrestaShop v1.7.2.0 with the description "Display new elements in back office product page, Combination tab". The only other useful information I could find was in the following code: echo $this->env->getExtension('PrestaShopBundle\Twig\HookExtension')->renderHook( "displayAdminProductsCombinationBottom", [ "id_product" => $this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "id_product", []), "id_product_attribute" => $this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "id_product_attribute", []) ] ); The hook has the parameters id_product and id_product_attribute and directly displays whatever is returned.
  14. Yes, it works with PrestaShop v1.7.6.4 since my module works in that version. Have you added the $kantavuus, $ohiajomelu and $nopeusluokka variables to classes/Product.php? They must be added as public variables of the Product class, have their format defined in $definition['fields'] and have been added to the ps_product or ps_product_lang. In the code you've written, $params["product"] doesn't exist. You could fix this by writing $product = new Product($params['id_product'), $this->context->language->id, $this->context->shop->id); If you find it too difficult, you can hire me to write the module for you. If it's simply adding some fields to the product and product editor, it will be easy for me to do.
  15. Here's the function I use in my Image/Video Gallery module (modules/nc_gallery/nc_gallery.php): public function hookDisplayAdminProductsExtra($params) { if (isset($params['id_product']) && (int)$params['id_product']) { $controller = new AdminNCGalleryGalleriesController(); $this->context->smarty->assign('form', $controller->renderProductForm((int)$params['id_product'])); return $this->display(__FILE__, 'views/templates/admin/tab.tpl'); } } And a simplified version of the renderProductForm function that displays a multi-language text field on the configuration page (modules/nc_gallery/controllers/admin/AdminNCGalleryGalleriesController.php): public function renderProductForm($id_product) { if ((int)$id_product <= 0) { return; } $fields_value = []; $product_tab = null; $id_product_tab = (int)NCGalleryProductTab::getTabForProduct((int)$id_product); if ($id_product_tab) { $product_tab = new NCGalleryProductTab((int)$id_product_tab); $fields_value['nc_gallery_name'] = []; foreach (Language::getLanguages(false) as $language) { if (is_array($product_tab->name) && isset($product_tab->name[(int)$language['id_lang']]) && $product_tab->name[(int)$language['id_lang']] != '') { $fields_value['nc_gallery_name'][(int)$language['id_lang']] = $product_tab->name[$language['id_lang']]; } else { $fields_value['nc_gallery_name'][(int)$language['id_lang']] = Configuration::get('NC_GALLERY_DEFAULT_TAB_TITLE', (int)$language['id_lang']); } } } else { foreach (Language::getLanguages(false) as $language) { $fields_value['nc_gallery_name'][(int)$language['id_lang']] = Configuration::get('NC_GALLERY_DEFAULT_TAB_TITLE', (int)$language['id_lang']); } } $this->fields_form = [ 'input' => [ [ 'type' => 'text', 'label' => $this->l('Title'), 'name' => 'nc_gallery_name', 'hint' => $this->l('The tab text displayed on the product page'), 'required' => true, 'lang' => true, 'class' => 'form-control', ], ], ]; $this->fields_form = [['form' => $this->fields_form]]; $helper = new HelperForm($this); $this->setHelperDisplay($helper); $helper->languages = Language::getLanguages(); $helper->default_form_language = (int)Configuration::get('PS_LANG_DEFAULT'); $helper->fields_value = $fields_value; $helper->submit_action = $this->submit_action; $helper->tpl_vars = $this->getTemplateFormVars(); return $helper->generateForm($this->fields_form); } And in modules/nc_gallery/views/templates/admin/tab.tpl: <input type="hidden" name="submitted_tabs[]" value="nc_gallery" /> {$form} I hope this helps.
×
×
  • Create New...