Dynamic dropdown product list

Home Forums Quform WordPress Dynamic dropdown product list

This topic is: not resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9233
    fair-agenceweb
    Participant

    Hello,

    I was wondering if it was possible in a qform to build a select that will automatically fill the options with a product list taken in a specific category.
    I am using WPShop and i wanted to insert a qform in the product sheet (it will be called with a lightbox)

    Here are the specs of my website :

    Wordpress 3.8.1
    Custom theme (locally running for now)

    plugins :
    WPShop 1.3.7.8
    Lightbox Plus ColorBox 2.6

    Thanks for your answer

    #9241
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #9243
    fair-agenceweb
    Participant

    Hello,

    Thanks for your answer but i must admit that i absolutely don’t get it

    For example, the user post that code :

    function mytheme_post_to_another_script($form)
    {
    // Rewrite the post variables
    $post = array(
    'vendor' => $_POST['iphorm_3_3'],
    'newvendor' => $_POST['iphorm_3_7'],
    'rep' => $_POST['iphorm_3_8'],
    'delete' => $_POST['iphorm_3_11'],
    );

    // Create a new cURL resource
    $ch = curl_init();

    // Set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, 'http://test.gen-techno.com/scripts/vendorupdate.php');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));

    // Grab URL and pass it to the browser
    curl_exec($ch);

    // Close cURL resource, and free up system resources
    curl_close($ch);
    }
    add_action('iphorm_post_process_3', 'mytheme_post_to_another_script', 10, 1);

    I don’t understand where this code is inserted, in function.php ?
    Plus, how does it get informations ?
    My dropdown list must fill itself with a list of product, in a specific category, i’m not sur that this code is the right one for what i meant to do, is it ?

    #9248
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #9253
    fair-agenceweb
    Participant

    Hello,

    well i’m sorry but that doesn’t help at all. Where do i have to insert that part of code ? is that in a specified file somewhere ? how do i get the form to take this particular function ?

    Can you be a bit more specific with your advices please ?
    Plus the options here are set manually, aren’t they ?

    function mytheme_dynamic_dropdown_values($form)
    {
    $options = array();

    // Connect to the database and build up the $options array with the options,
    // they should be in the format:
    // $options = array(
    // 0 => array(
    // 'label' => 'Option 1',
    // 'value' => 'Option 1'
    // ),
    // 1 => array(
    // 'label' => 'Option 2',
    // 'value' => 'Option 2'
    // ),
    // ... etc ...
    // );

    $dropdown = $form->getElement('iphorm_2_1');
    if ($dropdown instanceof iPhorm_Element_Select) {
    $dropdown->setOptions($options);
    }
    }
    add_action('iphorm_pre_display_2', 'mytheme_dynamic_dropdown_values');

    Best regards,
    F.

    #9269
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy