Jump to content

arafatx

Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by arafatx

  1. 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.
  2. I use nginx_apache reverse proxy and it works great.
  3. 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.
  4. 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'
  5. 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
  6. 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
  7. 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.
  8. Hello there, what are the alternative ways to put prestashop into a maintenance from the backend server ? At this moment, if I want to manually put a prestashop website into maintenance mode, I can manually change the ps_configuration table. So, I created a bash script and change the database table to maintenance mode like this. This is working for me: echo "[$script_name | info]: Turning on server maintenance mode for user admin:" | tee -a $REPORT_FILE # For lozira.com (prestashop) LOZDBUSER="dbuser" LOZDBPASS="dbpass" LOZDBNAME="dbname" # Clear Prestashop IPs from back office mysql -u $LOZDBUSER -p$LOZDBPASS -D $LOZDBNAME -e "UPDATE ps_configuration SET value = NULL WHERE ps_configuration.id_configuration = 1002;" # Disable prestashop shop from back office mysql -u $LOZDBUSER -p$LOZDBPASS -D $LOZDBNAME -e "UPDATE ps_configuration SET value = 1 WHERE ps_configuration.id_configuration = 28;" return_code=$? if [ $? -eq 0 ]; then echo "[$script_name | info]: OK, the website of domain.com is now under maintenance mode" | tee -a $REPORT_FILE else echo "[$script_name | info]: Warning, unable to put website of domain.com in maintenance mode" | tee -a $REPORT_FILE fi The front page is under maintenace mode but I notice I can still access into the back office domain.com/backofficeurl (this is what I don't want). I also want to block admin users from accessing the back office until the script finished running. Another way I can think of is creating maintenance using .htaccess in the root domain and then another htaccess inside domain.com/backofficeurl.. but is that one of the alternative approaches ? How do you put the entire site including people at the back office who won't be able to log into dashboard ? Then you can enable this from the server. I know how to do this in wordpress using .maintenance file but in prestashop I don't find any alternative ways. Is there an approach like wordpress .maintenace file ?
  9. Ok, how do I change the field name based on country selection ? Example if I select Singapore, I want the 'address 2' label to be translated like 'Street name' or if I select other country like Cambodia I want the 'State' label to be translated as 'Province'. Anyone have idea ?
  10. I guess the range of the ID has maximum of 2,147,483,647. That is 2 billions click to go. So, if somebody could reach that ID, it's the end of Prestashop life . ps: it's the same issue with prestashop 1.7.6.7
  11. I found out another way without using 3rd party module is to create different zone in states and define that price range in zone. This solved my issue.
  12. I found out that I think I don't need a module for this requirement. I just need to create different zone for states and define the price range for that zone and thats it. Anyway I just purchased a module to extend the functionalities.
  13. I want to have option to ship by states and each state has different delivery charges. I spent few days reading about this and I finally found out that PS has not implemented this feature: https://github.com/PrestaShop/PrestaShop/issues/11662 To explain more about the issue here it is: Can anyone recommend what module that can be used to fullfil the requirement ?
  14. This is not possible in Prestashop as far I understand. I have been looking for this feature lately and found out this feature is not implemented. Someone reported issue here: https://github.com/PrestaShop/PrestaShop/issues/11662
  15. I can think of creating duplicated countries and this might work. I saw a Malaysian website (using prestashop as well) who might ran out of idea how to solve this and he created 3 Malaysia countries like in the screenshot. So, I think he assign states in Zone 1 to country Malaysia Peninsular, Sabah State into Malaysia Sabah, and Sarawak State into Malaysia Sarawak. Screenshot (the website is jelitasara.com): I think this is a bad idea because a country shouldn't be divided like that and a country must have standard and specific ISO CODE. So using Zone is a must but that doesn't work. Anyone have suggestion or any module that can fix this problem ? Edit: seems like this feature is not available and someone suggest to use a module instead. https://github.com/PrestaShop/PrestaShop/issues/11662
  16. Ok.. reading up few posts, I think this is a design flaw by PS. In my country Malaysia the shipping fee is based on local state example i'm in the Peninsular Zone. So, Shipping between Peninsular Malaysia (Zone 1) - > The price is MYR 7 Shipping to Sabah (Zone 2) -> The price is MYR 11 Shipping to Sarawak (Zone 3) -> The price is MYR 11 So, I created 3 Zones Zone 1 -> which contains this state: Johor, Melaka, Selangor, Pahang, Kuala Lumpur, Putrajaya, Labuan, Penang, Kelantan, Terengganu, Perlis ... Zone 2 -> which contains this state: Sabah Zone 3 -> which contains this state: Sarawak So, I assigned them perfectly. Now, for the courier, I only select this 3 Zones and assign the price between 0kg to 10000kg with the fixed price above. Next I made a sample purchase, in the address I put the state 'Melaka' and it's in Zone 1. But guess what, I cannot select courier there is no courier available to be selected. The reason is because.... Malaysia Zone is in Asia!!! and I also have to select Asia Zone in courier but selecting the Asia Zone I have to define the price for that Asia zone.. meaning that... whatever state I selected I got the delivery price from the Asia Zone not the Zone from Zone 1, Zone 2 or Zone 3. So.... anyone have answer for this ?
  17. The other thing that I can think of is that, you divide the zone in country. Example you would represent different zones as different alias Country: UK Mainland, Country UK Scotland Highlands etc....
  18. What did you do to make it work ? Sounds like you have done something magical.
  19. Boleh PM saya untuk maklumat lanjut. Kalau nak integrate macam biasa biasa: Pergi dekat github ada salah satu developer yg develop billplz module Tapi sebelum integrate memang kena daftar dulu account dengan mereka
  20. Can anyone shed more light to this post especially on the ps 1.7. this one is working. thanks a lot
  21. when adding this, it will also display at the profile. Example i want to add recaptcha in the registration field but i dont want to show recaptcha in the profile view
×
×
  • Create New...

Important Information

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