Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Not out of the box, there are plenty of filters and actions provided by this module to allow you to customize that, but it would require custom development at this time

    Quick fix you can add to a custom plugin or themes function.php:

    add_filter( 'facetwp_pre_filtered_post_ids', my_fwp_filter_post_ids');
    function my_fwp_filter_post_ids($post_ids){
        if(!empty($post_ids) && is_object($post_ids[0])){
            $post_ids = wp_list_pluck($post_ids, 'ID');
        }
        return $post_ids;
    }
    Thread Starter zaphod-42

    (@zaphod-42)

    I did notice that, I had to temporarily increase some PHP variables to get it to run past ~500 posts, I’m working on a new version based on this plugin to use ajax to execute the bulk actions in batches, if my boss doesn’t retask me and you’re interested I’ll share it when it’s done

    Thread Starter zaphod-42

    (@zaphod-42)

    Exactly

    Thread Starter zaphod-42

    (@zaphod-42)

    A little help on this, I’ve created 2 product groups, one of them is Product A, and the other is Product B

    If I add a single Product A to the cart, the discount shows up on Product B, however, I can add as many Product B’s as I want to the cart at the discounted price, how can I limit this so the discount only applies to the same number of Product B as I have of Product A?

    Thread Starter zaphod-42

    (@zaphod-42)

    Awesome, thanks!

    Thread Starter zaphod-42

    (@zaphod-42)

    hey cubecolour,
    I appreciate that, and I have thought about it, and may do it if this doesn’t get worked out, more importantly than how I fix the problem, I’d like to know why it’s occurring so I can avoid it in the future on this, and other jobs.

    Thread Starter zaphod-42

    (@zaphod-42)

    ok, I think I wasn’t clear in my earlier post….in the function I posted called “pt_process_post” I create an array to insert into the table, the row is inserted but the values are blank… the function is being called and the query is working. From that I can determine that when the submit button is pressed the init hook gets called 1 time before the page loads again, but when that hook is called the $_POST and $_REQUEST variables are empty. If I go to an admin page that I’ve created and submit a form, the values are inserted into the database as expected.

    Thread Starter zaphod-42

    (@zaphod-42)

    That’s nonsense, the variable can’t change from something outside of the scope before the scope exits anyway unless I call the function and send it as a reference or overwrite it, when I dump that variable to the database it has the exact same value as echoing it. The row is inserted before the function completes so the value of $_POST doesn’t change whether or not I echo and exit (which btw isn’t something I’m inclined to do in a customers production site).

    Thread Starter zaphod-42

    (@zaphod-42)

    I can’t echo, the redirect seems to be causing the whole thing to skip something. but serializing the post and inserting into the db has the same effect as echoing, except I can see if something was passed even if the echo doesn’t get to the screen, like I said I’m pretty well versed in php and sql, and this has been a very reliable way to troubleshoot forms in every system I’ve used…. well until now, I may have to just talk this client into drupal, I’ve never run into this kind of weirdness there

    Thread Starter zaphod-42

    (@zaphod-42)

    um, like I said I’m dumping it into a db table…
    the relevant code is here:

    add_filter('the_content','pt_edit_content');
    add_action('init','pt_process_post');
    function pt_edit_content($content){
      if(!is_page('1176')){
        return $content;
      }
      $form='<form method="post" action=""><input type="hidden" name="form_id" value="affil_signup">';
      $fields=array('Name','Email','Link');
      foreach($fields as $field){
        $safe=strtolower($field);
        $form.='<div style="padding: 15px;"><label for="'.$safe.'-edit">'.$field.': </label><input id="'.$safe.'-edit" name="'.$safe.'" /></div>';
      }
      $form.='<input type="submit" value="Submit" /></form>';
      return $content.$form;
    }
    function pt_process_post(){
      global $_POST,$_REQUEST,$wpdb;
      $data=array(
        'post'=>$_POST,
        'request'=>$_REQUEST,
      );
      $wpdb->insert('pt_dump_table', array('data'=>serialize($data));
    }

    Like I said I’ve played with the action and had no luck, I’ve also used my own database management functions to insert rows from a php file I’ve pointed the action to with the same lack of results.

    Thread Starter zaphod-42

    (@zaphod-42)

    I’ve tried using global $_POST, also tried global $_REQUEST, they are both empty, wordpress is still relatively new to me, I’ve built a couple plugins and several widgets, I’m well versed in php and mysql, and have been developing on drupal for a couple years, I’ve also created several stand alone web apps. I worked a little more on it today with no progress, the only thing I can think is that it must have something to do with validation, does wordpress validate form data using some sort of form id system?

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