Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Have you resolved this issue? We have the exact same problem here. In addition to johnnyrokkit, I would say the support forum of the Shopp plugin is also useless…

    Thread Starter izne

    (@izne)

    Meanwhile, I figured this out myself and here is my “rude” approach.
    First I created the field in views/form.php like this:

    <p>
                        <label for="sreg-vat">BTW</label>
                        <input type="text" name="billing[vat]" id="sreg-vat" value="<?php echo (isset($_POST['billing']['vat'])) ? $_POST['billing']['vat'] : ''; ?>" />
                    </p>

    Added a small function that writes the VAT…

    private function addVAT($email, $vat = ''){
        /**
        * shoppregcust::addVAT()
        * by izne <me@izne.info>
        *
        * @param mixed $email
        * @param mixed $name
        * @return
        */
        global $wpdb;
    	$id = $wpdb->get_var("SELECT id FROM wp_shopp_customer WHERE email = '".$email."'");
    	   if($id){
    	       $varr = array("vat" => "$vat");
    	       $a = serialize($varr);
    	       $sql = "
    	       UPDATE wp_shopp_customer SET
    	       <code>info</code> = '$a'
    	       WHERE <code>id</code> = $id";
    		  $wpdb->query($sql);
    		  return 1;
    		}
    
        return 0;
        }

    … and used it after $shopp_customer->save(); like this:
    $this->addVAT($customer_data['email'], $_POST['billing']['vat']);.
    So far it looks like working for me.

    Thread Starter izne

    (@izne)

    Hey maca134,

    We have a customer-info field for VAT number in our Shopp checkout. <?php shopp('checkout','customer-info'); ?>

    I need to make small modification now to have this field also in the registration from from your plugin. Could you give me an advice on how is the best way to make that field recorded when user is created?

    Thread Starter izne

    (@izne)

    Hey Steve,

    THANKS!

    I totally missed that variable name was incorrect.
    I owe you a beer 🙂

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