Jump to content

xyncro

Member
  • Posts

    198
  • Joined

  • Last visited

Posts posted by xyncro

  1. .. :)

    it's been a while since i visited cc forums.. :)

    i would like to know where i can find cc2 support

    or if someone is able to help me through here

    i need help with a function that has been causing some problems for me lately..

    on my CC v2.07, i have a 'fast' buy button that adds the product in the basket

    once the product has been added and click the back button on the browser, the cart adds a new product

    anyone up for the task?

    paypal will of course go your way

    plz pm me

    thx..

  2. It will not reduce the stock UNTIL you manually change the status of the order under Admin for each separate order!

    ..mm yes i understand.. :yeahhh:

    but.. :errm:

    if i intend to sell out some stuff and not order them anymore then i'll have some problems if the stock functions are NOT automated, i would need to sit and watch each and every incoming order and then process them fast to reduce stock... naaa!!! who does that..?? it wouldn't be right anyway..

    let's say i have 10 left and a customer orders more, the buy would continue since the stock would not stop or inform the customer that there is only 10 to order.. and what if.. there were other customers at the same time ordering the same stuff, products that aren't there.. puhh!!.. :)

    well.. this ain't good.. :huh:

    as you said jabba..

    It would be nice if there was a tick box option to auto reduce stock or not when using Postal Order option!
  3. hi...

    i would like to know where i'm able to change format on how the shipping date in admin is displayed/generated with the leaving orders

    i'm using swedish and when i'm clicking the "ship today"-box the above field gives me english date and time

    anyone helpful here..?

    thx..

  4. Hi.. :(

    ..does anyone know why the stock level is not changing..?? :(

    no matter how many items i buy from the store, there's still the amount i gave when i added the product..

    should this not work like the instock mod for CC2, where one's taken and the stock decreases with one and so on..??

    when i'm looking at product inventory - add product, somewhere there it says "Stock Level:

    (This level reduces each time an item is sold.)"

    any suggestion/solution to this..??

    thx..

  5. hi kaskudoo... ;)

    well i've thought about that too but.. i think.. :( that the $lang['front']['cart']['shipping'] i found is common with all the 3 steps (2, 3 and 4) which makes it difficult to do this, the text will not be visible in the 4th step..

    i'm no coder either but my thought is that your idea could be made and then create a new string for just the 4th step..

    could this work, if yes, then how..??

    thx..

  6. Note that until you

    have almost completed the checkout process the shipping wont be calculated and

    shown..

    I have a question regarding the shippingcost calculation not showing until the 2nd, 3rd and 4th step

    it annoys me that the text 'Shipping' is visible in the 2nd and 3rd step, just because it's simply nothing there except for a -

    now, i tryed to remove the $lang['front']['cart']['shipping'] in includes/content/cart.inc.php but that wasn't such a good idea because then the shipping wasn't announced in the 4th step

    is there a way to remove the shipping text in the 2nd and 3rd step and have it visible in the 4th step??

    any ideas, thx..

  7. ... :D

    ..i got a...

    MySQL Error Occured

    1060: Duplicate column name 'stockUpdated'

    QUERY = ALTER TABLE `CubeCart_order_inv` ADD `stockUpdated` INT DEFAULT '0' NOT NULL ;

    is it just me or does anyone else get it too..??

    what should be done to this..??

    thx

    EDIT

    ..and yes.. the upgrade.php was in the root folder when updating... :ninja:

  8. ... :D

    oppss... this happiness was short lived... :D

    after updating to 3.0.1 and applying these changes i get.. :wub:

    Parse error: parse error, unexpected T_VARIABLE in /home/xxxxx/public_html/xxxxx/includes/content/cart.inc.php on line 547

    below you see the changed parts are marked red, the blue is where the fault is and the green is not there anymore..

    it's deleted according strawberryfusion.. :ninja:

    .. help appreciated...!!

    <?php

    /*

    +--------------------------------------------------------------------------

    |  CubeCart v3.0.1

    |  ========================================

    |  by Alistair Brookbanks

    | CubeCart is a Trade Mark of Devellion Limited

    |  © 2005 Devellion Limited

    |  Devellion Limited,

    |  Westfield Lodge,

    |  Westland Green,

    |  Little Hadham,

    |  Nr Ware, HERTS.

    |  SG11 2AL

    |  UNITED KINGDOM

    http://www.devellion.com

    | UK Private Limited Company No. 5323904

    |  ========================================

    |  Web: http://www.cubecart.com

    |  Date: Friday, 15 July 2005

    |  Email: info (at) cubecart (dot) com

    | License Type: CubeCart is NOT Open Source Software and Limitations Apply

    |  Licence Info: http://www.cubecart.com/site/faq/license.php

    +--------------------------------------------------------------------------

    | cart.inc.php

    |  ========================================

    | Core Checkout & Cart Pages

    +--------------------------------------------------------------------------

    */

    if(!isset($config)){

    echo "<html>\r\n<head>\r\n<title>Forbidden 403</title>\r\n</head>\r\n<body><h3>Forbidden 403</h3>\r\nThe document you are requesting is forbidden.\r\n</body>\r\n</html>";

    exit;

    }

    require_once("classes/cart.php");

    $cart = new cart();

    $basket = $cart->cartContents($ccUserData[0]['basket']);

    if(isset($_POST['shipping'])){

    $basket = $cart->setVar($_POST['shipping'],"shipCost");

    $headerLoc = "step4";

    } elseif(isset($_POST['delInf'])){

    $basket = $cart->setVar($_POST['delInf'],"delInf");

    $headerLoc = "step4";

    }

    function headerRedir() {

    global $headerLoc;

    if(isset($headerLoc) && !empty($headerLoc)) {

     

      header("Location: cart.php?act=".$headerLoc);

    } elseif(isset($_GET['act']) && !empty($_GET['act'])){

     

      header("Location: cart.php?act=".$_GET['act']);

    } else {

     

      header("Location: cart.php?act=step2");

    }

    exit;

    }

    if(isset($_GET['remove'])){

    $basket = $cart->remove($_GET['remove']);

    headerRedir();

    } elseif(isset($_POST['quan'])){

    foreach($_POST['quan'] as $key => $value){

     

      $basket = $cart->update($key,$value);

    }

    headerRedir();

    } elseif(isset($_GET['mode']) && $_GET['mode']=="emptyCart"){

    $basket = $cart->emptyCart();

    headerRedir();

    } elseif(isset($_POST['productCode']) && !empty($_POST['productCode'])) {

    $result = $db->select("SELECT productId FROM ".$glob['dbprefix']."CubeCart_inventory WHERE productCode = ".$db->mySQLSafe($_POST['productCode']));

    if($result == TRUE) {

     

      // check for product options (if so go to view product page)

      $noOpts = $db->numrows("SELECT product FROM ".$glob['dbprefix']."CubeCart_options_bot WHERE product = ".$db->mySQLSafe($result[0]['productId']));

     

      if($noOpts>0){

     

      header("Location: index.php?act=viewProd&productId=".$result[0]['productId']);

      exit;

     

      } else {

      $basket = $cart->add($result[0]['productId'],1,"");

      headerRedir();

     

      }

    }

    }

    $view_cart = new XTemplate ("skins/".$config['skinDir']."/styleTemplates/content/cart.tpl");

    $view_cart->assign("VAL_SKIN",$config['skinDir']);

    $view_cart->assign("LANG_VIEW_CART",$lang['front']['cart']['view_cart']);

    $view_cart->assign("LANG_CART",$lang['front']['cart']['cart']);

    $view_cart->assign("LANG_ADDRESS",$lang['front']['cart']['address']);

    $view_cart->assign("LANG_PAYMENT",$lang['front']['cart']['payment']);

    $view_cart->assign("LANG_COMPLETE",$lang['front']['cart']['complete']);

    $view_cart->assign("LANG_ADD_PRODCODE",$lang['front']['cart']['add_more']);

    $view_cart->assign("LANG_ADD",$lang['front']['cart']['add']);

    $view_cart->assign("LANG_QTY",$lang['front']['cart']['qty']);

    $view_cart->assign("LANG_PRODUCT",$lang['front']['cart']['product']);

    $view_cart->assign("LANG_CODE",$lang['front']['cart']['code']);

    $view_cart->assign("LANG_STOCK",$lang['front']['cart']['stock']);

    $view_cart->assign("LANG_PRICE",$lang['front']['cart']['price']);

    $view_cart->assign("LANG_LINE_PRICE",$lang['front']['cart']['line_price']);

    $view_cart->assign("LANG_DELETE",$lang['front']['cart']['delete']);

    $view_cart->assign("LANG_REMOVE_ITEM",$lang['front']['cart']['remove']);

    if($_GET['act']=="cart"){

    $view_cart->assign("CLASS_STEP2","class='txtcartProgressCurrent'");

    $view_cart->assign("CONT_VAL","cart.php?act=step1");

    } elseif($_GET['act']=="step2"){

    $view_cart->assign("CLASS_STEP2","class='txtcartProgressCurrent'");

    $view_cart->assign("CONT_VAL","cart.php?act=step3");

    } elseif($_GET['act']=="step3" OR $_GET['act']=="step4"){

    $view_cart->assign("CLASS_STEP3","class='txtcartProgressCurrent'");

    $view_cart->assign("LANG_INVOICE_ADDRESS",$lang['front']['cart']['invoice_address']);

    $view_cart->assign("LANG_DELIVERY_ADDRESS",$lang['front']['cart']['delivery_address']);

    $view_cart->assign("TXT_TITLE",$lang['front']['cart']['title']);

    $view_cart->assign("TXT_FIRST_NAME",$lang['front']['cart']['first_name']);

    $view_cart->assign("TXT_LAST_NAME",$lang['front']['cart']['last_name']);

    $view_cart->assign("TXT_ADD_1",$lang['front']['cart']['address2']);

    $view_cart->assign("TXT_ADD_2","");

    $view_cart->assign("TXT_TOWN",$lang['front']['cart']['town']);

    $view_cart->assign("TXT_COUNTY",$lang['front']['cart']['county']);

    $view_cart->assign("TXT_POSTCODE",$lang['front']['cart']['postcode']);

    $view_cart->assign("TXT_COUNTRY",$lang['front']['cart']['country']);

    // stick in delivery details

    if(isset($basket['delInf'])){

     

      $view_cart->assign("VAL_DEL_TITLE",$basket['delInf']['title']);

      $view_cart->assign("VAL_DEL_FIRST_NAME",$basket['delInf']['firstName']);

      $view_cart->assign("VAL_DEL_LAST_NAME",$basket['delInf']['lastName']);

      $view_cart->assign("VAL_DEL_ADD_1",$basket['delInf']['add_1']);

      $view_cart->assign("VAL_DEL_ADD_2",$basket['delInf']['add_2']);

      $view_cart->assign("VAL_DEL_TOWN",$basket['delInf']['town']);

      $view_cart->assign("VAL_DEL_COUNTY",$basket['delInf']['county']);

      $view_cart->assign("VAL_DEL_POSTCODE",$basket['delInf']['postcode']);

      $view_cart->assign("VAL_DEL_COUNTRY",countryName($basket['delInf']['country']));

    } else {

      $view_cart->assign("VAL_DEL_TITLE",$ccUserData[0]['title']);

      $view_cart->assign("VAL_DEL_FIRST_NAME",$ccUserData[0]['firstName']);

      $view_cart->assign("VAL_DEL_LAST_NAME",$ccUserData[0]['lastName']);

      $view_cart->assign("VAL_DEL_ADD_1",$ccUserData[0]['add_1']);

      $view_cart->assign("VAL_DEL_ADD_2",$ccUserData[0]['add_2']);

      $view_cart->assign("VAL_DEL_TOWN",$ccUserData[0]['town']);

      $view_cart->assign("VAL_DEL_COUNTY",$ccUserData[0]['county']);

      $view_cart->assign("VAL_DEL_POSTCODE",$ccUserData[0]['postcode']);

      $view_cart->assign("VAL_DEL_COUNTRY",countryName($ccUserData[0]['country']));

    }

    // stick in invoice details

    $view_cart->assign("VAL_TITLE",$ccUserData[0]['title']);

    $view_cart->assign("VAL_FIRST_NAME",$ccUserData[0]['firstName']);

    $view_cart->assign("VAL_LAST_NAME",$ccUserData[0]['lastName']);

    $view_cart->assign("VAL_ADD_1",$ccUserData[0]['add_1']);

    $view_cart->assign("VAL_ADD_2",$ccUserData[0]['add_2']);

    $view_cart->assign("VAL_TOWN",$ccUserData[0]['town']);

    $view_cart->assign("VAL_COUNTY",$ccUserData[0]['county']);

    $view_cart->assign("VAL_POSTCODE",$ccUserData[0]['postcode']);

    $view_cart->assign("VAL_COUNTRY",countryName($ccUserData[0]['country']));

    $view_cart->assign("LANG_CHANGE_INV_ADD",$lang['front']['cart']['edit_invoice_address']);

    $view_cart->assign("VAL_BACK_TO",$_GET['act']);

    }

    if($_GET['act']=="step3") {

    if($config['shipAddressLock'] == 1){

      $delInf['title'] = $ccUserData[0]['title'];

      $delInf['firstName'] = $ccUserData[0]['firstName'];

      $delInf['lastName'] = $ccUserData[0]['lastName'];

      $delInf['add_1'] = $ccUserData[0]['add_1'];

      $delInf['add_2'] = $ccUserData[0]['add_2'];

      $delInf['town'] = $ccUserData[0]['town'];

      $delInf['county'] = $ccUserData[0]['county'];

      $delInf['postcode'] = $ccUserData[0]['postcode'];

      $delInf['country'] = $ccUserData[0]['country'];

     

      $basket = $cart->setVar($delInf,"delInf");

      header("Location: cart.php?act=step4");

      exit;

    }

    $view_cart->assign("CONT_VAL","java script:submitDoc('cart');");

    $countries = $db->select("SELECT id, printable_name FROM ".$glob['dbprefix']."CubeCart_iso_countries ORDER BY printable_name");

    for($i=0; $i<count($countries); $i++){

     

      if($countries[$i]['id'] == $ccUserData[0]['country']){

       

        $view_cart->assign("COUNTRY_SELECTED","selected='selected'");

     

      } else {

       

        $view_cart->assign("COUNTRY_SELECTED","");

     

      }

     

      $view_cart->assign("VAL_DEL_COUNTRY_ID",$countries[$i]['id']);

      $countryName = "";

      $countryName = $countries[$i]['printable_name'];

      if(strlen($countryName)>20){

        $countryName = substr($countryName,0,20)."&hellip;";

      }

      $view_cart->assign("VAL_DEL_COUNTRY_NAME",$countryName);

     

      $view_cart->parse("view_cart.cart_true.step_3.country_opts");

     

      }

      $view_cart->parse("view_cart.cart_true.step_3");

    } elseif($_GET['act']=="step4") {

    if($config['shipAddressLock'] == 0){

    $view_cart->assign("LANG_CHANGE_DEL_ADD",$lang['front']['cart']['edit_delivery_address']);

    $view_cart->parse("view_cart.cart_true.step_4.edit_btn");

    }

    $view_cart->assign("CONT_VAL","cart.php?act=step5");

    $view_cart->parse("view_cart.cart_true.step_4");

    }

    if($basket['conts'] == TRUE) {

    $tax = 0;

    $taxCustomer = 0;

    // work out if customer is obliged to pay tax or not

    if($ccUserData[0]['country']==$config['taxCountry']){

      if($config['taxCounty']==0){

      // tax customer

      $taxCustomer = 1;

      } elseif($config['taxCounty']==$ccUserData[0]['zoneId']){

      // tax customer

      $taxCustomer = 1;

      }

    }

    $totalWeight = "";

    $i = 0;

    $subTotal = 0;

    $shipCost = 0;

    $grandTotal = 0;

    foreach($basket['conts'] as $key => $value){

     

      $i++;

      $productId = $cart->getProductId($key);

      // get product details

     

      // if shipping by category is enabled we need to get the values too

      $module = fetchDbConfig("Per_Category");

      $shipByCat = $module['status'];

     

      $extraJoin = "";

     

      if($shipByCat==1 && $_GET['act']=="step4"){

      $extraJoin = "INNER JOIN ".$glob['dbprefix']."CubeCart_category ON ".$glob['dbprefix']."CubeCart_inventory.cat_id = ".$glob['dbprefix']."CubeCart_category.cat_id";

      }

     

      $product = $db->select("SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory INNER JOIN ".$glob['dbprefix']."CubeCart_taxes ON ".$glob['dbprefix']."CubeCart_taxes.id = taxType ".$extraJoin." WHERE productId=".$db->mySQLSafe($productId));

      if(($val = prodAltLang($product[0]['productId'])) == TRUE){

     

      $product[0]['name'] = $val['name'];

     

      }

      $view_cart->assign("TD_CART_CLASS",cellColor($i, $tdEven="tdcartEven", $tdOdd="tdcartOdd"));

      $view_cart->assign("VAL_PRODUCT_ID",$productId);

      $view_cart->assign("VAL_CURRENT_STEP",$_GET['act']);

      $view_cart->assign("VAL_PRODUCT_KEY",$key);

     

      if(empty($product[0]["image"])){

     

      $view_cart->assign("VAL_IMG_SRC","skins/".$config['skinDir']."/styleImages/thumb_nophoto.gif");

     

      } else {

     

      $view_cart->assign("VAL_IMG_SRC","images/uploads/thumbs/thumb_".$product[0]["image"]);

     

      }

     

     

      // only calculate shipping IF the product is tangible

      if($product[0]["digital"]==0){

      $orderTangible = TRUE;

      }

     

      $view_cart->assign("VAL_PRODUCT_NAME",$product[0]["name"]);

      $view_cart->assign("VAL_PRODUCT_CODE",$product[0]["productCode"]); 

     

      // build the product options

      $optionKeys = $cart->getOptions($key);

     

      $optionsCost = 0;

      $plainOpts = "";

     

      if(!empty($optionKeys)){

     

      $options = explode(".",$optionKeys);

     

      foreach($options as $value)

      {

        // look up options in database

        $option = $db->select("SELECT ".$glob['dbprefix']."CubeCart_options_bot.option_id, ".$glob['dbprefix']."CubeCart_options_bot.value_id, option_price, option_symbol, value_name, option_name, assign_id FROM `".$glob['dbprefix']."CubeCart_options_bot` INNER JOIN `".$glob['dbprefix']."CubeCart_options_mid` ON ".$glob['dbprefix']."CubeCart_options_mid.value_id = ".$glob['dbprefix']."CubeCart_options_bot.value_id INNER JOIN `".$glob['dbprefix']."CubeCart_options_top` ON ".$glob['dbprefix']."CubeCart_options_bot.option_id = ".$glob['dbprefix']."CubeCart_options_top.option_id WHERE assign_id = ".$value);

       

        $view_cart->assign("VAL_OPT_NAME",$option[0]['option_name']);

        $view_cart->assign("VAL_OPT_VALUE",$option[0]['value_name']);

       

        $plainOpts .= $option[0]['option_name']." - ".$option[0]['value_name']."\r\n";

       

        if($option[0]['option_price']>0){

       

        if($option[0]['option_symbol']=="+"){

       

          $optionsCost = $optionsCost + $option[0]['option_price'];

     

        } elseif($option[0]['option_symbol']=="-"){

     

          $optionsCost = $optionsCost - $option[0]['option_price'];

     

        } elseif($option[0]['option_symbol']=="~"){

       

          $optionsCost = 0;

       

        }

       

        }

        $view_cart->parse("view_cart.cart_true.repeat_cart_contents.options");

      }

     

      }

      if($product[0]["useStockLevel"]==1){

     

      $view_cart->assign("VAL_INSTOCK",$product[0]["stock_level"]);

     

      } else {

     

      $view_cart->assign("VAL_INSTOCK","&infin;");

     

      }

     

      if(($config['outofstockPurchase']==1) && ($product[0]["stock_level"]<$cart->cartArray['conts'][$key]["quantity"]) && ($product[0]["useStockLevel"]==1)) {

     

      $view_cart->assign("VAL_STOCK_WARN",$lang['front']['cart']['stock_warn']);

     

      $quantity = $cart->cartArray['conts'][$key]["quantity"];

      $view_cart->parse("view_cart.repeat_cart_contents.stock_warn");

     

      } elseif(($config['outofstockPurchase']==0) && ($product[0]["stock_level"]<$cart->cartArray['conts'][$key]["quantity"]) && ($product[0]["useStockLevel"]==1)) {

     

      $view_cart->assign("VAL_STOCK_WARN",$lang['front']['cart']['amount_capped']." ".$product[0]["stock_level"].".");

     

      $quantity = $product[0]["stock_level"];

     

      $basket = $cart->update($key,$quantity);

     

      $view_cart->parse("view_cart.cart_true.repeat_cart_contents.stock_warn");

     

      } else {

     

      $quantity = $cart->cartArray['conts'][$key]["quantity"];

     

      }

     

      $view_cart->assign("VAL_QUANTITY",$quantity);

     

      if(salePrice($product[0]['price'], $product[0]['sale_price'])==FALSE){

     

      $price = $product[0]['price'];

     

      } else {

     

      $price = salePrice($product[0]['price'], $product[0]['sale_price']);

     

      }

     

      $price = $price + ($optionsCost);

     

      if(isset($_GET['act']) && $_GET['act']=="step4"){

      // set live vars for order inv and its the last step

      $basket = $cart->setVar($productId,"productId","invArray",$i);

      $basket = $cart->setVar($product[0]['name'],"name","invArray",$i);

      $basket = $cart->setVar($product[0]['productCode'],"productCode","invArray",$i);

      $basket = $cart->setVar($plainOpts,"prodOptions","invArray",$i);

      $basket = $cart->setVar(sprintf("%.2f",$price*$quantity),"price","invArray",$i);

      $basket = $cart->setVar($quantity,"quantity","invArray",$i);

      $basket = $cart->setVar($product[0]['digital'],"digital","invArray",$i);

      }

     

      $view_cart->assign("VAL_IND_PRICE",priceFormat($price));

     

      $view_cart->assign("VAL_LINE_PRICE",priceFormat($price*$quantity));

     

      if($shipByCat==1 && $_GET['act']=="step4"){

      // calculate the line category shipping price

      include("modules/shipping/Per_Category/line.inc.php");

     

      }

     

      $subTotal = $subTotal + ($price * $quantity);

     

      $view_cart->parse("view_cart.cart_true.repeat_cart_contents");

     

      // work out weight

      if($product[0]['prodWeight']>0 && $product[0]['digital']==0){

     

      $totalWeight = ($product[0]['prodWeight'] * $quantity) + $totalWeight;

     

      }

     

      // work out tax

    if($config['priceIncTax']==0 && $taxCustomer==1){

      $lineTax = ($product[0]['percent'] / 100) * $subTotal;

      $tax = $tax + $lineTax;

    }

    }

    // calculate shipping when we have reached step4 or over

    if($_GET['act']=="step4" && $orderTangible==TRUE) {

      $shippingModules = $db->select("SELECT folder FROM ".$glob['dbprefix']."CubeCart_Modules WHERE module='shipping' AND status = 1");

     

      $noItems = $cart->noItems();

      $optNo = "";

      $sum = 0;

     

      if($shippingModules == TRUE){

     

      $shippingPrice = "<select name='shipping' onchange=\"submitDoc('cart');\">";

     

      // add shipping cost if it has already been made

      if(isset($basket['shipCost']) && !empty($basket['shipCost'])) {

     

     

        $shipArray = explode("|",$basket['shipCost']);

       

        $optNo = $shipArray[0];

        if(isset($shipArray[1])){

        $shipCost = $shipArray[1];

        }

     

      }

     

      for($i=0; $i<count($shippingModules); $i++){

        include("modules/shipping/".$shippingModules[$i]['folder']."/calc.php");

       

        // add shipping cost if it has not already been made

       

        if(!isset($basket['shipCost']) && empty($basket['shipCost'])) {

       

        $shipCost = sprintf("%.2f", $sum);

        $basket = $cart->setVar($i."|".$shipCost,"shipCost");

       

        }

     

      }

     

      $shippingPrice .= "</select>";

     

      } else {

     

      $shippingPrice .= "<select name='shipping' onchange=\"submitDoc('cart');\">\r\n<option value='0.00'>".$lang['front']['cart']['free_shipping']."</option>\r\n</select>";

      $basket = $cart->setVar($lang['front']['cart']['free_shipping'],"shipMethod");

     

      }

     

     

    } elseif($_GET['act']=="step4"){

      $shippingPrice = "<select name='shipping'><option value='0.00'>".$lang['front']['cart']['free_shipping']."</option></select>";

      $basket = $cart->setVar($lang['front']['cart']['free_shipping'],"shipMethod");

    } else {

      $shippingPrice = $lang['front']['cart']['na'];

    }

    // work out tax

      if($config['priceIncTax']==0 && $taxCustomer==1){

      $lineTax = $subTotal - ($subTotal /(1+($product[0]['percent'] / 100)));

      $shipTax = $shipCost - ($shipCost /(1+($product[0]['percent'] / 100)));

      $tax = $lineTax + $shipTax;

      }

    $view_cart->assign("LANG_SHIPPING",$lang['front']['cart']['shipping'])

    $view_cart->assign("VAL_SHIPPING",$shippingPrice);

    $view_cart->assign("LANG_TAX",$lang['front']['cart']['tax']);

    if($tax>0){

     

      $view_cart->assign("VAL_TAX",priceFormat($tax));

    } else {

     

      $view_cart->assign("VAL_TAX",$lang['front']['cart']['na']);

    }

    $view_cart->assign("LANG_SUBTOTAL",$lang['front']['cart']['subtotal']);

    $view_cart->assign("VAL_SUBTOTAL",priceFormat($subTotal));

    $grandTotal = $subTotal + $shipCost;

    $view_cart->assign("LANG_CART_TOTAL",$lang['front']['cart']['cart_total']);

    $view_cart->assign("VAL_CART_TOTAL",priceFormat($grandTotal));

    if(isset($_GET['act']) && $_GET['act']=="step4"){

     

      // build array of price vars in session data

      $basket = $cart->setVar(sprintf("%.2f",$subTotal),"subTotal");

      $basket = $cart->setVar(sprintf("%.2f",$tax),"tax");

      $basket = $cart->setVar(sprintf("%.2f",$shipCost),"shipCostAmount");

      $basket = $cart->setVar(sprintf("%.2f",$grandTotal),"grandTotal");

    }

    $view_cart->assign("LANG_UPDATE_CART_DESC",$lang['front']['cart']['if_changed_quan']);

    $view_cart->assign("LANG_UPDATE_CART",$lang['front']['cart']['update_cart']);

    $view_cart->assign("LANG_CHECKOUT",$lang['front']['cart']['continue']);

    $view_cart->assign("VAL_FORM_ACTION",currentPage());

    $view_cart->parse("view_cart.cart_true");

    } else {

    $view_cart->assign("LANG_CART_EMPTY",$lang['front']['cart']['cart_empty']);

    $view_cart->parse("view_cart.cart_false");

    }

    $view_cart->parse("view_cart");

    $page_content = $view_cart->text("view_cart");

    ?>

  9. ... :P

    thx strawberryfusion.. you're a god.. :D

    this is the way tax should be calculated... :)

    you understood the whole thing up there.. <_<

    ..and i think others with me and with the same problem will agree

    that this tax problem is now officially solved.. B)

    ..however there is still this problem that the tax is not shown if you're not looged in.. ;)

  10. .... :)

    ..immortalis.. sorry if i wasn't clear enough... :huh:

    ..in the language folder you see other folders representing other countries... ;)

    you choose any country folder of your choise and then inside that you see lang.inc.php... ;)

    that's the file you edit when you make changes to the displayed language that i meantioned above... :on2long:

    i hope that helped... B)

  11. .... :o

    hi evilhomer and thx for making an effort with this...

    ..ok let's see if we can get this right then...

    the first part of this... 'mod' is already made in a previous post up there...

    let's start with another smaller problem first i just notice while preparing the actual one...

    when i'm not logged in there is no tax displayed...!!!

    the tax must be displayed... plz compare the two pictures below... and you'll see

    it would be nice if this could be corrected... thx..!!

    nologgintax.jpg

    loggintax.jpg

    ===================

    now.. to the actual problem...

    when one of the shipping modules is added, there is a tax setting at the bottom that adds any tax of choise to the shippingcost.. right..??

    ('Generell Moms' is swedish and = 'General Tax' in english)

    shiptax.jpg

    ..now.. i would like that tax from the shipping (this concerns all the shippings) to be added to the tax under the subtotal (look below)..

    correcttax.jpg

    the result of this will be as follows..

    i want 20% (the tax) taken from the sum 44.00kr (point 1)(but remeber that it should still show 44.00 as the shippingcost)

    and those 20% should be added to (point 2)...

    it should look like this below.. (with those amounts in the picture as example)

    Subtotal: 15.50Kr

    Tax: 11.90Kr (the calculation goes 44.00 - 20% = 8.80)(those 8.80 + 20% from 15.50 is 3.10 which = 11.90 in total tax)

    Shipping: 44.00Kr

    Cart Total: 59.50Kr

    i hope it's clear enough...

    thx once again for all help here... i know it's appreciated from others aswell..

  12. ... :)

    ..thx rodders.. and pardon me.. i didn't know the french laws concerning this matter... :whistle:

    anyhow.. then i hope anyone of the coders will take a look into this and help with the changes.. because there's no way this can be changed through the settnings in admin...

    btw.. did you try the replaced code i posted here..??

    is that the same thing you're after..??

    thx

  13. ... :lol:

    ..well.. i think i've made some progress with this... :mellow:

    and plz.. if someone knows better php than me plz help or correct me...

    ..i want help to put the last brick in this puzzle...

    ..to be able to just view the tax and not being added here, there and everywhere, i've done like this... ;)

    first.. set the 'Include tax in prices?' setting in admin section to 'No'

    then open up cart.inc.php in the includes/content folder...

    and on line 476-477 you see...

    $lineTax = ($product[0]['percent'] / 100) * $subTotal;

    $tax = $tax + $lineTax;

    replace that with this..

    $tax = ($product[0]['percent'] / 125) * $subTotal;

    $tax = $tax + $lineTax;

    then further down on line 565-567 you see...

    $grandTotal = $subTotal + $tax + $shipCost;

    $view_cart->assign("LANG_CART_TOTAL",$lang['front']['cart']['cart_total']);

    $view_cart->assign("VAL_CART_TOTAL",priceFormat($grandTotal));

    replace that with this...

    $grandTotal = $subTotal + $shipCost;

    $view_cart->assign("LANG_CART_TOTAL",$lang['front']['cart']['cart_total']);

    $view_cart->assign("VAL_CART_TOTAL",priceFormat($grandTotal));

    after this open up your lang.inc.php file and somewhere around line 2108 you see...

    'tax' => "Tax:",
    (in swedish - 'tax' => "moms:",)

    change to...

    'tax' => "Tax Included:",
    (in swedish - 'tax' => "Varav moms:",)

    now.. according my tests everything should just work fine... (BUT don't take it for granted - cause i'm no php programmer)...

    EXCEPT for one last thing..

    ..it's where i needed help with the last brick in this puzzle.. :errm:

    ..i asume that the shippingcost which is presented in the dropdownlist in the last step are splitted in 2 bits before it shows there.. 1 the shippingcost taxfree and the other the tax...

    now... what i need is the tax from that part to be added to the tax shown under the subtotal in the store...

    ..i hope someone better with php can help me and those others that are depended on and need this function to working properly...

    one other thing here... what the heck is a Linetax..?? :wacko: (look up in my first change - $linetax)

    thx...

  14. ... :unsure:

    it happened to me too...

    ..if the customer doesn't touch the dropdown list with shippingcosts then they are infact able to process an order without actually having any shippingcosts at all...

    .. shippingcosts are not shown on the reciept either... :P

    ..yesterday i reported it to flyspray.. after that we'll see...

  15. ... :unsure:

    ..has anyone of you checked what the settings in admin is set for.. ??

    "No" = no tax is added but will show it

    "Yes" = tax is added but will not show it

    ..hmm.. '..Ohh cc3 works in mysterious ways..' :P

  16. ... :P

    ..have you checked permissions..??

    images/upload/

    images/upload/thumbs/

    all to 0777..???

    otherwise if not...

    ..you need to be more specific.. :unsure:

×
×
  • Create New...