Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • it turns out there’s a second PayPal payment option called “PayPal Checkout”. I’m not entirely sure what the difference is under the hood, but it seems to work the way we both expect (i.e. sending all product information to PayPal). One thing to note is that when entering account information, it asks for API certificate and API subject, which you don’t need / PayPal doesn’t have any more (as far as I can tell). Username + Password + Signature seemed to work just fine.

    • This reply was modified 5 years, 9 months ago by mikeburns.

    similar (if not same) issue here: I add 2 items to my cart, checkout, and PayPal only thinks I’m buying one item whose name is simply items 1 + 2 concatenated, which can get very long and is not optimal for people buying tons of stuff. I’d rather the PayPal invoice be itemized just like the WooCommerce invoice.

    caveat: I’m using Mix and Match plugin, so each item has multiple sub-items (e.g. “photo starter kit” has a camera, SD card, stand, and objective).

    Is this a PayPal setting or a WooCommerce thing?

    Thread Starter mikeburns

    (@mikeburns)

    current version of Pro is 1.8.5, but there is no option to upgrade this one. It should be noted that as we are upgrading a lot of stuff at once, we first set up a test environment on a subdomain (test.domain.tld) so maybe that’s why the upgrade is not showing, because the pro plugin is bound to domain.tld?

    Thread Starter mikeburns

    (@mikeburns)

    SUPER SORRY – I post before I’ve tested, because I was so excited to be so close. But the poblem with the last post was that instead of the string ‘gallery’, one needs to put in the unique ID generated from ACF in the background at the time the gallery was created. I’ve developed the following function to retrieve this unique ID:


    function get_acf_uid($field_name) {
    $acf_query=new WP_Query(array(
    'name'=>'acf_'.$field_name,
    'post_type'=>'acf'
    ));
    $acf_gallery_options=get_post_meta($acf_query->post->ID,null,true);
    foreach($acf_gallery_options as $key=>$val) {
    if(strpos($key,'field_')!==false)
    break;
    }
    return $key;
    }

    And the proper way to add/update a gallery object in ACF would then be:


    $uid=get_acf_uid('galerie');
    add_post_meta($post->ID,'_galerie',$uid,true) or update_post_meta($post->ID,'_galerie',$uid);
    add_post_meta($post->ID,'galerie',$images,true) or update_post_meta($post->ID,'galerie',$images);

    note that my field is called ‘galerie’ (German for ‘gallery’), and $images is still an array of attachment IDs. If someone comes up with a better idea, share it!

    PS: I’m still not 100% sure that this unique ID is generated when the gallery is created: it can be that the ID is first created when the first gallery is saved (which would be bullocks), but in that case you just need to manually add a gallery to a post in the backend and then this code should work fine.

    peace

    Thread Starter mikeburns

    (@mikeburns)

    nope, still too early…

    get_field() takes 2 parameters: $field_name and $post_id, respectively. If $post_id is not given (or false), then the current post ID is taken (global $post).

    then the type of field is checked from the database, in my case, type “gallery”. So then the gallery object is instantiated, and the function get_field() is called (but here the parameters are different, but it doesn’t concern us, because it’s only ever called internally from the global get_field() function).

    I allow my users to upload and manage their own galleries from the front end, and so it is that I never added the meta field to tell the ACF API that this field is indeed a gallery:

    add_post_meta($post->ID,’_fieldname’,’gallery’,true) or update_post_meta($post->ID,’_fieldname’,’gallery’); add_post_meta($post->ID,’fieldname’,$images,true) or update_post_meta($post->ID,’fieldname’,$images);

    where $images is an array of attachment IDs.

    Hopefully this clears this up for those of you who are also trying to implement a front-end gallery interface.

    Thread Starter mikeburns

    (@mikeburns)

    it’s too early on Sunday morning for WordPress…

    the proper syntax is: get_field($postID, $varname) – I just set $varname, which returned an array of the attachment IDs. I guess this is an OK feature – it’s probably quicker and allows me to generate only the URLs I need. The reason it worked before was because there were no posts with a gallery.

    Hopefully this helps some other trigger-happy WordPressers…

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