Jump to content

MaXi32

Members
  • Posts

    100
  • Joined

  • Last visited

Posts posted by MaXi32

  1. I have the following sample module that will add image let say that I have this view.tpl for my module file:

     

    <span><img src="{$urls.base_url}modules/mymodule/views/img/google.svg" alt=""/></span>

     

    and inside that mymodule path the google.svg's file is placed inside the folder themes/modules/mymodule/views/img/google.svg. The URL to the google.svg can be navigated as follow:

    http://www.domain.com/modules/mymodule/views/img/google.svg

     

    Now if I want to override the image using a child theme, I edited google.svg, saved it and then I copied the file into my childtheme. I copied mymodule to the childtheme modules the only thing different is I edited google.svg. So, I also have the same view.tpl taken from parent module as follow:

    <span><img src="{$urls.base_url}modules/mymodule/views/img/google.svg" alt=""/></span>

     

    And the MAIN issue here is the $urls.base_url variable above (inside child theme module) it points only to parent file of google.svg. It should point to the file inside the module from child theme that I have edited.

    Perhaps there is a syntax of smarty that can point the URL for the image inside childtheme?

     

    I tried to change the $urls.base_url to this $modules_dir/views/img/google.svg but this does not work.

     

    What is more confusing when I read the documentation, it said that themes can override module's assets for CSS and JavaScript only. Does this statement means, we can only override these 2 types of files and it will not work with image type?

    image.png.5110451f5e564cd999927151bd82f4c2.png 

     

    Edit: Changed title and add extra details

  2. 3 hours ago, Deepinder said:

    No this issue is not yet fixed we have reported again to the support team

    Are you using the latest Prestashop version and module?. I tried linking and it was fixed for both Prestashop Facebook and Prestashop Metrics. They said this is related to the Prestashop native module called ps_accounts. Will test again for another site.

  3. Sorry for bumping the old thread but I actually understand what the OP want. He only want to avoid any technologies detect that he is using Prestashop framework. What he asking for is similar to a plugin called hide-my-wp for wordpress (and that plugin is considered as a security plugin, yes hiding your platform from public is considered one of the security approaches .. so he is asking a security question which he did not specify more)

     

     but I don't think this plugin exist for Prestashop as Prestashop code is harder to understand compared to wordpress. Hopefully there is one available.

  4. 2 hours ago, JulienPct said:

    Why do you want to version unnecessary files?

    Let me explain: 

    You can choose not to version sensitive files but why version the folders like: admin / vendor / etc...

    These files are integrated in each version of PrestaShop, so an installation of a new Presta gives us these folders.

    Hey @JulienPct, I really appreciate your reply on this. Thank you very much. Now, I learned something new that the folders above will not get replaced when the new version get released (perhaps through 1-click update?). This is something that I hardly find in the documentation. But then I think, I have the reason why I should version everything because if something goes wrong with the site, (let say the backup restoration failed). I can use this git idea to restore my site. I can create an empty server then pull the git files into my servers and finally  just replace whatever sensitive files that I did not include before.

     

    2 hours ago, JulienPct said:

    In case of big problem on the site requiring to reinstall a Presta or big change of the site directly, it's rare but you never know, we would just have to install a new Presta, put the .git in the httdocs and pull.

     

    The reinstallation thing is the reason why I don't want to experience when the site get deployed  unless it is easy to migrate the database... So, my plan was to version everything including dumping the database. I have a ready bash script that when I trigger a command it will dump the database and automatically use git command to commit my repo. So I got database + files version in one command. The only thing that I care is, since I place this files in private repo in github (as a backup), I should make sure that I ignore the sensitive files... as to prevent those GitHub employees spy on the authentication files just for fun.

     

    2 hours ago, JulienPct said:

    image.png.d87b5bdc08eb1b7ccb32ff7557b66833.png

    The screen above is only a part of my .gitignore

    Seems like from your list, you did not exclude sensitive files like password. If I use git only for local development I don't care about sensitive files but the reason is I also want to 'PUSH' it to private server. That's why I need to exclude sensitive files.

  5. Hello guys, just a quick question that I could not find it mention anywhere about building my .gitignore for sensitive data for Prestashop 1.7.8.1. I want to create a git repository for my current Prestashop and I only want to exclude sensitive information from the .gitignore like username, password or any PHP session files plus the /var/cache folder. For the rest, I want to include it if they do not contain sensitive data.

    This is my current .gitignore that I think they contain sensitive information and cache that should be ignored to be pushed to git repository:

    /.htaccess
    
    /app/config/parameters.yml
    
    /app/config/parameters.php
    
    /var

    Is there any extra information that should be excluded in this list for example the session files .

  6. Since we are discussing about Prestashop Metrics, I do have question. In the latest version of Prestashop Metrics, it does however support linking with Google Analytic. However, it stated in the notification saying this:

     

    image.thumb.png.928ea77f9f651149e5d07bbe31591ea3.png

    It said that it only support Google Analytics up to version 3 if using Google Analytic module developed by Prestashop. But for version 4 it is a paid module.

    When I click on Google Analytics module link above, it automatically install Google Analytics version 4. This is kinda bug here regarding to this notification. Perhaps the version 4 is working fine now? The reason I say this because Prestashop automatically install GA version 4 not the version 3. Anyone have thought about this? 

     

     

    EDIT:

     

    It's ok, I misunderstood the previous notification. It did not say that the module is version 4 but it said the module only support version 3 and under. So, the module is working fine but it does not support GA 4 tracking code.

  7.  

    15 hours ago, JBW said:

    Matomo works same way as GA with external script and it can be installed on separate server

     

    My bad because I did not know what Matomo was, I thought you were referring to a module that use internal database as stats.

     

    12 hours ago, Nickz said:

    Google scripts/fonts are the main reasons sites slow down.

    Don't look at Google as your Savior, for Google we are a product.

    I'm not a big fan of Google (and I agree Google is not a good product when it comes to privacy). From what you are saying above, I think any external scripts or fonts can slow down your site if network issue happens. So, it is not just a Google issue.

    What my previous point mean is, you should never rely on the Prestashop stats that will fill up your database day by day, unless that you have a dedicated database for your Prestashop. So, you should rely on external tracking script such as Google Analytic or Matomo (as mentioned by @JBW ). Using external tracking analytic can increase site performance. There is a nice blog talking about performance impact here if you use Prestashop stats and they recommend using external tracking: https://canonicalized.com/prestashop-speed-optimization/?section=prestashop-performance-options . 

  8. On 11/12/2021 at 3:19 AM, marcosdoteorianerd said:

    Support got back to me today and it looks like they've fixed the issue. I usually got it here.

    The issue has not been fixed. I have sent ticket to support 3 days ago and got no response until now. They said they are aware of this issue. 

     

    On 11/9/2021 at 1:24 AM, Jay-Jay said:

    Go on you virtualhost to apache 

    Open your virtualhot enable

    You must have

    ServerName exemple.com

    ServerAlias www.exemple.com

    Move in

    ServerName www.exemple.com

    ServerAloas exemple.com

     

    After saved and restart your server with

    After prestashop account work

    For me it's good now

    I think this solution kind of effective. To summarize what you are talking here, this is similar like don't let prestashop use www make the domain as non-www.

    I'll try this now.

     

    SOLVED:

     

    EDIT: Guys the issue is solved following the above workaround. This definitely a bug at Prestashop server where it could not determine your root domain to link to your shop. So it does not work if you put subdomain like www into it. Thanks to @Jay Jay for the workaround. 

      

    On 11/8/2021 at 11:52 PM, Wallgrind.nl said:

    Please advise exactly

     

    Look at this post to resolve this issue if you don't want to mess your server configuration: https://www.codegix.com/resolving-error-shops-0-your-shop-is-already-linked-and-verified-in-prestashop/

  9. EDIT 2 (add screenshot). This is the screenshot of the final error.

     

    image.png.4bccd3f0ea4bbc52b8eba1efbb7c8844.png

     

    Why does it complain about Error getting domain?

     

    More info:

     

    My shop is not in maintenance mode

     

    Prestashop version 1.7.8.0

    PHP version: 7.4 

    Webserver: nginx_apache

    Installation type: New

     

    Can any prestashop team look at this issue because I believe the error came from prestashop server and this error is not documented anywhere

  10. It's been a while that I haven't used the latest version of prestashop. Now more things have changed and this is a new feature for me that I could not passed this website association using prestashop metric:

     

    A very simple step to reproduce this issue is:

     

    1) Go to dashboard open PrestaShop Metrics

    2) Now I clicked the Associate button

    3) I login using successfully using credential that I had before

    4) The website field www.domain.com is inserted (my shop domain). Now I clicked on accept and associate but then it said:

     

    Error!

    Your shop could not be associated with your PrestaShop account

    5) Clicking problem details it said:

    ["shops.0.Your shop is already linked and verified"]

    6) Well now I go ahead thinking maybe I should disassociate the website first. So I clicked on View my associated shops and click Dissociate and it asked the following message with two button 

     

    Are you sure you want to remove this shop from your account ?

    If you have ongoing subscriptions, it will be impossible to cancel them.

    [Cancel]                              [Dissociate]

     

    7) Of course I clicked on Dissociate and now the final issue is I got the following error:

     

    Error message

    We were unable to contact your shop, please contact support.

    "Error while getting domain"

     

    And I repeated this step many times and I could not use this feature. Anyone experiencing this issue?

  11. On 3/18/2021 at 10:56 PM, dandumit said:

    @arafatx - what control panel do you use ?  could you please share nginx configuration  ? on mine does not work with media servers. there is still to be added for CSS files.

    Sorry for late reply. It's been few months. I actually use Directadmin control panel. When you use nginx_apache, the prestashop site run on nginx and you can use apache config. So it works out of box.

  12. Seems like an old threat but valid question as today so many cases like this one.

    Since you ask about how to block proxy sites or tor exit and you need this in free way, i suggest that you use a firewall that come with this feature such as Config Server Firewall (CSF)- This is free and it has blocklists setting where you can block tor exit users and list of proxies used by internet users to make this fraud transaction.

  13. On 8/25/2020 at 1:04 AM, ericksonvornes said:

    Did you solved??

     

    Edit. Solved it. Actually it works on prestashop 1.7.6.8. Maybe something wrong with the previous prestashop version but now it's working fine when changing to date. Just change what I said. Also I made a mistake about the type. It should be 'date' not 'birthday'

  14. Ok I think the best is using htaccess for all website. So, I don't have to query SQL: This code is working fine here:

     

            web_user="admin"
            web_domain="mypswebsite.com" # 
            web_sub_folder=""
            web_type="prestashop"
            admin_path="admin"
            maintenance_status=1 #1 = on, #0 = off
    
            # DEFINE FIXED PATH for all maintenance htaccess sites
            maintenance_htaccess_www="/home/$web_user/domains/$web_domain/public_html/$web_subfolder/.htaccess"
            # DEFINE ANOTHER PATH for htaccess maintenance file
            # for prestashop maintenance file
            ps_maintenance_htaccess_admin="/home/$web_user/domains/$web_domain/public_html/$web_subfolder/$admin_path/.htaccess"
    
            if [ $maintenance_status == 1 ]; then
                    echo "[$script_name | info]: Turning on server maintenance mode for user $web_user" | tee -a $REPORT_FILE
                    # rename current htaccess as backup .htaccess_x
                    mv -f "${maintenance_htaccess_www}" "${maintenance_htaccess_www}_x"
                    # create .htaccess file with maintenance content including the html (overwrite)
                    touch $maintenance_file_www
                    echo "# AUTO GENERATED BY MAXIRSYNC BACKUP CRON" >> $maintenance_htaccess_www
                    echo "# This htaccess putting website $web_domain into maintenance mode" >> $maintenance_htaccess_www
                    echo "RewriteEngine on" >> $maintenance_htaccess_www
                    echo "RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]" >> $maintenance_htaccess_www
                    echo "RewriteRule .* /maintenance.html [R=302,L]" >> $maintenance_htaccess_www
                    # wait 1 seconnd
                    chmod 644 $maintenance_htaccess_www
                    chown $web_user:$web_user
                    sleep 1
                    if [ "$web_type" == "prestashop" ]; then
                            # DO PRESTASHOP THING
                            # rename current htccess inside admin_dash into .htaccess_y
                            mv -f "${ps_maintenance_htaccess_admin}" "${ps_maintenance_htaccess_admin}_y"
                            # copy the same .htaccess including permission file from root to admin_dash
                            cp -p "${maintenance_file_www}" "${ps_maintenance_htaccess_admin}"
                    elif [ "$web_type" == "wordpress" ]; then
                            # DO EXTRA WORDPRESS THING
                            :
                    fi
                    echo "[$script_name | info]: OK, the website of $web_domain is now under maintenance mode" | tee -a $REPORT_FILE
            else # maintenance status = 0
                    # rename the backup .htaccess_x into .htaccess (and overwrite)
                    mv -f "${maintenance_htaccess_www}_x" "${maintenance_htaccess_www}"
                    if [ "$web_type" == "prestashop" ]; then
                            # PS
                            # rename back the admin_path .htaccess_y into .htaccess inside that admin_dash folder (and overwrite)
                            mv -f "${ps_maintenance_htaccess_admin}_y" "${ps_maintenance_htaccess_admin}"
                    elif [ "$web_type" == "wordpress" ]; then
                            # WP
                            :
                    fi
                    echo "[$script_name | info]: OK, the website of $web_domain is now under live mode" | tee -a $REPORT_FILE
            fi

     

  15. I'm writing the script to put all website in maintenance mode. The bash script is dynamic so it will identify which user to put into maintenace mode, using sql statement is not good here to identify which web_user. So if there is a way like using file based maintenance mode (like wordpress) I really like to know this:     

      #web_user="userwordpress"
    
            #web_domain="mywsite.com"
            #web_sub_folder="www"
            #web_type="wordpress"
            #maintenance_status=1 #1 = on, #0 = off
    
           web_user="userprestashop"
    
           web_domain="mypssite.com"
            web_sub_folder="www"
            web_type="prestashop"
            maintenance_status=1 #1 = on, #0 = off
    
    
    
            if [ $maintenance_status == 1 ]; then
                    if [ "$web_type" == "wordpress" ]; then
                            echo "[$script_name | info]: Turning on server maintenance mode for user $web_user" | tee -a $REPORT_FILE
                            maintenance_file="/home/$web_user/domains/$web_domain/public_html/$web_sub_folder/.maintenance"
                            if [ -f $maintenance_file ]; then
                                    echo "[$script_name | info]: OK, the website of $web_domain is already in a maintenance mode" | tee -a $REPORT_FILE
                            else
                                    touch $maintenance_file
                                    echo "# AUTO GENERATED BY MAXIRSYNC BACKUP CRON" >> $maintenance_file
                                    echo "<?php" >> $maintenance_file
                                    echo "$upgrading = time();" >> $maintenance_file
                                    echo "?>" >> $maintenance_file
                                    chmod 644 $maintenance_file
                                    chown $web_user:$web_user
                                    echo "[$script_name | info]: OK, the website of $web_domain is now under maintenance mode" | tee -a $REPORT_FILE
                            fi
                    fi
                    if [ "$web_type" == "prestashop" ]; then
                            # Prestashop put maintenance mode
                    fi
            else # maintenance status = 0
                    if [ "$web_type" == "wordpress" ]; then
                            if [ -f $maintenance_file ]; then
                                    rm -f $maintenance_file
                            fi
                    else
                            # Prestashop put back live mode
                    fi
            fi

     

  16. 5 minutes ago, musicmaster said:

    You might consider to put all the employees in the employee table as "inactive".

    Ok that is a great idea. But, I forgot to mention, I don't want to write script using sql like above because it has sensitive information about db login. I mean is there alternative way other than changing the database table ? If no way I think setting the employee table as inactive is the best idea.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More