Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi udarts,

    The code should work with the latest WordPress and WooCommerce releases.
    I guess you copied your functions.php to your child-theme?

    The ajax-call will return a 0 if the call can’t be run or can’t be found.
    Please check if your URL is consistent with the function in functions.php and the add_action(‘wp_ajax_previewemail‘, ‘preview_email’).
    here the ‘preview_email’ revers to the function preview_email() and the wp_ajax_previewemail declares the ajax-call previewemail (which you use in your URL).

    If this still doesn’t work for you, please post your code and URL you use.

    You can use function:
    the_ID();

    Install Firebug for Firefox.
    Press F11, and a console will pop-up. See here: https://getfirebug.com/
    In the left top corner you see a ‘bug’. Next to it a square with an arrow. Click on that. Next klik on you “readmore button”. In the firbug console look for the id=”something” (or maybe class=”something”) of your button/link.

    Next edit your (child) style.css:

    #something {
    text-align: center !important;
    }

    In case of a class:
    .something {
    text-align: center !important;
    }

    Hi again,

    I solved this by doing the following:

    Add to functions.php:

    function preview_email()
    {
        $orderId  = 914;
        $email_class = 'WC_Email_New_Order';
    
        $wc_emails = new WC_Emails();
        $emails = $wc_emails->get_emails();
    
        $new_email = $emails[$email_class];
        $new_email->trigger($orderId);
    
        echo $new_email->get_content();
    
        return null;
    }
    
    add_action('wp_ajax_previewemail', 'preview_email');

    call in browser:
    http://yousite.com/wp-admin/admin-ajax.php?action=previewemail

    There are important variables in the preview_email function:
    $orderId => put here an orderId from you order database
    $email_class => put here the email template you want to preview.

    choose one of the template files:
    WC_Email_Customer_Note
    WC_Email_Customer_Completed_Order
    WC_Email_Customer_New_Account
    WC_Email_Customer_Reset_Password
    WC_Email_Customer_Processing_Order
    WC_Email_Customer_Invoice
    WC_Email_New_Order

    If you don’t want to make changes in the function, you can also so something like this:

    http://yousite.com/wp-admin/admin-ajax.php?action=previewemail&mail=WC_Email_New_Order&order=914

    In this case preview_emails function will be:

    function preview_email()
    {
        $orderId  = $_GET['order'];
        $email_class = $_GET['mail'];
    
        $wc_emails = new WC_Emails();
        $emails = $wc_emails->get_emails();
    
        $new_email = $emails[$email_class];
        $new_email->trigger($orderId);
    
        echo $new_email->get_content();
    
        return null;
    }
    
    add_action('wp_ajax_previewemail', 'preview_email');

    Works like a charm!

    Thanks Shauno!

    By the way… I can manage the custom fields themselves via the menu, but they do not show up any more in the NGG galleries.

    I ended up by NOT using variable products, but simple products with their SKU as configuration. For example. SKU is 100299333, 100 is stands for product type A, 299 stands for option A for product A. 333 stands for option B for product A.
    Actually, I let the user select different options. These options combined is a SKU. At the end I add the product by SKU to the cart.

    The only con is that I have to add all product-option combinations to the product db. Plugin ‘Woocommerce product importer’ works like a charm for doing this.

    Ah.. my open question…

    I solved this by adding the meta data to teh db in the order-details.php. This is shown after a user completes his order. Here my session variables are accessible. I still don’t know why my session vars aren’t accessible when a new user is created.

    Anyway this workaround works.

    Hi,

    This is quite easy.
    Check out: http://codex.wordpress.org/WordPress_in_Your_Language

    WordPress is by default English. So check your wp-config.php and check for the defined language:
    For English (default) this should be:
    define (‘WPLANG’, ”);

    This will automatically override your language setting of Woocommerce. So, MEIN KONTO will be shown as MY ACCOUNT etc.

    good luck!

    Ok, maybe I have to rephrase my question with an example.

    On the products page I have a text input field. User has to enter a number in the field. I save this value in $_SESSION(‘number’)

    Now.. How can I save this $_SESSION(‘number’) in the wp database if a new user is created on checkout. I want to save this $_SESSION(‘number’) in the wp_usermeta table, together with all the other user info.

    Thanks!

    Update:

    The sizes must be stored to the database only if a new user is created. So the code goes somewhere around line 650, in the if:

    // if there are no errors, let’s create the user account
    if ( ! $reg_errors->get_error_code() ) {

    after line:
    do_action( ‘woocommerce_created_customer’, $this->customer_id );
    $size1=$_SESSION[‘sizes’][0];
    add_user_meta( $this->customer_id, ‘_size1’, $size1);

    Anyone??? Please I’m desperate 🙂

    I resolved this issue myself. Thanks anyway 😉

    Hi guys,

    In addition to my last post…

    I have updated my WordPress to version 3.5
    There is something strange going on. It seems something small that I might overlook?
    I can load the map on localhost (development pc), but the map doesn’t load on the internet server. Actually, looking at the source code, from the line “<div class=”entry-content”>” nothing is loaded. When I disable the plugin, the rest of the (empty) page is loaded.

    Do you know why this is caused? Has it got to do to with .htaccess (increased security of WordPress 3.5? it tried to remove some lines from the htacces, which caused my site to collapase 😉

    So I am a bit clueless… Please help!

    Thanks in advance!!!!

    I also experience many compatibility problems with 3.5

    1. Implemented dropdown menu’s stopped working.
    2. Nextgen Gallery Voting stopped working (ability to rate images).
    3. And some other functions stopped working.
    4. The prepare() function needs a second parameter. So databse queries of some plugins stopped working.

    I understand that WordPress should be more stable with this update, but this is quite a big step… I understand from many users that a lot work needs te be put in to make everything work again. For some plugins the only solution is to disable it and wait for an update. Not so nice.

    So I am going to roll back to previous version, untill the plugins are made compatible with 3.5

    Hi,

    I have a similar problem. first of all, thanks for the amazing plugin!

    The problem that I am facing is that sometimes the map is shown correctly, and sometimes it isn’t shown at all (allthough the <div> IS shown!). If I look at the sourcecode (using Firebug) when the map is shown correctly, the sourcecode is:

    <div id=”ngg_geo_map_734″ class=”ngg_geo_map MSVE_MapContainer” style=”width: 600px; height: 400px; overflow: hidden; background-image: none; background-color: black; cursor: url(“http://ecn.dev.virtualearth.net/mapcontrol/v6.3/cursors/grab.cur&#8221;), move;”>

    When the map is NOT shown, the sourcecode is:

    <div id=”ngg_geo_map_407″ class=”ngg_geo_map MSVE_MapContainer” style=”width: 600px; height: 400px; overflow: hidden;”>

    As you can see, a few arguments are missing when the map isn’t shown, especially the url.

    Is this a timing issue?? Seen the fact that the sourcecode is sometimes correct??

    Thanks in advance!

    By the way, I am using the twenty eleven theme (with a child template).

Viewing 15 replies - 1 through 15 (of 15 total)