Forum Replies Created

Viewing 12 replies - 16 through 27 (of 27 total)
  • Yo should only write PHP Code in your functions.php. That script i gave you is JavaScript. You have to add script tags arround it.

    Some ways to do so:

    1. Add JavaScript plugin and paste it in there
    2. Go to your theme Template right bevore </body> ends and paste it here with the script tags arround it
    3. Go to your Theme Template and link a script file like so:
    <script src=”/scripts/scripts.js”></script>
    Now create the js file in that location and paste the function i gave you in there.

    No Problem, glad i could help

    • This reply was modified 3 years, 4 months ago by mango404.

    It’s better to use php on that becouse JavaScript works locally on the Users device while php works server sided. By using more JS it could affect the Sites performance.
    But honestly JS would be easier i think and little JS wont affect your Sites performance:

    //the function
    function addBorderIfValue() {
    	// wishlist-count should be the id name of the Html element you ant to add border to
    	var borderElement = document.getElementById("wishlist-count");
    	// Check if borderElement has text and add border if so
    	if (borderElement.innerHTML.length != 0) {
    		borderElement.style.border = "2px solid #fff";
    	}
    }
    
    // Call it when page loads
    addBorderIfValue()

    Just add this between <script></script> tags. You could also add a class instead of styles width:

    //the function
    function addBorderIfValue() {
    	// wishlist-count should be the id name of the Html element you ant to add border to
    	var borderElement = document.getElementById("wishlist-count");
    	// Check if borderElement has text and add border if so
    	if (borderElement.innerHTML.length != 0) {
    		borderElement.classList.add("class-name");
    	}
    }
    
    // Call it when page loads
    addBorderIfValue()

    I cannot help you with the PHP aproach. I’m sorry. Hope it helps ??

    • This reply was modified 3 years, 4 months ago by mango404.

    What happens if you add products to cart in another language and switch to english? If the cart gets empty too it could be overriding the current user session

    Maybe JavaScript?
    call function onload and check for innerHTML. If true add styles.

    Otherwise you could script it in php in your Plugin templates. Check for the Wishlist count number and add a class to the Html element if true. And add the border css to that class

    • This reply was modified 3 years, 4 months ago by mango404.

    Is your Debug Mode active?
    You can find that in wp-config.php at root.

    define(‘WP_DEBUG’, true);

    If so, just turn it of by typing “false” where “true” is.

    Debug Mode can provide more information about your Issue yes. But i wouldn’t activate it untill your Site has a complete Backup.

    WooCommerce maybe has some more information too. You can access it in your backend:
    WooCommerce > Status And WooCommerce > Status > Log

    Did you know WooCommerce has a timeout? By default the timeout is one hour. Maybe some new or freshly updated plugin overrode that

    Thread Starter mango404

    (@mango404)

    Hi Igor,
    thank you for replying.

    Screenshot of invoice table:
    https://snipboard.io/GfqIPZ.jpg

    There are lots of other plugins installed but if i deactivate all WooCommerce related ones it still happens.

    (Please do not waste much time here. I never saw that issue on other WooCommerce installations or in any other forum. It’s just how damaged the page is due to inexperienced developers)

    Thank you ??

    hi muddasir786,
    could you provide more infomation about your environment?

    You could try turning on Debug mode in your wp-config.php for more information about the error. But that could output ugly error codes on your entire page. I would suggest installing the page locally and then activating Debug mode.

    Maybe you could let your customers know that you work on it by displaying a message at Cart page and blocking the checkout. Something like “We are currently working on improving your shopping exiprience, please try again later”.

    Hi sundar76,
    have you checked if sql was working?

    I always update de wp_options table manually with the new URL. I never edited wp_posts, wp_links or any other Table within that DB and it always worked for me.

    Hi sundar76,
    Most of the time the error comes ou of your wp-config.php at root. Some information you added there is maybe wrong.

    Hi thebackbencher,
    i would suggest using some version control system like GitHub for example. If installed right, GitHub shows you what files have changed. So you can just override those files on the server. But as soon as you add or edit something in the WordPress Backoffice you have to upload your whole database anyways becouse thats where it’s saved.

    To GitHub

    Usefull little-/none-Code GitHub software:
    GitHub Desktop
    Fork

    GitHub is free to use and you can work as a Team in one Repository.

    hi nika,
    what Theme are you using?

    Maybe in:
    Appearance > Widgets

    The way your Code was build tells me it was made by some Plugin or Theme. So you should be able to chance that.

Viewing 12 replies - 16 through 27 (of 27 total)