PHP Scripts Development » PHP Classes Support Forum » Db_cart class Support forum

Using 2 different VAT percentages

(6 posts)

Tags:

  • Started 2 months ago by fetuline
  • Latest reply from fetuline

Great offers not only for geeks!


  1. Hello,
    is it possible to handle 2 VAT's -19% and 7%- in a simple way?
    Best regards
    Dirk

    Posted 2 months ago #
  2. Sorry, but I don't understand parts of the script ;-((
    I changed the vat_perc in the table db_cart_example_products to 7.0 but when I put this item in the cart, the table db_cart_rows shows in vat_perc 19.0 :The value of the defined VAT_VALUE.
    What van I do to get the right value, help me , please.
    Best regards
    Dirk

    Posted 2 months ago #
  3. Hi,

    you need to store the VAT for each product. Check the order row table, there is a column to safe the VAT for each order row.

    I changed the vat_perc in the table db_cart_example_products to 7.0 but when I put this item in the cart, the table db_cart_rows shows in vat_perc 19.0 :The value of the defined VAT_VALUE.

    this value is just a default (if no other value is defined)

    Posted 2 months ago #
  4. you need to store the VAT for each product.

    Ok, but I thought, the script read the vat_perc from the product table and safe it in the order row table. Same as the other product values.

    Thank you for help
    Best regards
    Dirk

    Posted 2 months ago #
  5. Hi,

    check this method:

    function handle_cart_row($prod_id, $prod_name, $quantity, $price, $replace = "no", $vat_amount = VAT_VALUE) {
    		$check_row = $this->check_existing_row($prod_id);
    		if ($check_row == "old") {
    			$this->update_row($this->curr_product, $quantity, $replace);
    		} elseif ($check_row == "new") {
    			$this->insert_row($prod_id, $prod_name, $quantity, $price, $vat_amount);
    		} else {
    			$this->error = $this->messages(13);
    		}
    	}

    use for $vat_amount whatever value you like, I don't store the percentage because you can use the amount also exclusive the VAT.

    Posted 2 months ago #
  6. Ok, that's the point, I change it.

    Thank you for help
    Best regards
    Dirk

    Posted 2 months ago #

RSS feed for this topic

Reply

You must log in to post.