Prestashop 1.7.8.0 problem disable scroll up after changing the attributes - prestashop

I have a problem in Prestashop 1.7.8.0 I want to disable the scroll up after changing the attributes how to do it?
Moves the page up every time
I have core.js file combined and i dont know where to change this behaviour.

The best solution I found is to install prestashop with local environments and edit _dev folder inside theme. Go to inside folder: themes/classic/_dev/js/listing.js and remove window.scrollTo(0, 0); from:
prestashop.on('updateProductList', (data) => {
updateProductListDOM(data);
window.scrollTo(0, 0);
});

Related

Recaptcha v3 dark theme

Is there a possibility to use a dark theme for google recaptcha 3?
I tried to add data-theme="dark" in grecaptcha block but it doesn't work for me
Have you try this?
document.addEventListener('DOMContentLoaded', (event) => {
const recaptcha = document.querySelector('.g-recaptcha');
recaptcha.setAttribute("data-theme", "dark");
});
Or you can change it manually by find the div with class g-recaptcha and add the attribute data-theme="dark".
I made this way, actually i made some modifications, but i can't made the badge turn black on first load, i'll still make a refresh for that.
https://stackoverflow.com/a/72502375/17791142
i wish this can help you.

How to make vuepress dynamically create the side navigation?

I'm trying to simplify the creation of my view press site so I don't have to add entries on the left side navigation manually.
So far I tried
"vuepress-auto-sidebar": "^1.1.1"
But it renders the .git and node_modules folder as well. It also does not render the title.
Not only that it does not render a file called upload.md in the root of my project.
I am thinking I may just have to code it manually by doing some form of directory scanning (though I am not sure how to "watch" that, so that it updates when I add new files).
The way I worked around it so far is to configure theme-config to do this which removes the errant modules.
sidebar: sidebar
.getSidebar()
.filter((v) => v.path !== "/node_modules/" && v.path !== "/.git/"),
Then add filters to it skips .git and node_modules folders. Following that I have to parse the Markdown to extract the title.
EDIT: usually, you do write your .md docs into a docs directory (not at the root of the project) and then launch it with this (from package.json)
vuepress dev docs --no-clear-screen --open
As for the sidebar, my first answer is below.
From this github issue: https://github.com/vuejs/vuepress/issues/613
You can see that this is not available out of the box. So, you could use some solutions given there and generate it kinda yourself but you could also try this npm package called vuepress-bar.
It is working great ! Beware tho, I had some incompatibility issues with it after upgrading to Nuxt 2.15.2, not sure if it's still the case but this way pretty annoying to not being able to run vuepress at all.
I chose a different plugin vuepress-bar in the end but still had to implement the filter
const getConfig = require("vuepress-bar");
const { nav, sidebar } = getConfig();
module.exports = {
themeConfig: {
nav,
sidebar: sidebar.filter(i => i.title !== "Node Modules"),
smoothScroll: true
}
};

Custom Hooks in Prestashop 1.7

I try to create a custom Hook for Prestashop 1.7.0.3 for the slider module. I insert:
displaySlider:
- ps_imageslider
on theme.yml file on block “hooks”.
Then insert:
{if $page.page_name == 'index'}
{hook h='displaySlider'}
{/if}
on theme/templates/layouts/layout-both-columns.tpl file between header and section id=”wrapper” tags. According to this article: Custom Hooks in Prestashop 1.7 everything will work ok but the hook is not shown on available hooks when i try to change slider module position from the backend.
I was working today on the same issue.
And i succeed to make it appear, it is probably not the good way and i hope it is not the good way because it is weird.
In your theme.yml you have to set your hook like this :
global_settings:
hooks:
custom_hooks:
- name: displayFooterBefore
title: displayFooterBefore
description: Add a widget area above the footer
And if you wanna see your hook in the position page, you have to switch to a other template and back to your one. (Kind of refresh)
You can also check the incomplete doc from Prestashop :
http://developers.prestashop.com/themes/hooks/index.html
I hope there is a another way to refresh hooks in this page...
So just to be clear. To add a new hook in Prestashop.
In \themes\yourTheme\config\theme.yml you add
custom_hooks:
- name: displayYourCustomHook
- title: displayYourCustomHook
- description: This is a Custom hook
In the same file, in the section modules_to_hook:
displayYourCustomHook:
- ps_moduleIwantoHook
- ps_anotherModuleIwantToHook
Wherever in your .tpl files you want to add your hook:
...
{hook h='displayYourCustomHook'}
...
Finally, from you backoffice, you change from your current theme to a differente one, and then save. After that, you change to the previous theme (the theme you actually want to use), save again and your hook should be visible. This is done with the aim of "refreshing" the hooks that your Prestashop site recognasizes.
This is working in Prestashop 1.7.7
I spent a lot of time looking for why my custom hook did not appear on the front, thanks for the tip.
In order to improve the process, you can use the reset button in appearance > themes & logo.
This avoids having to activate another theme.
I see I voted myself for the accepted solution 2 years ago, but now came up with a much better solution.
According to Prestashop 1.7 hooks doc all you have to do is to register your hook as any other normal and it will be automatically created. So paste something like:
$this->registerHook('displayAtSpecificPlace');
in your module install() and reinstall the module.

Manual Positioning of Shareaholic ShareBar Plugin

I'm trying to manually position the Shareaholic sharebar WP plugin. I am using a vertical one, and want it to be in a fixed position on the left side of my screen beside my main content area. So far I have figured out how to get it onto my site, but not able to position it. I'm referencing this post of someone who tried to do a similar thing.
I'm using this code to insert it into my single.php
<?php echo do_shortcode('[shareaholic app="share_buttons" id="4766761"]'); ?>
But haven't had any luck with getting css positioning to work, or where exactly to put it in my single.php file
Right now it's just below this code :
<main class='content units <?php avia_layout_class( 'content' ); ?>' <?php avia_markup_helper(array('context' => 'content','post_type'=>'post'));?>>
And it's showing up above the post content.
Any suggestions?
Many thanks
Jonny
Custom CSS should be added to your styles.css theme file, but it is recommended to create a child theme when making any adjustments within your theme so that you will not run the risk of losing your customization if/when your theme releases a new version and you update.

Datetimepicker shows up in a 'naked' way

I want to set up both date and time in a custom field (Yii).
For this i've chosen this datetimepicker.
But as i've loaded it into protected/extentions it now works, but its outlook is somehow 'naked'. I've rounded datepicker's appearence in red.
Its configuraition is:
<?php $form->widget ('ext.CJuiDateTimePicker.CJuiDateTimePicker',
array (
'attribute'=>'start',
'model'=>$model,
'value' => $model->start,
'language' => 'en',
'options'=>array (
// 'timeFormat'=>strtolower(Yii::app()->locale->timeFormat),
'showSecond'=>true,
),
)
); ?>
How to fix it? Am i missing some skin files? How to get them?
I use bootstrap theme FYI.
This is a styling issue .
Download correct Style.css file it will show datepicker correctly .
The issue was that in the Yii app development i was using the NlsClientScript Yii Extention for preventing duplicate scripts loading. So, the datatimepicker's css file has not been loaded into the current nlsXXXXXXX.css file. It turned that this NlsClientScript does manage/aggregate the css files load, the docs saying opposite though...
From documentation:
The extension does not prevent the multiple loading of CSS files.
So I've found the corresponding file, deleted it and reloaded the app.
From documentation:
The extension doesn't watch wether a js/css file has been changed. If you set the merge functionality and some file changed, you need to delete the cached merged file manually, otherwise you'll get the old merged one.